【问题标题】:Can't run Yocto image with runqemu like described in documentation无法像文档中描述的那样使用 runqemu 运行 Yocto 映像
【发布时间】:2019-07-27 05:41:35
【问题描述】:

我想在 QEMU 中运行 Yocto 映像,但 the documentation 中描述的方式不起作用。

为了验证我没有做错任何事情,我按照快速构建指南中的步骤操作:

  • 安装所需的软件包
  • 克隆 poky
  • 检查正确的版本
  • 源码编译环境
  • 在 local.conf 中将机器设置为 qemux86
  • 添加 sstate-mirrors 并允许并行构建
  • 启动 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.

文档中是否缺少某些内容?

我也尝试了不同的图像...

  • core-image-sato
  • 核心图像库
  • 核心图像最小

最后我用 2.5.2 (sumo) 版本而不是 2.6.1 (thud) 版本进行了尝试...但没有任何变化...

当我用谷歌搜索这个问题时,除了增加内存之外,我并没有发现任何有用的东西,这并没有改变任何东西,所以我希望这里的任何人都知道出了什么问题......

【问题讨论】:

  • 您是否尝试在没有 runqemu 包装器的情况下运行 qemu?
  • 我也遇到了同样的问题,如果我解决了,我会在这里发帖。

标签: yocto qemu


【解决方案1】:

可能缺少第二个参数的附件。 浏览到错误消息中的文件夹,并检查目录 qemux86 是否存在,可能不存在。

我不得不

runqemu qemux86-64

而不是

runqemu qemux86

【讨论】:

    【解决方案2】:

    如果您尚未更改构建目录中local.conf 文件中的MACHINE 变量,请检查该文件并确保您的映像名称相同。

    【讨论】:

      猜你喜欢
      • 2011-01-11
      • 1970-01-01
      • 2018-04-14
      • 2018-05-31
      • 1970-01-01
      • 1970-01-01
      • 2020-04-04
      • 2017-10-31
      • 2021-05-22
      相关资源
      最近更新 更多