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
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 @@
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.