You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android 11 AOSP编译后模拟器启动循环故障求助

Troubleshooting Android 11 AOSP Boot Loop with execv("/system/bin/init") Error

Hey there, let's break down the boot loop issue you're hitting after compiling Android 11 (android-11.0.0_r17) and launching the emulator. Those errors point to a few key areas we can investigate step by step:

Core Issue Breakdown

First, let's clarify the critical errors:

  • init: execv("/system/bin/init") failed: No such file or directory: Even though you confirmed init exists in the ramdisk, the system is trying to launch it from /system/bin—which suggests either the system partition isn't mounting correctly, or there's a misconfiguration in the init scripts.
  • Unable to open /lib/modules, skipping module loading: This is a warning (not usually a boot loop trigger on its own), but it might hint at a mismatch between your kernel and system image.

Step-by-Step Fixes

1. Simplify the Emulator Launch Command

Manually specifying image paths can introduce typos or mismatches. Try launching the emulator directly from your AOSP directory, which auto-loads the correct build artifacts:

cd /home/ubuntu/aosp
source build/envsetup.sh
lunch generic_x86-eng
emulator -verbose -show-kernel

This ensures the emulator uses the exact kernel, system, and ramdisk from your out/target/product/generic_x86 directory without manual path errors.

2. Verify AVD Architecture Matches Your Build

You're using an AVD named a25x86, but your build targets generic_x86 (32-bit x86). If your AVD is configured for x86_64, this mismatch can cause mounting failures.

  • Create a new AVD specifically for generic_x86:
    1. Run avdmanager create avd -n aosp_x86 -k "system-images;android-30;google_apis;x86" (Android 11 corresponds to API 30)
    2. Launch with emulator -avd aosp_x86 -verbose -show-kernel

3. Check if /system/bin/init Actually Exists

The error says this file is missing—let's verify your system.img has it:

# Convert sparse image to raw format
simg2img /home/ubuntu/aosp/out/target/product/generic_x86/system.img system_raw.img
# Mount the raw image
mkdir -p /mnt/aosp_system
sudo mount -o loop system_raw.img /mnt/aosp_system
# Check for init in system/bin
ls /mnt/aosp_system/bin/init

If the file is missing, your build likely didn't complete successfully. Try a clean rebuild:

cd /home/ubuntu/aosp
make clean
lunch generic_x86-eng
make -j$(nproc)

4. Inspect Ramdisk Init Configuration

Even if init exists in the ramdisk, the init scripts might be pointing to the wrong path. Let's unpack the ramdisk and check:

mkdir ramdisk_unpacked
cd ramdisk_unpacked
gzip -dc /home/ubuntu/aosp/out/target/product/generic_x86/ramdisk.img | cpio -idm
# Look for references to /system/bin/init in init.rc
grep "exec.*init" init.rc

Normally, the initial init runs from the ramdisk root (/init), not /system/bin/init. If you see a line trying to exec /system/bin/init before the system partition is mounted, that's the problem. Reverting to the default init.rc for generic_x86 should fix this.

5. Rule Out Kernel/Module Mismatches

The /lib/modules warning might indicate your kernel wasn't built with module support, or the modules aren't packaged into the system image. For emulator builds, you can usually ignore this, but if you modified the kernel config:

  • Revert to the default kernel config for generic_x86
  • Rebuild the kernel with make kernel then recompile the system images.

Final Notes

Start with the simplest fixes first—simplifying the emulator command and checking AVD architecture. If those don't work, verifying the system.img content and init scripts will get you to the root cause.

内容的提问来源于stack exchange,提问作者emras

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 20:12:55