将自定义 Android 11 内核加载到 AVD/模拟器

问题描述 投票:0回答:1

我希望能够构建自定义内核并在 Android 虚拟设备 (AVD) 上运行它。我已尝试执行以下说明,但它会导致启动循环。我按照此处的说明进行操作:https://source.android.com/setup/build/building-kernels下载 Android 内核源代码。

同步并构建

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

使用 Pixel 4、API 30、ABI x86_64 AVD 运行模拟器

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

这些是设备重新启动之前发生的一些行:

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
android kernel emulation android-source android-virtual-device
1个回答
0
投票

内核必须匹配virtual_device,虚拟设备相关模块会被打包到ramdisk中,所以你的ramdisk也必须更新

下面是内核编译产物,所有ko都需要同步到ramdisk

abi.prop goldfish_pipe.ko module.builtin snd-hda-codec.ko usbip-core.ko virtio_pmem.ko ac97_bus.ko goldfish_sync.ko module.builtin.modinfo snd-hda-codec-realtek.ko vcan.ko virtio-rng.ko btintel.ko gs_usb.komodules.load snd-hda-core.kovendor_boot.modules.load virtio_snd.ko btrtl.ko hci_vhci.ko 仅模块.symvers snd-hda-intel.ko vhci-hcd.ko virt_wifi.ko btusb.ko initramfs.img 模块.order snd-intel8x0.ko virtio_balloon.ko virt_wifi_sim.ko bzImage kernel-headers.tar.gz Module.symvers snd-intel-dspcfg.ko virtio_blk.ko vmlinux cfg80211.ko kernel-uapi-headers.tar.gz nd_virtio.ko system_heap.ko virtio_console.ko vmlinux.o defconfig ledtrig-audio.ko net_failover.ko System.map virtio_dma_buf.ko vmlinux.symvers dummy-cpufreq.ko lzo.ko psmouse.ko test_mapping_files.txt virtio-gpu.ko vmw_vsock_virtio_transport.ko failover.ko lzo-rle.kopulse8-cec.ko test_mappings.zip virtio_input.ko zram.ko gnss-cmdline.ko mac80211_hwsim.ko rtc-test.ko test_meminit.ko virtio_mem.ko zsmalloc.ko gnss-serial.ko mac80211.ko slcan.ko test_stackinit.ko virtio_mmio.ko goldfish_address_space.ko Makefile snd-ac97-codec.ko tpm.ko virtio_net.ko goldfish_battery.ko md-mod.ko snd-hda-codec-generic.ko tpm_vtpm_proxy.ko virtio_pci.ko

你需要: cp dist/* aosp/kernel/prebuilts/common-modules/virtual-device/5.10/x86-64/

© www.soinside.com 2019 - 2024. All rights reserved.