Search code examples
androidandroid-emulatorandroid-source

"ko:Cannot determine type of userdata partition: no image files!" when running compiled AOSP image using emulator


I built the AOSP source tree(envsetup, lunch and make) and would like to run the image built in an emulator. I ran the command

$ emulator-arm -verbose -system system.img -sysdir system -kernel kernel \ -ramdisk ramdisk.img -initdata userdata.img -data data.img -datadir data

The emulator starts and terminates with following error.

ko:Cannot determine type of userdata partition: no image files!

Does anyone know why this error is generated and how to fix this?

Full verbose output from emulator.

emulator: Read property file at system/system/build.prop
emulator: Cannot find boot properties file: system/boot.prop

emulator: Found target API sdkVersion: 17

emulator: virtual device has no config file - no problem
emulator: using core hw config path: system/hardware-qemu.ini
emulator: autoconfig: -skin HVGA
emulator: autoconfig: -skindir (null)
emulator: keyset loaded from: /home/dnivra/.android/default.keyset
emulator: skin name 'HVGA' aliased to '320x480'
emulator: found magic skin width=320 height=480 bpp=16

emulator: Auto-detect: Kernel image requires legacy device naming scheme.
emulator: Auto-detect: Kernel does support YAFFS2 partitions.
emulator: Using initial system image: system.img
emulator: Physical RAM size: 96MB

emulator: GPU emulation is disabled
emulator: WARNING: CPU acceleration only works with x86/x86_64 system images.
emulator: Auto-config: -qemu -cpu cortex-a8
Content of hardware configuration file:
  hw.cpu.arch = arm
  hw.cpu.model = cortex-a8
  hw.ramSize = 96
  hw.screen = touch
  hw.mainKeys = yes
  hw.trackBall = yes
  hw.keyboard = no
  hw.keyboard.lid = no
  hw.keyboard.charmap = qwerty2
  hw.dPad = yes
  hw.gsmModem = yes
  hw.gps = yes
  hw.battery = yes
  hw.accelerometer = yes
  hw.audioInput = yes
  hw.audioOutput = yes
  hw.sdCard = yes
  disk.cachePartition = yes
  disk.cachePartition.size = 66m
  hw.lcd.width = 320
  hw.lcd.height = 480
  hw.lcd.depth = 16
  hw.lcd.density = 160
  hw.lcd.backlight = yes
  hw.gpu.enabled = no
  hw.initialOrientation = portrait
  hw.camera.back = emulated
  hw.camera.front = none
  vm.heapSize = 16
  hw.sensors.proximity = yes
  hw.sensors.magnetic_field = yes
  hw.sensors.orientation = yes
  hw.sensors.temperature = yes
  hw.useext4 = yes
  kernel.path = kernel
  kernel.parameters =  androidboot.hardware=goldfish android.checkjni=1
  kernel.newDeviceNaming = no
  kernel.supportsYaffs2 = yes
  disk.ramdisk.path = ramdisk.img
  disk.systemPartition.initPath = system.img
  disk.systemPartition.size = 200m
  disk.dataPartition.path = data/data.img
  disk.dataPartition.size = 200m
  avd.name = <build>
.
QEMU options list:
emulator: argv[00] = "/home/dnivra/Android/Sdk/tools/emulator-arm"
emulator: argv[01] = "-android-hw"
emulator: argv[02] = "system/hardware-qemu.ini"
Concatenated QEMU options:
 /home/dnivra/Android/Sdk/tools/emulator-arm -android-hw system/hardware-qemu.ini
emulator: registered 'boot-properties' qemud service
emulator: Using kernel serial device prefix: ttyS
emulator: No fstab.goldfish file in ramdisk image
emulator: Probing system image file for partition type: system.img
emulator: system partition format: yaffs2
emulator: Mapping 'system' partition image to /tmp/android-dnivra/emulator-jgAbkN
emulator: nand_add_dev: system,size=0xc800000,file=/tmp/android-dnivra/emulator-jgAbkN,initfile=system.img
emulator: rounding devsize up to a full eraseunit, now c810000

ko:Cannot determine type of userdata partition: no image files!
emulator: User-config was not changed.

Solution

  • Okay so it seems that in addition to running build/envsetup.sh everytime, the lunch command also should be run with the previously specified target so that the required environment variables are set. After that, emulator works fine.