From 9ff69721d24f81317183ddb2e9e352bb34650752 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Tue, 13 Sep 2011 12:32:52 +0200 Subject: Fix -ramdisk option handling. For some reason, there was a bug, where the option was being ignored if set from the command-line. Change-Id: I61c6e3127b469f4ec661b834b15c4da0841551af --- android/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'android/main.c') diff --git a/android/main.c b/android/main.c index f20ea7b..8fb9485 100644 --- a/android/main.c +++ b/android/main.c @@ -485,8 +485,15 @@ int main(int argc, char **argv) args[n++] = opts->dns_server; } - hw->disk_ramdisk_path = avdInfo_getRamdiskPath(avd); - D("autoconfig: -ramdisk %s", hw->disk_ramdisk_path); + /* opts->ramdisk is never NULL (see createAVD) here */ + if (opts->ramdisk) { + AFREE(hw->disk_ramdisk_path); + hw->disk_ramdisk_path = ASTRDUP(opts->ramdisk); + } + else if (!hw->disk_ramdisk_path[0]) { + hw->disk_ramdisk_path = avdInfo_getRamdiskPath(avd); + D("autoconfig: -ramdisk %s", hw->disk_ramdisk_path); + } /* -partition-size is used to specify the max size of both the system * and data partition sizes. -- cgit v1.1