Load custom Android 11 kernel to AVD/emulator

Viewed 522

I want to be able to build a custom kernel and run it on an Android Virtual Device (AVD). I have attempted the following instructions but it results in a boot loop. I followed instructions here: https://source.android.com/setup/build/building-kernels to download Android kernel source.

Synced and built with

repo init -b common-android-mainline && repo sync
repo sync
BUILD_CONFIG=common/build.config.x86_64 build/build.sh

Ran the emulator with a Pixel 4, API 30, ABI x86_64 AVD

emulator @Pixel_4_API_30 -kernel out/android-mainline/dist/bzImage -show-kernel -verbose

These are some lines that occur before the device reboots:

android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found in /sys, waiting for their uevent(s): metadata, super, vbmeta
[   10.888602] init: Wait for partitions returned after 10010ms
[   10.889489] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found after polling timeout: metadata, super, vbmeta
[   10.891648] init: Failed to mount required partitions early ...
[   10.892517] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
0 Answers
Related