Building Android 13 (ARM64) for the Linux Aarch64 Android emulator
0
votes
0
answers
1509
views
I'm trying to build Android 13 (ARM64) for the Android emulator (linux/aarch64). I managed to correctly start Android 12 (ARM64) images with the following setup, but I fail to do the same for Android 13.
1. I build the source code with lunch target
lunch sdk_phone_arm64-userdebug
and the following build command on a x86_64 server: "source ./build/envsetup.sh && lunch sdk_phone_arm64-userdebug && m && m emu_img_zip"
2. I then copy/unzip the emulator image artefacts to my linux arm64 machine using the zip file in the build out directory under: "out/dist/sdk_phone_arm64-img-eng.ubuntu.zip"
3. I use the lastest emulator binary for linux aarch64 from: https://ci.android.com/builds/branches/aosp-emu-master-dev/grid?legacy=1
4. I then try to start the emulator with the following command:
`
/android/sdk/emulator/emulator -avd Arm64 -no-window -no-snapshot -ports "5556,5557" -grpc "8556" -skip-adb-auth -no-snapshot-save -logcat "*:V" -show-kernel -logcat-output "/tmp/android-unknown/logcat.log" -shell-serial "file:/tmp/android-unknown/kernel.log" -no-boot-anim -wipe-data -gpu swiftshader_indirect -qemu -append "panic=1" -cpu max -machine gic-version=max &
`
For Android 12 this setup and commands work well and the emulator starts correctly. However, for Android 13 the emulator gets stuck when trying to load the images. The kernel is stuck in an endless reboot and shows the following error:
kernel: [ 1.346161][ T1] uart-pl011 9000000.pl011: no DMA platform data
kernel: [ 1.349940][ T1] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
kernel: [ 1.350060][ T1] Please append a correct "root=" boot option; here are the available partitions:
kernel: [ 1.350306][ T1] 0100 8192 ram0
kernel: [ 1.350383][ T1] (driver?)
kernel: [ 1.351598][ T1] 0101 8192 ram1
kernel: [ 1.351617][ T1] (driver?)
kernel: [ 1.351711][ T1] 0102 8192 ram2
kernel: [ 1.351723][ T1] (driver?)
kernel: [ 1.351808][ T1] 0103 8192 ram3
kernel: [ 1.351820][ T1] (driver?)
kernel: [ 1.351906][ T1] 0104 8192 ram4
kernel: [ 1.351917][ T1] (driver?)
kernel: [ 1.352000][ T1] 0105 8192 ram5
kernel: [ 1.352011][ T1] (driver?)
kernel: [ 1.352094][ T1] 0106 8192 ram6
kernel: [ 1.352106][ T1] (driver?)
kernel: [ 1.352185][ T1] 0107 8192 ram7
kernel: [ 1.352196][ T1] (driver?)
kernel: [ 1.352274][ T1] 0108 8192 ram8
kernel: [ 1.352285][ T1] (driver?)
kernel: [ 1.352365][ T1] 0109 8192 ram9
kernel: [ 1.352376][ T1] (driver?)
kernel: [ 1.352469][ T1] 010a 8192 ram10
kernel: [ 1.352480][ T1] (driver?)
kernel: [ 1.352571][ T1] 010b 8192 ram11
kernel: [ 1.352582][ T1] (driver?)
kernel: [ 1.352744][ T1] 010c 8192 ram12
kernel: [ 1.352760][ T1] (driver?)
kernel: [ 1.352847][ T1] 010d 8192 ram13
kernel: [ 1.352860][ T1] (driver?)
kernel: [ 1.352962][ T1] 010e 8192 ram14
kernel: [ 1.352974][ T1] (driver?)
kernel: [ 1.353063][ T1] 010f 8192 ram15
kernel: [ 1.353075][ T1] (driver?)
kernel: [ 1.353296][ T1] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
kernel: [ 1.353515][ T1] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.15.41-android13-8-00030-gc66cde32ee51-ab8840540 #1
kernel: [ 1.353688][ T1] Hardware name: linux,ranchu (DT)
kernel: [ 1.353866][ T1] Call trace:
kernel: [ 1.353921][ T1] dump_backtrace.cfi_jt+0x0/0x8
kernel: [ 1.354014][ T1] dump_stack_lvl+0x80/0xb8
kernel: [ 1.354083][ T1] panic+0x180/0x444
kernel: [ 1.354140][ T1] mount_block_root+0x1ac/0x270
kernel: [ 1.354206][ T1] mount_root+0x68/0x90
kernel: [ 1.354257][ T1] prepare_namespace+0x164/0x1e8
kernel: [ 1.354321][ T1] kernel_init_freeable+0x120/0x19c
kernel: [ 1.354390][ T1] kernel_init+0x40/0x36c
kernel: [ 1.354528][ T1] ret_from_fork+0x10/0x20
kernel: [ 1.354844][ T1] SMP: stopping secondary CPUs
kernel: [ 1.355408][ T1] Kernel Offset: disabled
kernel: [ 1.355480][ T1] CPU features: 0x2,200011e3,20000846
kernel: [ 1.355630][ T1] Memory Limit: none
kernel: [ 1.368911][ T1] Rebooting in 1 seconds..
It seem that for some reason the root fs can't be correctly mounted. However, with Android 12 images this works fine. So how do I need to adjust the build and starting process for Android 13 images?
**Update**:
If I used the additional sdk
module the kernel detects the partitions but avb fails: "source ./build/envsetup.sh && lunch sdk_phone_arm64-userdebug && m && m emu_img_zip"
kernel: [ 2.326708] EXT4-fs (vdd1): recovery complete
kernel: [ 2.328027] EXT4-fs (vdd1): mounted filesystem with ordered data mode. Opts: errors=remount-ro,nomblk_io_submit. Quota mode: none.
kernel: [ 2.331535] init: [libfs_mgr]check_fs(): mount(/dev/block/pci/pci0000:00/0000:00:06.0/by-name/metadata,/metadata,ext4)=0: Success
kernel: [ 2.340460] init: [libfs_mgr]umount_retry(): unmount(/metadata) succeeded
kernel: [ 2.342534] init: [libfs_mgr]Not running /system/bin/e2fsck on /dev/block/vdd1 (executable not in system image)
kernel: [ 2.346563] EXT4-fs (vdd1): mounted filesystem with ordered data mode. Opts: . Quota mode: none.
kernel: [ 2.349029] init: [libfs_mgr]__mount(source=/dev/block/pci/pci0000:00/0000:00:06.0/by-name/metadata,target=/metadata,type=ext4)=0: Success
kernel: [ 2.352748] init: Failed to copy /avb into /metadata/gsi/dsu/avb/: No such file or directory
kernel: [ 2.356374] init: [libfs_mgr]Created logical partition system on device /dev/block/dm-0
kernel: [ 2.359123] init: [libfs_mgr]Created logical partition system_dlkm on device /dev/block/dm-1
kernel: [ 2.362074] init: [libfs_mgr]Created logical partition system_ext on device /dev/block/dm-2
kernel: [ 2.364862] init: [libfs_mgr]Created logical partition product on device /dev/block/dm-3
kernel: [ 2.367299] init: [libfs_mgr]Created logical partition vendor on device /dev/block/dm-4
kernel: [ 2.369287] init: DSU not detected, proceeding with normal boot
kernel: [ 3.376310] init: [libfs_avb]Device path not found: /dev/block/by-name/system
kernel: [ 3.378664] init: [libfs_avb]Fallback to use logical device path: /dev/block/dm-0
kernel: [ 4.384217] init: [libfs_avb]Device path not found: /dev/block/by-name/system
kernel: [ 4.385757] init: [libfs_avb]Fallback to use logical device path: /dev/block/dm-0
kernel: [ 4.388395] init: [libfs_avb]total vbmeta size mismatch: 6720 (expected: 6208)
kernel: [ 4.396205] init: [libfs_avb]Failed to verify vbmeta digest
kernel: [ 4.397695] init: [libfs_avb]vbmeta digest error isn't allowed
kernel: [ 4.399311] init: Failed to open AvbHandle: No such file or directory
kernel: [ 4.400961] init: Failed to setup verity for '/system': No such file or directory
kernel: [ 4.402834] init: Failed to mount /system: No such file or directory
kernel: [ 4.404555] init: Failed to mount required partitions early ...
kernel: [ 4.415023] init: InitFatalReboot: signal 6
kernel: [ 4.425984] init: #00 pc 000000000031f8c8 /init (UnwindStackCurrent::UnwindFromContext(unsigned long, void*)+88)
kernel: [ 4.427662] init: #01 pc 0000000000311b7e /init (android::init::InitFatalReboot(int)+94)
kernel: [ 4.429092] init: #02 pc 0000000000312033 /init (android::init::InstallRebootSignalHandlers()::$_24::__invoke(int)+19)
kernel: [ 4.431357] init: #03 pc 00000000004d99d0 /init (__restore_rt)
kernel: [ 4.432597] init: #04 pc 00000000004ce77e /init (abort+190)
kernel: [ 4.433782] init: #05 pc 0000000000317ceb /init (android::init::InitAborter(char const*)+27)
kernel: [ 4.435544] init: #06 pc 000000000048aecc /init (android::base::SetAborter(std::__1::function&&)::$_3::__invoke(char const*)+60)
kernel: [ 4.438285] init: #07 pc 000000000048a69e /init (android::base::LogMessage::~LogMessage()+350)
kernel: [ 4.440081] init: #08 pc 0000000000307012 /init (android::init::FirstStageMain(int, char**)+10354)
kernel: [ 4.441980] init: #09 pc 00000000004c5cce /init (__real_libc_init(void*, void (*)(), int (*)(int, char**, char**), structors_array_t const*, bionic_tcb*)+718)
Asked by Me7e0r
(21 rep)
Apr 29, 2024, 07:29 AM
Last activity: May 1, 2024, 07:21 AM
Last activity: May 1, 2024, 07:21 AM