0

I'm able to build an modified AOSP Emualtor for x86. This one builds and starts properly. Now, I want to build same for arm64 (Apple Silicon M1)

  • I fetched the android aosp mainline tree (next fetch --target my_car_emu-mainline)
  • Then I created a new device based on device/my/my_car_emu
  • that mean I added a new folder by copying the my_car_emu one there for example my_car_emu_arm64
  • add this new folder to AndroidProducts.mk
  • change your Boardconfig.mk and my_car_emu_arm64.mk to set up for arm64 architecture instead of x86_64
  • next shell --target my_car_emu-mainline then lunch … select
  • it In same shell, I was to build (make -jX)

During start I see ...

The root cause

VERBOSE | Could not find SDK version in build.prop, default is: 10000
VERBOSE | autoconfig: -skin HVGA
VERBOSE | autoconfig: -skindir (null)
ERROR   | bad workspace: cannot find prebuilt ranchu kernel in: /Users/hannes/Library/Android/sdk/prebuilts/qemu-kernel/arm/ranchu/kernel-qemu
ERROR   | This AVD's configuration is missing a kernel file! Please ensure the file "kernel-ranchu" is in the same location as your system image.
ERROR   | ANDROID_SDK_ROOT is defined (/Users/hannes/Library/Android/sdk) but cannot find kernel file in /Users/hannes/Library/Android/sdk/system-images/ sub directories

My current unsuccessful solution for root cause

cp ~/Library/Android/sdk/system-images/android-30/google_apis/arm64-v8a/kernel-ranchu ~/MY/my_car_emu_arm64

Now I see

[    0.184786] uart-pl011 9000000.pl011: no DMA platform data
[    0.185313] Freeing unused kernel memory: 1216K
[    0.207918] cryptomgr_probe (109): highest shadow stack usage: 168 bytes
[    0.215882] Run /init as init process
[    0.216987] init: init first stage started!
[    0.217330] init: Unable to open /lib/modules, skipping module loading.
[    0.217984] init: Using Android DT directory /proc/device-tree/firmware/android/
[    0.218675] init: [libfs_mgr]ReadDefaultFstab(): failed to find device default fstab
[    0.222438] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found in /sys, waiting for their uevent(s): system, vendor
[   10.236993] init: Wait for partitions returned after 10013ms
[   10.239044] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found after polling timeout: system, vendor
[   10.242109] init: Failed to mount required partitions early ...
[   10.243405] init: InitFatalReboot: signal 6
[   10.253935] init: #00 pc 0000000000302920  /init (UnwindStackCurrent::UnwindFromContext(unsigned long, void*)+96)
[   10.255564] init: #01 pc 0000000000274e88  /init (android::init::InitFatalReboot(int)+208)
[   10.256827] init: #02 pc 0000000000275268  /init (android::init::InstallRebootSignalHandlers()::$_22::__invoke(int)+32)
[   10.258463] init: #03 pc 00000000000005c0  [vdso:0000007f811f1000] (__kernel_rt_sigreturn)
[   10.259719] init: #04 pc 0000000000376884  /init (abort+160)
[   10.260565] init: #05 pc 0000000000277b74  /init (android::init::InitAborter(char const*)+44)
[   10.261705] init: #06 pc 00000000002c4f28  /init (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+76)
[   10.263498] init: #07 pc 00000000002c4748  /init (android::base::LogMessage::~LogMessage()+320)
[   10.264660] init: #08 pc 000000000026ca38  /init (android::init::FirstStageMain(int, char**)+5796)
[   10.265849] init: #09 pc 000000000037571c  /init (__real_libc_init(void*, void (*)(), int (*)(int, char**, char**), structors_array_t const*, bionic_tcb*)+576)
[   10.267716] init: Reboot ending, jumping to kernel
[   10.268635] cfg80211: failed to load regulatory.db
[   10.269356] reboot: Restarting system with command 'bootloader'
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x00000000]
[    0.000000] Linux version 5.4.86-android11-2-00040-g29b2beadc627-ab7157994 (build-user@build-host) (Android (6443078 based on r383902) clang version 11.0.1 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79), LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)) #1 SMP PREEMPT Fri Feb 19 11:59:46 UTC 2021
[    0.000000] Machine model: linux,ranchu

New root cause

partition(s) not found in /sys, waiting for their uevent(s): system, vendor
hannes ach
  • 16,247
  • 7
  • 61
  • 84

0 Answers0