# Mender not building with yocto due to issues with u-boot

**URL:** <https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136>\
**Category:** General Discussions\
**Tags:** yocto, mender-client, jetson\
**Created:** [August 23, 2024, 11:24pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136 "2024-08-23T23:24:13Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [August 23, 2024, 11:24pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/1 "2024-08-23T23:24:13Z")

</div>

Good evening,

I have a jetson xavier agx and was able to build the `tegra-demo-distro` with scarthgap (LT35.5.0) without problems, with these layers:

```auto
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-tegra \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-oe \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-python \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-networking \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-filesystems \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-virtualization \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-tegra-community \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-tegra-support \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-demo-ci \
  /home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-tegrademo \

```

When I then add the mender-core and -demo layer I get this error:

```auto
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing PROVIDES 'u-boot'
u-boot was skipped: Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the jetson-agx-xavier-devkit machine configuration.
ERROR: Required build target 'core-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-minimal', 'u-boot']

```

I think the reason is this: [mender-setup-grub](https://github.com/mendersoftware/meta-mender/blob/master/meta-mender-core/classes/mender-setup-grub.inc)

If I then add `MENDER_EFI_LOADER = ""` to the conf/local.conf the build starts but at the very end fails with the following error:

```auto
| DEBUG: Executing dd if=/dev/zero of=/home/yocto/yocto-tegra/tegra-demo-distro/build/tmp/work/jetson_agx_xavier_devkit-oe4t-linux/tegra-espimage/1.0/deploy-tegra-espimage-image-complete/tegra-espimage-jetson-agx-xavier-devkit-20240823205838.esp seek=65536 count=0 bs=1024
| 0+0 records in
| 0+0 records out
| 0 bytes copied, 6.2206e-05 s, 0.0 kB/s
| DEBUG: Actual Rootfs size: 4 /home/yocto/yocto-tegra/tegra-demo-distro/build/tmp/work/jetson_agx_xavier_devkit-oe4t-linux/tegra-espimage/1.0/rootfs.image_esp
| DEBUG: Actual Partition size: 67108864
| DEBUG: Executing mkfs.vfat -F 32 -I /home/yocto/yocto-tegra/tegra-demo-distro/build/tmp/work/jetson_agx_xavier_devkit-oe4t-linux/tegra-espimage/1.0/deploy-tegra-espimage-image-complete/tegra-espimage-jetson-agx-xavier-devkit-20240823205838.esp
| mkfs.fat 4.2 (2021-01-31)
| /home/yocto/yocto-tegra/tegra-demo-distro/build/tmp/work/jetson_agx_xavier_devkit-oe4t-linux/tegra-espimage/1.0/rootfs.image_esp/*: No such file or directory
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/yocto/yocto-tegra/tegra-demo-distro/layers/meta-tegra/recipes-bsp/uefi/tegra-espimage.bb:do_image_esp) failed with exit code '1'

```

I am using the `INHERIT += "mender-full"` option.

What I am doing wrong?

---

<div class="post-metadata">

**Author:** ![lramirez](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/lramirez/32/1195_2.png) [@lramirez](https://hub.mender.io/u/lramirez)\
**Post date:** [August 27, 2024, 3:46pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/2 "2024-08-27T15:46:07Z")

</div>

Hello @y1thu,

I recommend you to follow [meta-mender-community/meta-mender-tegra/meta-mender-tegra-jetpack5 at kirkstone · mendersoftware/meta-mender-community · GitHub](https://github.com/mendersoftware/meta-mender-community/tree/kirkstone/meta-mender-tegra/meta-mender-tegra-jetpack5) instead.

In the KAS’s yaml file you can see we actually remove it as these devices don’t use u-boot in [here](https://github.com/mendersoftware/meta-mender-community/blob/1d98cc9391e57a6f9cdf8df9cfc6f266b85dca6c/kas/include/tegra-jetpack5.yml#L25C5-L25C53):

```auto
MENDER_FEATURES_DISABLE:append = " mender-uboot"

```

Try adding this line in your local.conf, if it doesn’t work, please try following the README file from the repository instead.

Luis

---

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [August 27, 2024, 7:45pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/3 "2024-08-27T19:45:11Z")

</div>

Dear Luis,

I added this line to the `layer.conf`:

```auto
MENDER_FEATURES_DISABLE:append = " mender-uboot"

```

but still the same error message:

```bash
ERROR: Nothing PROVIDES 'u-boot' (but /home/yocto/git/yocto-heraeus/layers/meta/recipes-bsp/grub/grub-efi_2.12.bb, /home/yocto/git/yocto-heraeus/layers/meta-mender-core/recipes-bsp/grub/grub-efi-mender-precompiled_2.04.bb DEPENDS on or otherwise requires it)
u-boot was skipped: Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the jetson-agx-xavier-devkit machine configuration.
NOTE: Runtime target 'grub-efi' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['grub-efi', 'u-boot']
ERROR: Required build target 'heraeus-ai-image' has no buildable providers.
Missing or unbuildable dependency chain was: ['heraeus-ai-image', 'tegra-espimage', 'grub-efi', 'u-boot']

```

Now I am building using the kas.yaml from [here](https://github.com/mendersoftware/meta-mender-community/tree/kirkstone/meta-mender-tegra/meta-mender-tegra-jetpack5) as suggested.  
However this is for `kirkstone`. Do you have a modification that works with meta-tegra `scarthgap-l4t-r35.x` ?

---

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [August 29, 2024, 5:58pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/4 "2024-08-29T17:58:34Z")

</div>

Hello @lramirez ,

I did compile according to [https://github.com/mendersoftware/meta-mender-community/tree/kirkstone/meta-mender-tegra/meta-mender-tegra-jetpack5](https://github.com/mendersoftware/meta-mender-community/tree/kirkstone/meta-mender-tegra/meta-mender-tegra-jetpack5) but the NVidia Jetson fails in the boot process with `systemd-gpt-auto-generator: EFI loader partition unknown` .

Also when building with yocto I normally obtain `*rootfs.tegraflash.tar.gz` however with kas the `rootfs` part is missing.

Can you maybe advice?

---

<div class="post-metadata">

**Author:** ![lramirez](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/lramirez/32/1195_2.png) [@lramirez](https://hub.mender.io/u/lramirez)\
**Post date:** [August 29, 2024, 9:19pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/5 "2024-08-29T21:19:24Z")

</div>

What artifacts are being produced? I’m curious if you are building the image suitable for the storage device you are using.

---

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [August 30, 2024, 5:35pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/6 "2024-08-30T17:35:59Z")

</div>

@lramirez not sure exactly what you mean. I just cloned the repo and used `kas build kas/jetson-agx-xavier-devkit.yml`, so essentially using the standards.

These are the standard settings in the other yaml’s:  
IMAGE\_FSTYPES:tegra = “tegraflash mender dataimg”

Also this is specified:  
MENDER\_FEATURES\_ENABLE:append = " mender-growfs-data"

perhaps I need to change to something along these lines:

# Mender partition settings

MENDER\_STORAGE\_DEVICE\_BASE = “/dev/mmcblk0p”  
MENDER\_DATA\_PART = “${MENDER\_STORAGE\_DEVICE\_BASE}24”  
MENDER\_ROOTFS\_PART\_A = “${MENDER\_STORAGE\_DEVICE\_BASE}1”  
MENDER\_ROOTFS\_PART\_B = “${MENDER\_STORAGE\_DEVICE\_BASE}18”

Or can you comment what to use to flask the tar.gz? I am using this: ./doflash.sh

I just saw that there is since last week a `scarthgap` meta-mender-community version. I am testing this one now but also failing, see this pull request: [scarthgap-l4t-r35.x kas build errors by tjhgit · Pull Request #403 · mendersoftware/meta-mender-community · GitHub](https://github.com/mendersoftware/meta-mender-community/pull/403)

---

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [September 3, 2024, 6:49pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/7 "2024-09-03T18:49:32Z")

</div>

@lramirez any help with this? I progressed a lot meanwhile. Not I am stuck again. Why does A/B boot not work properly … See the pull request: [scarthgap-l4t-r35.x kas build errors by tjhgit · Pull Request #403 · mendersoftware/meta-mender-community · GitHub](https://github.com/mendersoftware/meta-mender-community/pull/403)

---

<div class="post-metadata">

**Author:** ![lramirez](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/lramirez/32/1195_2.png) [@lramirez](https://hub.mender.io/u/lramirez)\
**Post date:** [September 4, 2024, 12:17am UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/8 "2024-09-04T00:17:32Z")

</div>

Hello @y1thu,

Quick question, does this PRs fix your problem or after applying them are you still stuck?

BR,  
Luis

---

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [September 4, 2024, 9:12pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/9 "2024-09-04T21:12:45Z")

</div>

@lramirez as mentioned in my own PR, the problem is the A/B boot not working properly. Not sure how to install the `nvbootctrl` from NVidia in yocto or whether this is not needed.

This is the problem

```auto
root@jetson-agx-xavier-devkit:~# fw_printenv
ERR: could not identify current boot slot
mender_boot_part=UNKNOWN

```

And after changing the slot from 2 and back to 1 it hangs in EFI.

---

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [September 6, 2024, 3:27pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/10 "2024-09-06T15:27:47Z")

</div>

@lramirez , this issue with the slots also prevents yocto updates. See the logs of mender cloud instance after trying an update:

```bash
2024-09-05 17:37:24.541 +0000 UTC info: Running Mender client 4.0.4
2024-09-05 17:37:24.543 +0000 UTC info: Deployment with ID 1d1d43fa-ddd6-4ac5-abb0-0a857d50b055 started.
2024-09-05 17:37:24.549 +0000 UTC info: Sending status update to server
2024-09-05 17:37:25.342 +0000 UTC info: Installing artifact...
2024-09-05 17:37:25.568 +0000 UTC info: Update Module output (stderr): ERR: could not identify current boot slot
2024-09-05 17:37:25.57 +0000 UTC info: Update Module output (stderr): /usr/share/mender/modules/v3/rootfs-image: line 96: test: UNKNOWN: integer expression expected
2024-09-05 17:37:25.596 +0000 UTC info: Update Module output (stderr): Mounted root does not match boot loader environment (/dev/mmcblk0p2)!
2024-09-05 17:37:25.597 +0000 UTC error: Process returned non-zero exit status: Download: Update Module returned non-zero status: Process exited with status 1
2024-09-05 17:37:25.626 +0000 UTC info: Sending status update to server

```

---

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [September 8, 2024, 4:53pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/11 "2024-09-08T16:53:23Z")

</div>

@lramirez trying now this update procedure using nvidia ota tools as described thankfully by you. [Nvidia Jetson Orin L4T image Update](https://hub.mender.io/t/nvidia-jetson-orin-l4t-image-update/6985). This seems to work (with L4T 35.5), however it is real pitty that the yocto image of mender does not work with jetson.

Why is it so hard to integrate mender in yocto correctly?

---

<div class="post-metadata">

**Author:** ![lramirez](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/lramirez/32/1195_2.png) [@lramirez](https://hub.mender.io/u/lramirez)\
**Post date:** [September 11, 2024, 11:51pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/12 "2024-09-11T23:51:54Z")

</div>

Hello @y1thu,

Thanks for following up. Sadly most of the meta-tegra and mender integration are community maintained.

Let me ping @TheYoctoJester in here as he may add some light on this.

Best regards,  
Luis

---

<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:** [September 13, 2024, 7:20am UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/13 "2024-09-13T07:20:15Z")

</div>

Hi @y1thu,

The problem is not so much Yocto nor Mender, but Nvidia Tegra. They constantly refuse to do things in an open way, or such that it aligns with somebody else. Hence if you walk off their proposed path using their Ubuntu “derivative”, you end up dealing with all their peculiarities. That’s why `meta-tegra` is so complex, it replicates much of that stuff.

With `meta-mender` and `meta-mender-community` being meant for general usability, combining it with `meta-tegra` can be somewhat painful then. Many thanks again to @zach-welch-aquabyte, @dwalkes, and everybody who contributes to this.

Concerning the given error message, I just commented over on GitHub: [scarthgap-l4t-r35.x kas build errors by tjhgit · Pull Request #403 · mendersoftware/meta-mender-community · GitHub](https://github.com/mendersoftware/meta-mender-community/pull/403#issuecomment-2348183708)

The logic needs to make sure the partition which is about to be modified is actually the one which is expected, e.g. not in active use. Hence this check.

Please drop the output of the `mount` command so we can see what is actually mounted given which way, so we can figure out how to move forward.

Greets,  
Josef

---

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [September 15, 2024, 12:45pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/14 "2024-09-15T12:45:04Z")

</div>

Hi @TheYoctoJester . I replied to your suggestion. The root cause must be someplace else. I also have issues with A/B booting with x86\_64 yocto build with mender. When issuing the grub commands:

```auto
grub-mender-grubenv-set mender_boot_part 3
grub-mender-grubenv-set mender_boot_part_hex 3
reboot

```

from [here](https://docs.mender.io/client-installation/integration-checklist#confirm-os-switch-using-bootloader-variables).

It gets stuck in boot ☹

It is actually worse than that: yocto with mender you can boot Nvidia jetson agx xavier exactly 2x times until it gets stuck in PXE boot. First reboot switches to B (even when not told to do so). Next boot IPXE.

Same yocto without any mender layers works perfectly.

---

<div class="post-metadata">

**Author:** ![y1thu](https://avatars.discourse-cdn.com/v4/letter/y/96bed5/32.png) [@y1thu](https://hub.mender.io/u/y1thu)\
**Post date:** [September 17, 2024, 5:56pm UTC](https://hub.mender.io/t/mender-not-building-with-yocto-due-to-issues-with-u-boot/7136/15 "2024-09-17T17:56:09Z")

</div>

@TheYoctoJester interestingly however I did just ignore the integration test above ( that mender proposes ) using x86\_64 yocto with mender and uploaded `.mender` yocto os build file and deployed on the device. Magic happens: it boots to root B installs and it works. This process is repeatable. So maybe the above `grub` commands are just wrong (or starting at the wrong offset)?

This however does not solve the NVIDIA Jetson issue. Just noticed however today that 2 days ago a new commit in meta-tegra regarding nvbootctrl. So testing this now. See if that resolves issues =\> NO IT DOES NOT. Still same issue 2x reboots and Nvidia jetson gets stuck in IPXE boot.

Additionally what I find strange, that is even if I do enable IMAGE\_INSTALL:append = " setup-nv-boot-control" , I do not have the command available … meaning the install did not take place.  
Debugging this:

```bash
root@jetson-agx-xavier-devkit:/# setup-nv-boot-control
ERR: cannot store EFI variable - ESP partition not mounted
ERR: cannot store EFI variable - ESP partition not mounted
/usr/bin/setup-nv-boot-control: line 30: /etc/nv_boot_control.conf: No such file or directory
chmod: cannot operate on dangling symlink '/etc/nv_boot_control.conf'

root@jetson-agx-xavier-devkit:/# tegra-boardspec
2888-400-0004-L.0-1-2

```
