diff options
author | David 'Digit' Turner <digit@android.com> | 2011-03-01 07:06:18 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-03-01 07:06:18 -0800 |
commit | f7cdd20aac6980871eb8161d6eb08ee2c974e3b8 (patch) | |
tree | ea4ae5d5dd91b9473a4fd34c46e50f7af246f2a0 /android/avd | |
parent | 20a818b30e646ce1952c2f79e731d4ac2bc7a3d8 (diff) | |
parent | 40841b2d221273a08abfe20824e7631211ade31d (diff) | |
download | external_qemu-f7cdd20aac6980871eb8161d6eb08ee2c974e3b8.zip external_qemu-f7cdd20aac6980871eb8161d6eb08ee2c974e3b8.tar.gz external_qemu-f7cdd20aac6980871eb8161d6eb08ee2c974e3b8.tar.bz2 |
Merge "Move system image initialization to core."
Diffstat (limited to 'android/avd')
-rw-r--r-- | android/avd/hardware-properties.ini | 23 | ||||
-rw-r--r-- | android/avd/hw-config-defs.h | 12 | ||||
-rw-r--r-- | android/avd/info.c | 50 | ||||
-rw-r--r-- | android/avd/info.h | 9 |
4 files changed, 38 insertions, 56 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini index 69abdaa..5ecfcc4 100644 --- a/android/avd/hardware-properties.ini +++ b/android/avd/hardware-properties.ini @@ -222,26 +222,33 @@ default = abstract = Path to the ramdisk image description = Path to the ramdisk image. -# Path to the system partition. +# System partition image(s). +# +# disk.systemPartition.path points to the read/write system partition image. +# if empty, a temporary file will be created, initialized with the content +# of .initPath +# +# disk.systemPartition.initPath is only used when .path is empty. It must +# then point to a read-only initialization system image file. +# +# disk.systemPartition.size is the ideal size of the system partition. The +# size is ignored if the actual system partition image is larger. Otherwise, +# it indicates the maximum size the disk image file can grow to. +# name = disk.systemPartition.path type = string -default = <init> -abstract = Path to system partition image -description = Path to read/write system partition image during emulation. If special value '<init>' is used, a temporary file will be created, populated with the content of .initPath +default = +abstract = Path to runtime system partition image -# Initial path to the system partition. name = disk.systemPartition.initPath type = string default = abstract = Initial system partition image -description = Only used if .path is '<init>', path to an initial system image that will be copied into the temporary system image file before launch. -# System partition size. name = disk.systemPartition.size type = diskSize default = 0 abstract = Ideal size of system partition -description = ideal size of system partition. Ignored if smaller than the size of .path (or .initPath). Otherwise, gives the maximum size the partition is allowed to grow dynamically. # Path to the data partition. name = disk.dataPartition.path diff --git a/android/avd/hw-config-defs.h b/android/avd/hw-config-defs.h index 6c8ccae..e2def30 100644 --- a/android/avd/hw-config-defs.h +++ b/android/avd/hw-config-defs.h @@ -223,23 +223,23 @@ HWCFG_STRING( HWCFG_STRING( disk_systemPartition_path, "disk.systemPartition.path", - "<init>", - "Path to system partition image", - "Path to read/write system partition image during emulation. If special value '<init>' is used, a temporary file will be created, populated with the content of .initPath") + "", + "Path to runtime system partition image", + "") HWCFG_STRING( disk_systemPartition_initPath, "disk.systemPartition.initPath", "", "Initial system partition image", - "Only used if .path is '<init>', path to an initial system image that will be copied into the temporary system image file before launch.") + "") HWCFG_DISKSIZE( disk_systemPartition_size, "disk.systemPartition.size", "0", "Ideal size of system partition", - "ideal size of system partition. Ignored if smaller than the size of .path (or .initPath). Otherwise, gives the maximum size the partition is allowed to grow dynamically.") + "") HWCFG_STRING( disk_dataPartition_path, @@ -260,7 +260,7 @@ HWCFG_DISKSIZE( "disk.dataPartition.size", "0", "Ideal size of data partition", - "ideal size of data partition. Ignored if smaller than the size of .path (or .initPath). Otherwise, gives the maximum size the partition is allowed to grow dynamically.") + "") HWCFG_STRING( disk_snapStorage_path, diff --git a/android/avd/info.c b/android/avd/info.c index ca4f0cf..a23cd63 100644 --- a/android/avd/info.c +++ b/android/avd/info.c @@ -470,6 +470,7 @@ _checkSkinSkinsDir( const char* skinDirRoot, char temp[MAX_PATH], *p = temp, *end = p + sizeof(temp); p = bufprint(temp, end, "%s/skins/%s", skinDirRoot, skinName); + DD("Probing skin directory: %s", temp); if (p >= end || !path_exists(temp)) { DD(" ignore bad skin directory %s", temp); return NULL; @@ -1098,31 +1099,6 @@ EXIT: return l->pPath[0]; } -/* Attempts to load an AVD image, but does not kill the process if loading - * fails. - */ -static void -imageLoader_loadOptional( ImageLoader *l, AvdImageType img_type, - const char *forcedPath ) -{ - imageLoader_set (l, img_type); - imageLoader_load(l, IMAGE_OPTIONAL | - IMAGE_IGNORE_IF_LOCKED); - - /* if the file was not found, ignore it */ - if (l->pPath[0] && !path_exists(l->pPath[0])) - { - D("ignoring non-existing %s at %s: %s", - l->imageText, l->pPath[0], strerror(errno)); - - /* if the user provided the path by hand, warn him. */ - if (forcedPath != NULL) - dwarning("ignoring non-existing %s image", l->imageText); - - imageLoader_setPath(l, NULL); - } -} - /* find the correct path of all image files we're going to need * and lock the files that need it. */ @@ -1135,14 +1111,6 @@ _avdInfo_getImagePaths(AvdInfo* i, AvdInfoParams* params ) imageLoader_init(l, i, params); - /* the system image - * - * if there is one in the content directory just lock - * and use it. - */ - imageLoader_set ( l, AVD_IMAGE_INITSYSTEM ); - imageLoader_load( l, IMAGE_REQUIRED | IMAGE_SEARCH_SDK | IMAGE_DONT_LOCK ); - /* the data partition - this one is special because if it * is missing, we need to copy the initial image file into it. * @@ -1335,15 +1303,6 @@ _avdInfo_getBuildImagePaths( AvdInfo* i, AvdInfoParams* params ) AFREE(srcData); - /** load the system image. read-only. the caller must - ** take care of checking the state - **/ - imageLoader_set ( l, AVD_IMAGE_INITSYSTEM ); - imageLoader_load( l, IMAGE_REQUIRED | IMAGE_DONT_LOCK ); - - /* force the system image to read-only status */ - l->pState[0] = IMAGE_STATE_READONLY; - return 0; } @@ -1522,6 +1481,13 @@ avdInfo_getSnapStoragePath( AvdInfo* i ) } char* +avdInfo_getSystemImagePath( AvdInfo* i ) +{ + const char* imageName = _imageFileNames[ AVD_IMAGE_USERSYSTEM ]; + return _avdInfo_getContentFilePath(i, imageName); +} + +char* avdInfo_getSystemInitImagePath( AvdInfo* i ) { const char* imageName = _imageFileNames[ AVD_IMAGE_INITSYSTEM ]; diff --git a/android/avd/info.h b/android/avd/info.h index afc71fb..4191165 100644 --- a/android/avd/info.h +++ b/android/avd/info.h @@ -147,7 +147,16 @@ char* avdInfo_getCachePath( AvdInfo* i ); char* avdInfo_getDefaultCachePath( AvdInfo* i ); +/* avdInfo_getSystemImagePath() will return NULL, except if the AVD content + * directory contains a file named "system-qemu.img". + */ +char* avdInfo_getSystemImagePath( AvdInfo* i ); + +/* avdInfo_getSystemInitImagePath() retrieves the path to the read-only + * initialization image for this disk image. + */ char* avdInfo_getSystemInitImagePath( AvdInfo* i ); + char* avdInfo_getDataInitImagePath( AvdInfo* i ); /* Returns the path to a given AVD image file. This will return NULL if |