我正在尝试运行 orange-pi 仿真自建Linux内核通过以下命令:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make mrproper
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make sunxi_defconfig
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make
并使用默认的 buildroot 生成系统orangepi_zero_defconfig
。尝试通过以下命令运行模拟:
qemu-system-arm -M orangepi-pc -nic user -nographic \
-kernel linux/arch/arm/boot/zImage \
-append 'root=/dev/mmcblk0 panic=1 rootfstype=ext4 rw' \
-dtb linux/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb \
-drive file=sdcard.img,format=raw,if=sd \
-no-reboot
在启动日志中我看到以下内容:
[ 5.337453] List of all partitions:
[ 5.338217] b300 2097152 mmcblk0
[ 5.347713] driver: mmcblk
[ 5.347884] b301 61440 mmcblk0p1 4d1f495b-d662-4b1d-818a-591ebed99bac
[ 5.348161]
[ 5.348330] No filesystem could mount root, tried:
[ 5.349117] ext4
[ 5.349219]
[ 5.349738] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,0)
完整登录Google 云端硬盘。
仿真停止并显示重启消息。
答案1
我已经修复了这个问题。
修复系统映像
fdisk sdcard.img
>w
修复 qemu 命令中的内核参数:
qemu-system-arm -M orangepi-pc -nic user -nographic \
-kernel linux/arch/arm/boot/zImage \
-append 'bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p1 rw rootfstype=ext4 rootwait' \
-dtb linux/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb \
-drive file=sdcard.img,format=raw,if=sd \
-no-reboot