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

**URL:** https://hub.mender.io/t/yocto-qemu-uboot-error-mmc-o-failed-to-build-when-trying-to-build-qemu-which-supports-both-mender-and-possibility-of-additional-network-interfaces/5337
**Category:** General Discussions
**Tags:** yocto, qemu
**Created:** [October 20, 2022, 10:02am UTC](https://hub.mender.io/t/yocto-qemu-uboot-error-mmc-o-failed-to-build-when-trying-to-build-qemu-which-supports-both-mender-and-possibility-of-additional-network-interfaces/5337 "2022-10-20T10:02:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![threesc](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@threesc](https://hub.mender.io/u/threesc)
#### Post date: [October 20, 2022, 10:02am UTC](https://hub.mender.io/t/yocto-qemu-uboot-error-mmc-o-failed-to-build-when-trying-to-build-qemu-which-supports-both-mender-and-possibility-of-additional-network-interfaces/5337/1 "2022-10-20T10:02:34Z")

</div>

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](https://hub.mender.io/t/vanilla-qemuarm-full-multi-partition-emulation/1339/4) qemuarm doesn’t support uboot, but according to this [u-boot/README.qemu-arm at master · ARM-software/u-boot · GitHub](https://github.com/ARM-software/u-boot/blob/master/doc/README.qemu-arm) it should as far as I can tell

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

```auto
...
| 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](https://pastebin.com/QvSNHJZv) [Possible Spam Detected - Pastebin.com](https://pastebin.com/Kcs9umAC) [Possible Spam Detected - Pastebin.com](https://pastebin.com/25v0QxvU) (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](https://pastebin.com/EMu039Ty) and u-boot defconfig is from [u-boot/qemu\_arm\_defconfig at master · ARM-software/u-boot · GitHub](https://github.com/ARM-software/u-boot/blob/master/configs/qemu_arm_defconfig); 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](https://github.com/mendersoftware/meta-mender/tree/zeus/meta-mender-core/recipes-bsp/u-boot); 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)

---

<div class="post-metadata">

### Author: ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)
#### Post date: [October 20, 2022, 2:38pm UTC](https://hub.mender.io/t/yocto-qemu-uboot-error-mmc-o-failed-to-build-when-trying-to-build-qemu-which-supports-both-mender-and-possibility-of-additional-network-interfaces/5337/2 "2022-10-20T14:38:23Z")

</div>

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`](https://github.com/mendersoftware/meta-mender/blob/dunfell/meta-mender-qemu/conf/machine/vexpress-qemu-flash.conf) machine for dunfell? This should give you full Mender integration as well as network connectivity. The documentation can be found [here](https://docs.mender.io/system-updates-yocto-project/board-integration/raw-flash/example-qemu).

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

---

<div class="post-metadata">

### Author: ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)
#### Post date: [October 21, 2022, 6:43am UTC](https://hub.mender.io/t/yocto-qemu-uboot-error-mmc-o-failed-to-build-when-trying-to-build-qemu-which-supports-both-mender-and-possibility-of-additional-network-interfaces/5337/3 "2022-10-21T06:43:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![threesc](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@threesc](https://hub.mender.io/u/threesc)
#### Post date: [October 21, 2022, 10:21am UTC](https://hub.mender.io/t/yocto-qemu-uboot-error-mmc-o-failed-to-build-when-trying-to-build-qemu-which-supports-both-mender-and-possibility-of-additional-network-interfaces/5337/4 "2022-10-21T10:21:37Z")

</div>

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:

```auto
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
