Sunday, August 4, 2013

[android-developers] Android emulator crash due to missing initial system image path

Dear Android Emulator Team,
 
I got a problem after I copied system.img to /.android/avd/AVD_NAME/ and renamed it to system-qemu.img.
After I pressed "start" button from AVD Manager to start the emulator the error message "Missing initial system image path" is shown.
 
I tried to trace the code found that in main.c (external/qemu/android/main.c)
        if (rwImage != NULL) {
            /* Use the read/write image file directly */
            hw->disk_systemPartition_path     = rwImage;
            hw->disk_systemPartition_initPath = NULL;
            D("Using direct system image: %s", rwImage);
        } else if (initImage != NULL) {
            hw->disk_systemPartition_path = NULL;
            hw->disk_systemPartition_initPath = initImage;
            D("Using initial system image: %s", initImage);
       }
it initalizes the hw->disk_systemPartition_path and hw->disk_systemPartition_initPath.
 
In vl-android.c (external/qemu)
    /* Initialize system partition image */
    {
        char        tmp[PATH_MAX+32];
        const char* sysImage = android_hw->disk_systemPartition_path;
        const char* initImage = android_hw->disk_systemPartition_initPath;
        uint64_t    sysBytes = android_hw->disk_systemPartition_size;
         ...
        if (sysImage && *sysImage) {
            if (filelock_create(sysImage) == NULL) {
                fprintf(stderr,"WARNING: System image already in use, changes will not persist!\n");
                /* If there is no file= parameters, nand_add_dev will create
                 * a temporary file to back the partition image. */
            } else {
                pstrcat(tmp,sizeof(tmp),",file=");
                pstrcat(tmp,sizeof(tmp),sysImage);
            }
        }
        if (initImage && *initImage) {
            if (!path_exists(initImage)) {
                PANIC("Invalid initial system image path: %s", initImage);
            }
            pstrcat(tmp,sizeof(tmp),",initfile=");
            pstrcat(tmp,sizeof(tmp),initImage);
        } else {
            PANIC("Missing initial system image path!");
        }
        nand_add_dev(tmp);
    }
It will check system-qemu.img is exist or not then check system.img is exist or not.
 
My question is why the initImage path is null then the emulator is died ?
 
Should this checking rule be modified to
 
if (sysImage && *sysImage) {
}
else if (initImage && *initImage) {
}
else {
}
 
Please kindly help me to solve this problem.
 
TKS & Regards,
MIKE

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate