android - 无法在源构建 Android 模拟器中挂载 userdata.img MTD 图像

标签 android linux android-emulator kernel

我在使用 Android 模拟器时遇到问题。

我已经为android编译了ARM goldfish内核。并创建了一个 AVD(Android API 级别 18。使用 YAFFS2),然后使用模拟器启动系统,如下所示。

./tools/emulator -kernel /home/daehee/kernel/goldfish/arch/arm/boot/zImage -verbose -show-kernel -avd test2

这很好用。内核工作正常,模拟器工作正常,一切都很好。

但是,如果我用我从 Android Framework 源代码编译的模拟器替换模拟器。内核挂载文件系统(YAFFS2)失败。

我认为这是因为金鱼 MTD 页面大小已更改...但我不知道如何修复它。有人可以告诉我这是怎么回事吗?

以下是我更改模拟器之前/之后的模拟器和内核日志消息。

在更换模拟器之前

root@ubuntu:/home/daehee/sdk/android-sdk-linux# ./tools/emulator -kernel     /home/daehee/kernel/goldfish/arch/arm/boot/zImage -verbose -show-kernel -avd test2 -force-32bit
emulator:Found AVD name 'test2'
emulator:Found AVD target architecture: arm
emulator:Looking for ranchu emulator backed for arm CPU
emulator:Probing program: ./tools/emulator-ranchu-arm
emulator:Looking for emulator-arm to emulate 'arm' CPU
emulator:Probing program: ./tools/emulator-arm
emulator:Found target-specific emulator binary: ./tools/emulator-arm
emulator:GPU emulation is disabled
emulator: found SDK root at /home/daehee/sdk/android-sdk-linux
emulator: Android virtual device file at: /root/.android/avd/test2.ini
emulator: virtual device content at /root/.android/avd/test2.avd
emulator: virtual device config file: /root/.android/avd/test2.avd/config.ini
emulator: using core hw config path: /root/.android/avd/test2.avd/hardware-qemu.ini
emulator: Found AVD target API level: 18
emulator: Read property file at /home/daehee/sdk/android-sdk-linux/system-images/android-18/default/armeabi-    v7a//build.prop
emulator: No boot.prop property file found.
emulator: found skin 'HVGA' in directory: /home/daehee/sdk/android-sdk-linux/platforms/android-18/skins
emulator: autoconfig: -skin HVGA
emulator: autoconfig: -skindir /home/daehee/sdk/android-sdk-linux/platforms/android-18/skins
emulator: found skin-specific hardware.ini: /home/daehee/sdk/android-sdk-linux/platforms/android-    18/skins/HVGA/hardware.ini
emulator: keyset loaded from: /root/.android/default.keyset
emulator: trying to load skin file '/home/daehee/sdk/android-sdk-linux/platforms/android-    18/skins/HVGA/layout'
emulator: skin network speed: 'full'
emulator: skin network delay: 'none'
emulator: Auto-detect: Kernel image requires legacy device naming scheme.
emulator: Auto-detect: Kernel does support YAFFS2 partitions.
emulator: autoconfig: -ramdisk /home/daehee/sdk/android-sdk-linux/system-images/android-18/default/armeabi-    v7a//ramdisk.img
emulator: Using initial system image: /home/daehee/sdk/android-sdk-linux/system-images/android-    18/default/armeabi-v7a//system.img
emulator: autoconfig: -data /root/.android/avd/test2.avd/userdata-qemu.img
emulator: autoconfig: -initdata /root/.android/avd/test2.avd/userdata.img
emulator: autoconfig: -cache /root/.android/avd/test2.avd/cache.img
emulator: Physical RAM size: 512MB

