2

I'm trying to build an AVD image with custom kernel for android emulator, following instructions at https://source.android.com/devices/automotive/start/avd/android_virtual_device

The problem is that the emulator only displays black screen when using self-built kernel. When I copy the kernel from prebuilts folder or use a kernel from a downloaded AVD image, it works.

I have built the avd image with following steps:

ANDROID_BRANCH="android11-qpr2-release"

REPO_URL="https://android.googlesource.com/platform/manifest"

mkdir $ANDROID_BRANCH && cd $ANDROID_BRANCH && repo init -u $REPO_URL -b $ANDROID_BRANCH --partial-clone &&  repo sync -c -j8

. build/envsetup.sh && lunch avd_car-userdebug && m -j8

m emu_img_zip

Then I built the kernel with following steps:

mkdir goldfish-kernel-54
cd goldfish-kernel-54
repo init -u https://android.googlesource.com/kernel/manifest -b
common-android11-5.4
repo sync
BUILD_CONFIG=common/build.config.gki.x86_64 build/build.sh
BUILD_CONFIG=common-modules/virtual-device/build.config.goldfish.x86_64
build/build.sh
ls -l ./out/android11-5.4/dist/

Then I unzipped sdk-repo-linux-system-images-eng.username.zip to system-images folder, copied bzImage to that folder and renamed bzImage to kernel-ranchu-64.

wekso
  • 39
  • 7

1 Answers1

0
mkdir goldfish-kernel-54
cd goldfish-kernel-54
repo init -u https://android.googlesource.com/kernel/manifest -b
common-android11-5.4
repo sync

After repo sync you need to build kernel following way Build Config for Android common kernel

BUILD_CONFIG=common-modules/virtual-device/build.config.cuttlefish.x86_64 
build/build.sh

Then run below command for Emulator

BUILD_CONFIG=common-modules/virtual-device/build.config.virtual_device.x86_64
build/build.sh

For more detail follow my blog https://saurabhsharma123k.blogspot.com/

SAURABH_12
  • 2,262
  • 1
  • 19
  • 19