I want to run a custom kernel build from ci.android.com on an avd. I downloaded the kernel files from here. I start the avd like so - ~/Library/Android/sdk/emulator/emulator -avd Pixel_6_Pro_API_32 -show-kernel -netspeed full -debug init -verbose -writable-system -kernel Image. However the boot fails with the following logs
[ 0.511774][ T1] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[ 0.512810][ T1] ALSA device list:
[ 0.513168][ T1] No soundcards found.
[ 0.513800][ T1] uart-pl011 9000000.pl011: no DMA platform data
[ 0.517151][ T1] Freeing unused kernel memory: 1536K
[ 0.542181][ T1] Run /init as init process
[ 0.551684][ T1] init: init first stage started!
[ 0.552764][ T1] init: Loading module /lib/modules/ac97_bus.ko with args ''
[ 0.553928][ T1] ac97_bus: disagrees about version of symbol module_layout
[ 0.555305][ T1] init: Failed to insmod '/lib/modules/ac97_bus.ko' with args '': Exec format error
[ 0.556731][ T1] init: LoadWithAliases was unable to load ac97_bus
[ 0.557747][ T1] init: Copied ramdisk prop to /second_stage_resources/system/etc/ramdisk/build.prop
[ 0.558989][ T1] init: [libfs_mgr]ReadFstabFromDt(): failed to read fstab from dt
[ 0.560418][ T1] init: Using Android DT directory /proc/device-tree/firmware/android/
[ 0.569781][ T1] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found in /sys, waiting for their uevent(s): metadata, super
VER
I know this is because of the loaded kernel modules. I have the kernel modules as well. But I have no idea how to replace them. I pushed them to /vendor/lib/modules. That didn't help. Any ideas? Thanks!
I want to run custom kernel ( goldfish ) on android-9 (API 28) avd.
So I just downloaded goldfish kernel:
git clone https://android.googlesource.com/kernel/goldfish/ -b android-4.4
make x86_64_ranchu_defconfig
make -j4
then I run emulator :
emulator -avd test -kernel goldfish/arch/x86/boot/bzImage -show-kernel
But there is some error between my kernel and SELinux policy of vendor.
Here the logs:
[ 1.170669] init: init first stage started!
[ 1.172289] init: Using Android DT directory /sys/bus/platform/devices/ANDR0001:00/properties/android/
[ 1.174652] init: First stage mount skipped (missing/incompatible fstab in device tree)
[ 1.176724] init: Skipped setting INIT_AVB_VERSION (not in recovery mode)
[ 1.178464] init: Loading SELinux policy
[ 1.182955] init: No precompiled sepolicy: No such file or directory
[ 1.184557] init: Compiling SELinux policy
[ 1.185672] init: Failed to read /vendor/etc/selinux/plat_sepolicy_vers.txt: No such file or directory
[ 1.188030] init: Unable to load SELinux policy
[ 1.189192] init: Reboot start, reason: reboot, rebootTarget: bootloader
Obviously the system go in boot loop.
How can I fix this?
I am using since Android 4.4 the tool make_ext4fs to repack Samsung system images.
make_ext4fs -s -l [size] -a [mount-point] -S [file_contexts] [out_file] [src_folder]
This works fine for sparsed file systems up to Android 5.1.1. I need to repack an Android 6.0.1 system.img of a Samsung device. There aren't any errors, flashing works too but the Wifi device is broken.
This is the logcat output
...
08-30 13:38:35.489 I/WifiHW ( 2149): wifi_change_fw_path(): fwpath = /system/etc/wifi/bcmdhd_sta.bin
08-30 13:38:35.489 E/WifiHW ( 2149): Cannot open "/data/.cid.info": No such file or directory
...
08-30 13:38:35.809 I/wpa_supplicant( 3181): nl80211: deinit ifname=wlan0 disabled_11b_rates=0
08-30 13:38:35.809 E/wpa_supplicant( 3181): Could not read interface wlan0 flags: No such device
08-30 13:38:35.809 E/wpa_supplicant( 3181): wlan0: Failed to initialize driver interface
...
This the kmsg output
[5.560176] [2: sh: 2269] macloader: Not yet wlan interface loaded
I tried to compare the stock and the repacked images, but they are compressed and not comparable.
Has anything changed with the img format from Android 5.1.1 to Android 6.0.1 or is this a Samsung specific problem? The file_contexts is exracted from the stock boot.img. I think the selinux permissions are fine but I am not sure if the regular permissions are set correrctly. Is there a way to get sure the mac permissions will be preserved?
Update
I've rebuilt make_ext4fs with branch android-6.0.1 according to this link (https://gist.github.com/monyxie/3128671a1f9508b7b9cdcf803e55af1e) which has new options added.
[ -l <len> ] [ -j <journal size> ] [ -b <block_size> ]
[ -g <blocks per group> ] [ -i <inodes> ] [ -I <inode size> ]
[ -L <label> ] [ -f ] [ -a <android mountpoint> ] [ -u ]
[ -S file_contexts ] [ -C fs_config ] [ -T timestamp ]
[ -z | -s ] [ -w ] [ -c ] [ -J ] [ -v ] [ -B <block_list_file> ]
<filename> [[<directory>] <target_out_directory>]
The added option [-C fs_config] let you set the permission of every single file and expects a list of files with its uid / gid / mac-permissions / (optional SELinux context). make_ext4fs throws an error if theres is any file without a config defined.
...
system/bin 0 0 755 u:object_r:system_file:s0
system/bin/iptables 0 0 750 u:object_r:system_file:s0
system/bin/ip6tables 0 0 750 u:object_r:system_file:s0
...
I have been successfully build the android image for the hummingbird and using peonixsuit uploaded the image on board, but not successful in brining the board up following is the log which i am getting in UART0 while booting the board.
Hit any key to stop autoboot: 0
Starting kernel ...
[ 3.294581] init: width = 1024
[ 3.298059] init: height = 600
[ 3.301490] init: s.st_size = 2457600
[ 4.112131] init: do_umount: /data
[ 4.403401] init: do_umount: /cache
[ 4.726198] init: dont need format /dev/block/UDISK
[ 4.944192] init: do_umount: /databk
[ 5.624185] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
[ 6.302551] i2c i2c-1: Invalid 7-bit I2C address 0x00
[ 6.596336] android_usb: already disabled
[ 6.601920] init: using deprecated syntax for specifying property 'sys.usb.config', use ${name} instead
[ 6.649823] init: using deprecated syntax for specifying property 'sys.usb.config', use ${name} instead
[ 31.820483] start_powernow uncare mode:859320624!
[ 32.517665] init: sys_prop: permission denied uid:1003 name:service.bootanim.exit
please help me to solve this issue.
I want to build and run CyanongenMod 10.2 on simulator. First of all, my developer machine is ok (it builds CM 10.2 for crespo, a CM fork for Motorola Defy...CM 10.1 for samsung p4 tablet).
In order to build CM 10.2 for simulator I do the following steps:
breakfast goldfish: download kernel and goldfish releated stuff
mka: do a full build
The build is done: all the .img file are in the $OUT folder. Seems all ok...but if I run "emulator -show-kernel" it blocks with a lot of error :
init: could not import file '/init.carrier.rc' from '/init.rc'
init: do_chown: Could not access /selinux/booleans
init: do_chown: Could not access /sys/fs/selinux/booleans
init: cannot open '/initlogo.rle'
yaffs: dev is 32505856 name is "mtdblock0"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.0, "mtdblock0"
block 1177 is bad
block 1182 is bad
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
fs_mgr: Cannot mount filesystem on /dev/block/mtdblock0 at /system
init: fs_mgr_mount_all returned an error
yaffs tragedy: no more erased blocks
[....]
yaffs tragedy: no more erased blocks
init: cannot find '/system/bin/sysinit', disabling 'sysinit'
init: Unable to open persistent property directory /data/property errno: 2
init: cannot find '/system/bin/servicemanager', disabling 'servicemanager'
init: cannot find '/system/bin/vold', disabling 'vold'
init: cannot find '/system/bin/qemu-props', disabling 'qemu-props'
init: cannot find '/system/bin/auditd', disabling 'auditd'
init: cannot find '/system/bin/netd', disabling 'netd'
init: cannot find '/system/bin/debuggerd', disabling 'debuggerd'
init: cannot find '/system/bin/rild', disabling 'ril-daemon'
init: cannot find '/system/bin/surfaceflinger', disabling 'surfaceflinger'
init: cannot find '/system/bin/app_process', disabling 'zygote'
init: cannot find '/system/bin/drmserver', disabling 'drm'
init: cannot find '/system/bin/mediaserver', disabling 'media'
init: cannot find '/system/bin/installd', disabling 'installd'
init: cannot find '/system/bin/keystore', disabling 'keystore'
init: cannot find '/system/bin/handle_compcache', disabling 'compcache'
init: cannot find '/system/bin/qemud', disabling 'qemud'
init: cannot find '/system/bin/logcat', disabling 'goldfish-logcat'
init: cannot find '/system/etc/init.goldfish.sh', disabling 'goldfish-setup'
init: cannot find '/system/bin/sh', disabling 'console'
It seems to be an error with EXT4 image file: emulator does not accept EXT4 filesystem but only yaffs?
The question is simple: is it possible to run a CM build on simulator?
Yeah, I have same issue with you, then I run command:
mkyaffs2image -f out/target/product/generic/system out/target/product/generic/system_yaffs2.img
emulator -kernel out/target/product/generic/zImage -system out/target/product/generic/system_yaffs2.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/data_yaffs2.img -partition-size 1024 -show-kernel -verbose
wait several minutes, the emulator can be launched.
But the ril service seems coredump, so 3G network won't work. I am looking for how to fix this.
I try with another way:
*) edit the system/core/rootdir/init.rc file and change the mount command:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount ext4 mtd#system /system
mount ext4 mtd#system /system ro remount
mount ext4 mtd#userdata /data nosuid nodev
mount ext4 mtd#cache /cache nosuid nodev
The output is :
fs_mgr: Cannot mount filesystem on /dev/block/mtdblock0 at /system
init: fs_mgr_mount_all returned an error
init: cannot find '/system/bin/sysinit', disabling 'sysinit'
init: Unable to open persistent property directory /data/property errno: 2
init: cannot find '/system/bin/servicemanager', disabling 'servicemanager'
*) using the previous init.rc file, compile a new goldfish kernel from GIT sources and edit the .config file
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
Then run the emulator with "emulator -show-kernel -kernel ~/goldfish/arch/arm/boot/zImage"
The output is:
init: could not import file '/init.carrier.rc' from '/init.rc'
init (1): /proc/1/oom_adj is deprecated, please use /proc/1/oom_score_adj instead.
init: do_chown: Could not access /selinux/booleans
init: cannot open '/initlogo.rle'
goldfish_nand_read: invalid read, start 0, len 200, dev_size 21560000, write_size 800
end_request: I/O error, dev mtdblock0, sector 2
EXT4-fs (mtdblock0): unable to read superblock
goldfish_nand_read: invalid read, start 0, len 200, dev_size c200000, write_size 800
end_request: I/O error, dev mtdblock1, sector 2
EXT4-fs (mtdblock1): unable to read superblock
goldfish_nand_read: invalid read, start 0, len 200, dev_size 4000000, write_size 800
end_request: I/O error, dev mtdblock2, sector 2
EXT4-fs (mtdblock2): unable to read superblock
goldfish_nand_read: invalid read, start 0, len 200, dev_size 21560000, write_size 800
end_request: I/O error, dev mtdblock0, sector 2
EXT4-fs (mtdblock0): unable to read superblock
fs_mgr: Cannot mount filesystem on /dev/block/mtdblock0 at /system
init: fs_mgr_mount_all returned an error
init: cannot find '/system/bin/sysinit', disabling 'sysinit'