emulator: GPU emulation is disabled
emulator: WARNING: CPU acceleration only works with x86/x86_64 system images.
Content of hardware configuration file:
  hw.cpu.arch = arm
  hw.cpu.model = cortex-a8
  hw.ramSize = 512
  hw.screen = touch
  hw.mainKeys = no
  hw.trackBall = no
  hw.keyboard = yes
  hw.keyboard.lid = no
  hw.keyboard.charmap = qwerty2
  hw.dPad = no
  hw.gsmModem = yes
  hw.gps = yes
  hw.battery = yes
  hw.accelerometer = yes
  hw.audioInput = yes
  hw.audioOutput = yes
  hw.sdCard = no
  disk.cachePartition = yes
  disk.cachePartition.path = /root/.android/avd/test2.avd/cache.img
  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 = none
  hw.camera.front = none
  vm.heapSize = 48
  hw.sensors.proximity = yes
  hw.sensors.magnetic_field = yes
  hw.sensors.orientation = yes
  hw.sensors.temperature = yes
  hw.useext4 = yes
  kernel.path = /home/daehee/kernel/goldfish/arch/arm/boot/zImage
  kernel.parameters =  androidboot.hardware=goldfish android.checkjni=1
  kernel.newDeviceNaming = no
  kernel.supportsYaffs2 = yes
  disk.ramdisk.path = /home/daehee/sdk/android-sdk-linux/system-images/android-18/default/armeabi-    v7a//ramdisk.img
  disk.systemPartition.initPath = /home/daehee/sdk/android-sdk-linux/system-images/android-18/default/armeabi    -v7a//system.img
  disk.systemPartition.size = 218m
  disk.dataPartition.path = /root/.android/avd/test2.avd/userdata-qemu.img
  disk.dataPartition.size = 1g
  avd.name = test2
.
QEMU options list:
emulator: argv[00] = "./tools/emulator-arm"
emulator: argv[01] = "-show-kernel"
emulator: argv[02] = "-android-hw"
emulator: argv[03] = "/root/.android/avd/test2.avd/hardware-qemu.ini"
Concatenated QEMU options:
 ./tools/emulator-arm -show-kernel -android-hw /root/.android/avd/test2.avd/hardware-qemu.ini
emulator: registered 'boot-properties' qemud service
emulator: Using kernel serial device prefix: ttyS
emulator: Ramdisk image contains fstab.goldfish file
emulator: Could not extract format of system partition!
emulator: Could not extract format of userdata partition!
emulator: Could not extract format of cache partition!
emulator: Probing system image file for partition type: /home/daehee/sdk/android-sdk-linux/system-    images/android-18/default/armeabi-v7a//system.img
emulator: system partition format: yaffs2
emulator: Mapping 'system' partition image to /tmp/android-root/emulator-svpOUY
emulator: nand_add_dev: system,size=0xda00000,file=/tmp/android-root/emulator-    svpOUY,initfile=/home/daehee/sdk/android-sdk-linux/system-images/android-18/default/armeabi-v7a//system.img
emulator: rounding devsize up to a full eraseunit, now da1c000

emulator: Probing userdata image file for partition type: /root/.android/avd/test2.avd/userdata-qemu.img
emulator: userdata partition format: yaffs2
emulator: nand_add_dev: userdata,size=0x40000000,file=/root/.android/avd/test2.avd/userdata-qemu.img
emulator: rounding devsize up to a full eraseunit, now 40008000

emulator: cache partition format: yaffs2
emulator: nand_add_dev: cache,size=0x4200000,file=/root/.android/avd/test2.avd/cache.img
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'dalvik.vm.heapsize' = '48m'
emulator: Adding boot property: 'ro.config.low_ram' = 'true'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '160'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '0'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'none'
emulator: Kernel parameters: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 androidboot.    hardware=goldfish android.checkjni=1 ndns=1
emulator: autoconfig: -scale 1
emulator: Window was not fully visible: monitor=[0,0,1236,722] window=[947,77,791,534]
emulator: Window repositioned to [222,94]
emulator: emulator window was out of view and was recentered

serial0 console
emulator: Forcing ro.adb.qemud to "0".
emulator: control console listening on port 5554, ADB on port 5555
emulator: sent '0012host:emulator:5555' to ADB server
emulator: android_hw_fingerprint_init: fingerprint qemud listen service initialized

