Yocto qemu uboot error (mmc.o failed to build) when trying to build qemu which supports both mender and possibility of additional network interfaces

using yocto, am trying to use qemu for testing purposes, thought it best to ask here before I spent too much time trying things that might not be possible

have gotten vexpress qemu building at least; but as far as I could tell it is impossible to add a network interface to vexpress because vexpress doesn’t have pcie

trying to use virt, since as far as I could tell that is most generic qemu machine, and as far as I can tell in yocto this is called qemuarm

according to this Vanilla qemuarm full multi partition emulation? - #4 by mirzak qemuarm doesn’t support uboot, but according to this u-boot/README.qemu-arm at master · ARM-software/u-boot · GitHub it should as far as I can tell

anyway, u-boot is failing to build, I think this is the important parts:

...
| Makefile:167: recipe for target 'sub-make' failed
| make: *** [sub-make] Error 2
| make: Leaving directory '/opt/yocto/arkki-qemuarm-dev2/tmp/work/arkki_qemu-poky-linux-gnueabi/u-boot/1_2020.01-r0/git'
| ERROR: oe_runmake failed
| WARNING: /opt/yocto/arkki-qemuarm-dev2/tmp/work/arkki_qemu-poky-linux-gnueabi/u-boot/1_2020.01-r0/temp/run.do_compile.12922:1 exit 1 from 'exit 1'
| ERROR: Execution of '/opt/yocto/arkki-qemuarm-dev2/tmp/work/arkki_qemu-poky-linux-gnueabi/u-boot/1_2020.01-r0/temp/run.do_compile.12922' failed with exit code 1:
...

| /opt/yocto/arkki-qemuarm-dev2/tmp/work/arkki_qemu-poky-linux-gnueabi/u-boot/1_2020.01-r0/git/env/mmc.c: In function 'init_mmc_for_env':
| /opt/yocto/arkki-qemuarm-dev2/tmp/work/arkki_qemu-poky-linux-gnueabi/u-boot/1_2020.01-r0/git/env/mmc.c:155:29: error: 'struct mmc' has no member named 'dev'
|   155 |  if (blk_get_from_parent(mmc->dev, &dev))
|       |                             ^~
| /opt/yocto/arkki-qemuarm-dev2/tmp/work/arkki_qemu-poky-linux-gnueabi/u-boot/1_2020.01-r0/git/scripts/Makefile.build:278: recipe for target 'env/mmc.o' failed
| make[2]: *** [env/mmc.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
...
NOTE: recipe u-boot-1_2020.01-r0: task do_compile: Failed
NOTE: Tasks Summary: Attempted 669 tasks of which 660 didn't need to be rerun and 1 failed.

I think the full error output is too verbose to be useful but can be found from Loading cache...done.Loaded 4085 entries from dependency cache.Parsing recip - Pastebin.com Possible Spam Detected - Pastebin.com Possible Spam Detected - Pastebin.com (too large for a single pastebin). I also tried removing CONFIG_MMC=y in menuconfig and got same error, though full output was a bit different

KERNEL_DEVICETREE = "versatile-pb.dtb " is in kernel defconfig, and
KERNEL_DEVICETREE = “versatile-pb.dtb” is in machine.conf file; another include custom .conf has
UBOOT_MACHINE=“qemu_arm_defconfig”

not sure it is relevant, but kernel defconfig I am using can be found from ## Automatically generated file; DO NOT EDIT.# Linux/arm64 5.2.32 Kernel Con - Pastebin.com and u-boot defconfig is from u-boot/qemu_arm_defconfig at master · ARM-software/u-boot · GitHub; i’m pretty sure all my u-boot files are coming from here: meta-mender/meta-mender-core/recipes-bsp/u-boot at zeus · mendersoftware/meta-mender · GitHub; also tried including meta-mender-qemu layer but removed it since it looks like it is vexpress specific stuff

I suspect I need to modify uboot defconfig for things to work but have no idea how I should do that, other thing I am thinking is that maybe because of some detail I am unaware of that kacf is aware of it isn’t (reasonably) possible to get mender working with a qemu machine with pcie and so I will just have to have my testing done on two different qemu targets

Thanks for any help (including informing me that I just need to use two different qemu targets if that is the case)

Hi @threesc,

Thanks a lot for getting started with Mender! Concerning your problem, I am not completely sure where you exactly hit the wall as you seem to have a lot of moving parts involved. On top of it all, the zeus release is deprecated and should not be used anymore, specifically for anything qemu I also can’t see a reason why it would be desirable.

So to get you started on a full flash , e.g. u-boot aware setup, can you start by building the vexpress-nor machine for dunfell? This should give you full Mender integration as well as network connectivity. The documentation can be found here.

Please note that this is not functional on kirkstone: the flash emulation in that machine can only provide 256M, and that is not enough for a working setup on releases after dunfell anymore. However it is a good starting point.

Hope this helps, let me know if you run into any problems.

Greetz,
Josef

Note that the 256M limit is only if you use raw Flash storage. For block storage (the default) it works with any size. Including the meta-mender-qemu layer and setting MACHINE = "vexpress-qemu" should already get you pretty far.

versatilepb does not work, because U-Boot doesn’t support booting it under QEMU.

1 Like

unfortunately am stuck with zeus until I have time to update a lot of existing stuff to something not deprecated

anyway, managed to build vexpress-nor for dunfell separately from anything else I’m working on with core-image-minimal and boot that into qemu; but when I tried adding network interface I got this:

qemu-system-arm: -device e1000,netdev=eth3: No 'PCI' bus found for device 'e1000'

that is same problem I was having with vexpress and as far as I can tell it means there isn’t any way to add network interfaces to that qemu machine and I need to use another qemu machine