我想在 QEMU 中运行 Yocto 图像,但它是如何在 the documentation 中描述的不起作用。
为了验证我没有做错任何事,我遵循了快速构建指南中的步骤:
- 安装所需的包
- 克隆 poky
- 检查正确的版本
- 源代码构建环境
- 在 local.conf 中将机器设置为 qemux86
- 添加状态镜像并允许并行构建
- 启动 bitbake core-image-sato
- 在接下来的几个小时里做点别的事
当我现在尝试像文档中描述的那样在 qemu 中运行该图像时:
runqemu qemux86
我只是得到以下输出,没有任何反应:
runqemu - INFO - Running MACHINE=qemux86 bitbake -e...
runqemu - INFO - Continuing with the following parameters:
KERNEL: [/mnt/wwn-0x50014ee0576fe9ef- part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/bzImage--4.14.76+git0+3435617380_2c5caa7e84-r0-qemux86-20190305114605.bin]
MACHINE: [qemux86]
FSTYPE: [ext4]
ROOTFS: [/mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/core-image-base-qemux86-20190305151244.rootfs.ext4]
CONFFILE: [/mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/core-image-base-qemux86-20190305151244.qemuboot.conf]
runqemu - INFO - Setting up tap interface under sudo
runqemu - INFO - Network configuration: 192.168.7.2::192.168.7.1:255.255.255.0
runqemu - INFO - Running /mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -drive file=/mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/core-image-base-qemux86-20190305151244.rootfs.ext4,if=virtio,format=raw -vga vmware -show-cursor -usb -device usb-tablet -device virtio-rng-pci -cpu pentium2 -m 256 -serial mon:vc -serial null -kernel /mnt/wwn-0x50014ee0576fe9ef-part1/test_python3_in_yocto/build/tmp/deploy/images/qemux86/bzImage--4.14.76+git0+3435617380_2c5caa7e84-r0-qemux86-20190305114605.bin -append 'root=/dev/vda rw highres=off mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1 '
当我尝试在没有图形的情况下运行 qemu 时,我遇到了内核崩溃:
runqemu nographic qemux86
...
[ 6.171521] EXT4-fs (vda): mounted filesystem with ordered data mode. Opts: (null)
[ 6.172937] VFS: Mounted root (ext4 filesystem) on device 253:0.
[ 6.175806] devtmpfs: error mounting -2
[ 6.237143] Freeing unused kernel memory: 852K
[ 6.238001] Write protecting the kernel text: 8752k
[ 6.238722] Write protecting the kernel read-only data: 2376k
[ 6.244382] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin.
[ 6.245455] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.14.76-yocto-standard #1
[ 6.245913] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/4
[ 6.246730] Call Trace:
[ 6.247788] dump_stack+0x58/0x72
[ 6.248071] ? rest_init+0x90/0xc0
[ 6.248320] panic+0x94/0x1c6
[ 6.248529] ? rest_init+0xc0/0xc0
[ 6.248807] kernel_init+0xda/0xf0
[ 6.249046] ret_from_fork+0x2e/0x38
[ 6.249834] Kernel Offset: 0xd800000 from 0xc1000000 (relocation range: 0xc0000000-0xd07dbfff)
[ 6.250595] ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentat.
文档中是否缺少某些内容?
我也尝试了不同的图片...
- 核心形象佐藤
- 核心图像库
- 核心图像最小化
最后我尝试使用版本 2.5.2 (sumo) 而不是 2.6.1 (thud)...但没有变化...
当我用谷歌搜索这个问题时,除了增加内存外,我没有发现任何有用的东西,这并没有改变任何东西,所以我希望这里的任何人都知道出了什么问题......
最佳答案
可能缺少第二个参数的附属物。 浏览到错误消息中的文件夹,并检查目录 qemux86 是否存在,很可能不存在。
我不得不
runqemu qemux86-64
不是
runqemu qemux86
关于yocto - 无法像文档中描述的那样使用 runqemu 运行 Yocto 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55008174/