emulator: ping program: /home/daehee/sdk/android-sdk-linux/tools/ddms
emulator: ping command: /home/daehee/sdk/android-sdk-linux/tools/ddms ping emulator standalone "" "" ""
Uncompressing Linux..........................................................................................    ............................ done, booting the kernel.
Initializing cgroup subsys cpu
Linux version 2.6.29-g4bb8fa0-dirty (root@ubuntu) (gcc version 4.7 (GCC) ) #13 Mon Aug 17 00:14:46 PDT 2015
CPU: ARMv7 Processor [410fc080] revision 0 (ARMv7), cr=10c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Goldfish
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 androidboot.hardware=goldfish     android.checkjni=1 ndns=1
Unknown boot option `qemu.gles=0': ignoring
Unknown boot option `android.qemud=ttyS1': ignoring
Unknown boot option `androidboot.hardware=goldfish': ignoring
Unknown boot option `android.checkjni=1': ignoring
PID hash table entries: 2048 (order: 11, 8192 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 514944KB available (3368K code, 709K data, 124K init)
Calibrating delay loop... 387.48 BogoMIPS (lpj=1937408)
Mount-cache hash table entries: 512
Initializing cgroup subsys debug
Initializing cgroup subsys cpuacct
Initializing cgroup subsys freezer
CPU: Testing write buffer coherency: ok
net_namespace: 936 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
NET: Registered protocol family 2
IP route cache hash table entries: 16384 (order: 4, 65536 bytes)
TCP established hash table entries: 65536 (order: 7, 524288 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 65536 bind 65536)
TCP reno registered
NET: Registered protocol family 1
checking if image is initramfs... it is
Freeing initrd memory: 228K
goldfish_new_pdev goldfish_interrupt_controller at ff000000 irq -1
goldfish_new_pdev goldfish_device_bus at ff001000 irq 1
goldfish_new_pdev goldfish_timer at ff003000 irq 3
goldfish_new_pdev goldfish_rtc at ff010000 irq 10
goldfish_new_pdev goldfish_tty at ff002000 irq 4
goldfish_new_pdev goldfish_tty at ff011000 irq 11
goldfish_new_pdev goldfish_tty at ff012000 irq 12
goldfish_new_pdev smc91x at ff013000 irq 13
goldfish_new_pdev goldfish_fb at ff014000 irq 14
goldfish_new_pdev goldfish_audio at ff004000 irq 15
goldfish_new_pdev goldfish-battery at ff015000 irq 16
goldfish_new_pdev goldfish_events at ff016000 irq 17
goldfish_new_pdev goldfish_nand at ff017000 irq -1
goldfish_new_pdev qemu_pipe at ff018000 irq 18
goldfish_pdev_worker registered goldfish_interrupt_controller
goldfish_pdev_worker registered goldfish_device_bus
goldfish_pdev_worker registered goldfish_timer
goldfish_pdev_worker registered goldfish_rtc
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered smc91x
goldfish_pdev_worker registered goldfish_fb
goldfish_pdev_worker registered goldfish_audio
goldfish_pdev_worker registered goldfish-battery
goldfish_pdev_worker registered goldfish_events
goldfish_pdev_worker registered goldfish_nand
goldfish_pdev_worker registered qemu_pipe
ashmem: initialized
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
fuse init (API version 7.11)
yaffs Aug 12 2015 05:26:04 Installing. 
msgmni has been set to 1006
alg: No test for stdrng (krng)
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
allocating frame buffer 320 * 480, got ffa00000
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
goldfish_audio_probe
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>
eth0 (smc91x): not using net_device_ops yet
eth0: SMC91C11xFD (rev 1) at e080c000 IRQ 13 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
goldfish nand dev0: size d380000, page 2048, extra 64, erase 131072
goldfish nand dev1: size 3e100000, page 2048, extra 64, erase 131072
mice: PS/2 mouse device common for all mice
*** events probe ***
events_probe() addr=0xe0814000 irq=17
events_probe() keymap=qwerty2
input: qwerty2 as /devices/virtual/input/input0
goldfish_rtc goldfish_rtc: rtc core: registered goldfish_rtc as rtc0
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.14.0-ioctl (2008-04-23) initialised: dm-devel@redhat.com
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (8192 buckets, 32768 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
ctnetlink v0.93: registering with nfnetlink.
NF_TPROXY: Transparent proxy support initialized, version 4.1.0
NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.
xt_time: kernel timezone is -0000
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP cubic registered
NET: Registered protocol family 10
ip6_tables: (C) 2000-2006 Netfilter Core Team
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 0
goldfish_rtc goldfish_rtc: setting system clock to 2015-08-17 07:20:28 UTC (1439796028)
Freeing init memory: 124K
SELinux:  Could not mount selinuxfs:  No such device
init: cannot open '/initlogo.rle'
yaffs: dev is 32505856 name is "mtdblock0"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.0, "mtdblock0"
yaffs_read_super: isCheckpointed 0
save exit: isCheckpointed 0
yaffs: dev is 32505857 name is "mtdblock1"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.1, "mtdblock1"
yaffs_read_super: isCheckpointed 0
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
warning: `rild' uses 32-bit capabilities (legacy support in use)

更换模拟器后

root@ubuntu:/home/daehee/sdk/android-sdk-linux# ./tools/emulator -kernel     /home/daehee/kernel/goldfish/arch/arm/boot/zImage -verbose -show-kernel -avd test2 -force-32bit
emulator:Found AVD name 'test2'
emulator:Found AVD target architecture: arm
emulator:Looking for ranchu emulator backed for arm CPU
emulator:Probing program: ./tools/emulator-ranchu-arm
emulator:Looking for emulator-arm to emulate 'arm' CPU
emulator:Probing program: ./tools/emulator-arm
emulator:Found target-specific emulator binary: ./tools/emulator-arm
emulator:GPU emulation is disabled
emulator: found SDK root at /home/daehee/sdk/android-sdk-linux
emulator: Android virtual device file at: /root/.android/avd/test2.ini
emulator: virtual device content at /root/.android/avd/test2.avd
emulator: virtual device config file: /root/.android/avd/test2.avd/config.ini
emulator: using core hw config path: /root/.android/avd/test2.avd/hardware-qemu.ini
emulator: Found AVD target API level: 18
emulator: found skin 'HVGA' in directory: /home/daehee/sdk/android-sdk-linux/platforms/android-18/skins
emulator: autoconfig: -skin HVGA
emulator: autoconfig: -skindir /home/daehee/sdk/android-sdk-linux/platforms/android-18/skins
emulator: found skin-specific hardware.ini: /home/daehee/sdk/android-sdk-linux/platforms/android-    18/skins/HVGA/hardware.ini
emulator: keyset loaded from: /root/.android/default.keyset
emulator: trying to load skin file '/home/daehee/sdk/android-sdk-linux/platforms/android-    18/skins/HVGA/layout'
emulator: skin network speed: 'full'
emulator: skin network delay: 'none'
emulator: autoconfig: -ramdisk /home/daehee/sdk/android-sdk-linux/system-images/android-18/default/armeabi-    v7a//ramdisk.img
emulator: Using initial system image: /home/daehee/sdk/android-sdk-linux/system-images/android-    18/default/armeabi-v7a//system.img
emulator: autoconfig: -data /root/.android/avd/test2.avd/userdata-qemu.img
emulator: autoconfig: -initdata /root/.android/avd/test2.avd/userdata.img
emulator: autoconfig: -cache /root/.android/avd/test2.avd/cache.img
emulator: Physical RAM size: 512MB

Content of hardware configuration file:
  hw.cpu.arch = arm
  hw.cpu.model = cortex-a8
  hw.ramSize = 512
  hw.screen = touch
  hw.mainKeys = no
  hw.trackBall = no
  hw.keyboard = yes
  hw.keyboard.lid = no
  hw.keyboard.charmap = qwerty2
  hw.dPad = no
  hw.gsmModem = yes
  hw.gps = yes
  hw.battery = yes
  hw.accelerometer = yes
  hw.audioInput = yes
  hw.audioOutput = yes
  hw.sdCard = no
  disk.cachePartition = yes
  disk.cachePartition.path = /root/.android/avd/test2.avd/cache.img
  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.camera.back = none
  hw.camera.front = none
  vm.heapSize = 48
  hw.sensors.proximity = yes
  hw.sensors.magnetic_field = yes
  hw.sensors.orientation = yes
  hw.sensors.temperature = yes
  kernel.path = /home/daehee/kernel/goldfish/arch/arm/boot/zImage
  kernel.parameters =  android.checkjni=1
  disk.ramdisk.path = /home/daehee/sdk/android-sdk-linux/system-images/android-18/default/armeabi-    v7a//ramdisk.img
  disk.systemPartition.initPath = /home/daehee/sdk/android-sdk-linux/system-images/android-18/default/armeabi    -v7a//system.img
  disk.systemPartition.size = 218m
  disk.dataPartition.path = /root/.android/avd/test2.avd/userdata-qemu.img
  disk.dataPartition.size = 1g
  avd.name = test2
.
QEMU options list:
emulator: argv[00] = "./tools/emulator-arm"
emulator: argv[01] = "-show-kernel"
emulator: argv[02] = "-android-hw"
emulator: argv[03] = "/root/.android/avd/test2.avd/hardware-qemu.ini"
Concatenated QEMU options:
 ./tools/emulator-arm -show-kernel -android-hw /root/.android/avd/test2.avd/hardware-qemu.ini
emulator: registered 'boot-properties' qemud service
emulator: nand_add_dev: system,size=0xda00000,initfile=/home/daehee/sdk/android-sdk-linux/system-    images/android-18/default/armeabi-v7a//system.img
emulator: mapping 'system' NAND image to /tmp/android-root/emulator-nqSZGW
emulator: nand_add_dev: userdata,size=0x40000000,file=/root/.android/avd/test2.avd/userdata-qemu.img
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'dalvik.vm.heapsize' = '48m'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '160'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '0'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'none'
emulator: nand_add_dev: cache,size=0x4200000,file=/root/.android/avd/test2.avd/cache.img
emulator: Initializing hardware OpenGLES emulation support
emulator: ERROR: Could not load OpenGLES emulation library: libOpenglRender.so: cannot open shared object     file: No such file or directory
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
Could not configure '/dev/hpet' to have a 1024Hz timer. This is not a fatal
error, but for better emulation accuracy type:
'echo 1024 > /proc/sys/dev/hpet/max-user-freq' as root.
emulator: Kernel parameters: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=1
emulator: Trace file name is not set

emulator: autoconfig: -scale 1
serial0 console
emulator: Could not open file: (null)/system/build.prop: No such file or directory
emulator: control console listening on port 5554, ADB on port 5555
emulator: sent '0012host:emulator:5555' to ADB server
emulator: ping program: /home/daehee/sdk/android-sdk-linux/tools/ddms
emulator: ping command: /home/daehee/sdk/android-sdk-linux/tools/ddms ping emulator standalone "" "" ""
goldfish_fb_get_pixel_format:167: display surface,pixel format:
Initializing cgroup subsys cpu
Linux version 2.6.29-g4bb8fa0-dirty (root@ubuntu) (gcc version 4.7 (GCC) ) #13 Mon Aug 17 00:14:46 PDT 2015
CPU: ARMv7 Processor [410fc080] revision 0 (ARMv7), cr=10c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Goldfish
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=1
Unknown boot option `qemu.gles=0': ignoring
Unknown boot option `android.qemud=ttyS1': ignoring
Unknown boot option `android.checkjni=1': ignoring
PID hash table entries: 2048 (order: 11, 8192 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 514944KB available (3368K code, 709K data, 124K init)
Calibrating delay loop... 176.53 BogoMIPS (lpj=882688)
Mount-cache hash table entries: 512
Initializing cgroup subsys debug
Initializing cgroup subsys cpuacct
Initializing cgroup subsys freezer
CPU: Testing write buffer coherency: ok
net_namespace: 936 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
NET: Registered protocol family 2
IP route cache hash table entries: 16384 (order: 4, 65536 bytes)
TCP established hash table entries: 65536 (order: 7, 524288 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 65536 bind 65536)
TCP reno registered
NET: Registered protocol family 1
checking if image is initramfs... it is
Freeing initrd memory: 228K
goldfish_new_pdev goldfish_interrupt_controller at ff000000 irq -1
goldfish_new_pdev goldfish_device_bus at ff001000 irq 1
goldfish_new_pdev goldfish_timer at ff003000 irq 3
goldfish_new_pdev goldfish_rtc at ff010000 irq 10
goldfish_new_pdev goldfish_tty at ff002000 irq 4
goldfish_new_pdev goldfish_tty at ff011000 irq 11
goldfish_new_pdev goldfish_tty at ff012000 irq 12
goldfish_new_pdev smc91x at ff013000 irq 13
goldfish_new_pdev goldfish_fb at ff014000 irq 14
goldfish_new_pdev goldfish_audio at ff004000 irq 15
goldfish_new_pdev goldfish_memlog at ff006000 irq -1
goldfish_new_pdev goldfish-battery at ff015000 irq 16
goldfish_new_pdev goldfish_events at ff016000 irq 17
goldfish_new_pdev goldfish_nand at ff017000 irq -1
goldfish_new_pdev qemu_pipe at ff018000 irq 18
goldfish_new_pdev goldfish-switch at ff01a000 irq 19
goldfish_new_pdev goldfish-switch at ff01b000 irq 20
goldfish_pdev_worker registered goldfish_interrupt_controller
goldfish_pdev_worker registered goldfish_device_bus
goldfish_pdev_worker registered goldfish_timer
goldfish_pdev_worker registered goldfish_rtc
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_fb
goldfish_pdev_worker registered goldfish_audio
goldfish_pdev_worker registered goldfish_memlog
goldfish_pdev_worker registered goldfish-battery
goldfish_pdev_worker registered goldfish_events
goldfish_pdev_worker registered goldfish_nand
goldfish_pdev_worker registered qemu_pipe
goldfish_pdev_worker registered goldfish-switch
goldfish_pdev_worker registered goldfish-switch
ashmem: initialized
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
fuse init (API version 7.11)
yaffs Aug 12 2015 05:26:04 Installing. 
msgmni has been set to 1006
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
allocating frame buffer 320 * 480, got ffa00000
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
goldfish_audio_probe
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>
eth0 (smc91x): not using net_device_ops yet
eth0: SMC91C11xFD (rev 1) at e080c000 IRQ 13 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
goldfish nand dev0: size da00000, page 512, extra 0, erase 32768
goldfish nand dev1: size 40000000, page 512, extra 0, erase 32768
goldfish nand dev2: size 4200000, page 512, extra 0, erase 32768
mice: PS/2 mouse device common for all mice
*** events probe ***
events_probe() addr=0xe0814000 irq=17
events_probe() keymap=qwerty2
input: qwerty2 as /devices/virtual/input/input0
goldfish_rtc goldfish_rtc: rtc core: registered goldfish_rtc as rtc0
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.14.0-ioctl (2008-04-23) initialised: dm-devel@redhat.com
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (8192 buckets, 32768 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
ctnetlink v0.93: registering with nfnetlink.
NF_TPROXY: Transparent proxy support initialized, version 4.1.0
NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.
xt_time: kernel timezone is -0000
ip_tables: (C) 2000-2006 Netfilter Core Team
arp_tables: (C) 2002 David S. Miller
TCP cubic registered
NET: Registered protocol family 10
ip6_tables: (C) 2000-2006 Netfilter Core Team
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 0
goldfish_rtc goldfish_rtc: setting system clock to 2015-08-17 07:17:43 UTC (1439795863)
Freeing init memory: 124K
SELinux:  Could not mount selinuxfs:  No such device
init: cannot open '/initlogo.rle'
yaffs: dev is 32505856 name is "mtdblock0"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.0, "mtdblock0"
yaffs: auto selecting yaffs1
yaffs: MTD device does not support have the right page sizes
yaffs: dev is 32505857 name is "mtdblock1"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.1, "mtdblock1"
yaffs: auto selecting yaffs1
yaffs: MTD device does not support have the right page sizes
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs1
yaffs: MTD device does not support have the right page sizes
init: Unable to open persistent property directory /data/property errno: 2
init: cannot find '/system/bin/servicemanager', disabling 'servicemanager'

最佳答案

我假设您是在 AOSP master 的基础上构建的?我们需要知道版本。

如果SELinuxFS挂载失败,则init无法加载selinux策略。这是一个 fatal error 。

调用链来自system/core/init/init.cpp 调用在external/libselinux/src/android.c 中定义的selinux_android_load_policy()。请参阅 init.cpp 中的代码 fragment :

    if (selinux_android_load_policy() < 0) {
        ERROR("failed to load policy: %s\n", strerror(errno));
        security_failure();
    }

可能要确保您的内核构建是正确的。确保内核支持 SELINUX。请参阅金鱼内核的这些相关补丁:

https://android-review.googlesource.com/#/q/owner:%22Stephen+Smalley+%253Csds%2540tycho.nsa.gov%253E%22++project:kernel/goldfish

关于android - 无法在源构建 Android 模拟器中挂载 userdata.img MTD 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32047094/

相关文章:

java - Intent 服务使我的应用程序崩溃?

java - 错误 JAVA_HOME 未正确定义

Java 未知主机异常

HTML 格式的 Android 应用程序

单击按钮时 Android 应用程序崩溃

java - Eclipse Android 两个按钮

java - 使用来自 URL 的图像创建 GridView

android - 如何在 Android TV 中使用键盘让 GridView 滚动到顶部

python - Ubuntu systemd 在 sudo 重启时退出错误

linux - 太多持久的 TCP 连接