char* avdInfo_getKernelPath( AvdInfo* i ) { const char* imageName = _imageFileNames[ AVD_IMAGE_KERNEL ]; char* kernelPath = _avdInfo_getContentOrSdkFilePath(i, imageName); if (kernelPath == NULL && i->inAndroidBuild) { /* When in the Android build, look into the prebuilt directory * for our target architecture. */ char temp[PATH_MAX], *p = temp, *end = p + sizeof(temp); const char* suffix = ""; char* abi; /* If the target ABI is armeabi-v7a, then look for * kernel-qemu-armv7 instead of kernel-qemu in the prebuilt * directory. */ abi = path_getBuildTargetAbi(i->androidOut); if (!strcmp(abi,"armeabi-v7a")) { suffix = "-armv7"; } AFREE(abi); p = bufprint(temp, end, "%s/prebuilts/qemu-kernel/%s/kernel-qemu%s", i->androidBuildRoot, i->targetArch, suffix); if (p >= end || !path_exists(temp)) { derror("bad workspace: cannot find prebuilt kernel in: %s", temp); exit(1); } kernelPath = ASTRDUP(temp); } return kernelPath; }
static void _avdInfo_getPropertyFile(AvdInfo* i, const char* propFileName, FileData* data ) { char* filePath = _avdInfo_getContentOrSdkFilePath(i, propFileName); if (!filePath) { D("No %s property file found.", propFileName); return; } _avdInfo_readPropertyFile(i, filePath, data); free(filePath); }
static int _avdInfo_findContentOrSdkImage(AvdInfo* i, AvdImageType id) { const char* fileName = _imageFileNames[id]; char* path = _avdInfo_getContentOrSdkFilePath(i, fileName); i->imagePath[id] = path; i->imageState[id] = IMAGE_STATE_READONLY; if (path == NULL) return -1; else return 0; }
char* avdInfo_getCharmapFile( AvdInfo* i, const char* charmapName ) { char fileNameBuff[PATH_MAX]; const char* fileName; if (charmapName == NULL || charmapName[0] == '\0') return NULL; if (strstr(charmapName, ".kcm") == NULL) { snprintf(fileNameBuff, sizeof fileNameBuff, "%s.kcm", charmapName); fileName = fileNameBuff; } else { fileName = charmapName; } return _avdInfo_getContentOrSdkFilePath(i, fileName); }
char* avdInfo_getRamdiskPath( AvdInfo* i ) { const char* imageName = _imageFileNames[ AVD_IMAGE_RAMDISK ]; return _avdInfo_getContentOrSdkFilePath(i, imageName); }
char* avdInfo_getDataInitImagePath( AvdInfo* i ) { const char* imageName = _imageFileNames[ AVD_IMAGE_INITDATA ]; return _avdInfo_getContentOrSdkFilePath(i, imageName); }
char* avdInfo_getSystemInitImagePath( AvdInfo* i ) { const char* imageName = _imageFileNames[ AVD_IMAGE_INITSYSTEM ]; return _avdInfo_getContentOrSdkFilePath(i, imageName); }