# Bleeding edge Yocto and raspberry pi 4

**URL:** <https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333>\
**Category:** General Discussions\
**Tags:** honister-cm4-rpi-grub\
**Created:** [November 25, 2021, 10:00am UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333 "2021-11-25T10:00:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![eadan](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@eadan](https://hub.mender.io/u/eadan)\
**Post date:** [November 25, 2021, 10:00am UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333/1 "2021-11-25T10:00:30Z")

</div>

Due to the requirements of some very recent software packages we are building our system using Yocto master. Even Mender master does not seem to have the changes re override syntax introduced with Honister. I found mention on the on the Arm Research SMARTER site re them using a local repo for Mender with the related changes applied but the repo that they have does not appear to actually have these changes. Is anybody aware of any other existing repos with fixed up Mender? I have had a go at running the later conversion scripts but currently trying to get to the bottom of it causing a circular dependency loop in grub, which seems odd as mender for our target (RPi cm4) is supposed to be using u-boot.

---

<div class="post-metadata">

**Author:** ![eadan](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@eadan](https://hub.mender.io/u/eadan)\
**Post date:** [November 25, 2021, 10:14am UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333/2 "2021-11-25T10:14:46Z")

</div>

I have found some borkage and missing changes from the layer conversion script which is the reason for it trying to use grub still. but still if anybody knows of an already working version of mender anyway do pipe up 🙂

---

<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:** [November 26, 2021, 9:43am UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333/3 "2021-11-26T09:43:10Z")

</div>

Take a look at the [master-next branch](https://github.com/mendersoftware/meta-mender/compare/master...master-next). It’s not maintained currently, but this branch holds some commits that we have collected which will eventually be needed when we move meta-mender to a new stable poky branch, including [the one you need](https://github.com/mendersoftware/meta-mender/commit/96a49db11f7af38339888f0947250be18b3915be). You can try to cherry-pick from there.

---

<div class="post-metadata">

**Author:** ![eadan](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@eadan](https://hub.mender.io/u/eadan)\
**Post date:** [November 30, 2021, 4:33pm UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333/4 "2021-11-30T16:33:43Z")

</div>

Thanks.  
I have made it to the point where the image tries to build but it is failing. One of the errors I’m trying to understand now is saying:

> the basehash value changed from \<hash 1\> to \<hash 2\>. The metadata is not deterministic and th  
> is needs to be fixed.

Having looked into it a bit it would appear something strange is happening.

I have enabled the sigbasedata files as per [yocto - Bitbake: "The metadata is not deterministic and this needs to be fixed" - Stack Overflow](https://stackoverflow.com/questions/48762459/bitbake-the-metadata-is-not-deterministic-and-this-needs-to-be-fixed).

In the **mender-bootimg.bblcass** file the following is used a couple of times to build a path **${WORKDIR}/bootfs.${BB\_CURRENTTASK}/**

**bitbake-diffsigs** shows that the thing that is changing is the string derived from the variable **BB\_CURRENTTASK** , but I don’t understand quite how this can happen.

e.g. under my image stamps dir I have a bunch of different 1.0-r0.do\_image\_bootimg.sigbasedata. files.

In each one the value from **BB\_CURRENTTASK** is something different! I don’t understand how it is anything other than **image\_bootimg** , i.e. the taskname recorded in the log filename.

I have

- image\_tar
- image\_ext3
- image\_bootimg
- image\_wic
- image\_mender
- image
- flush\_pseudodb
- rootfs
- image\_dataimg
- image\_ext4
- rootfs\_wicenv

There is also one or more .sigbasedata files for each of the above which is as I would expect.

Any ideas what might be going on?

---

<div class="post-metadata">

**Author:** ![eadan](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@eadan](https://hub.mender.io/u/eadan)\
**Post date:** [November 30, 2021, 4:43pm UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333/5 "2021-11-30T16:43:17Z")

</div>

Actually it appears that wic-tools unconditionally pulls in grub.

---

<div class="post-metadata">

**Author:** ![eadan](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@eadan](https://hub.mender.io/u/eadan)\
**Post date:** [December 2, 2021, 2:49pm UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333/6 "2021-12-02T14:49:24Z")

</div>

Having slogged away at this a bit more i have an image, and u-boot starts… but it stops and says nothing further at “Starting kernel …”  
I have seen some comments re this and needing to use KERNEL\_IMAGETYPE = “uImage”, however this is not an option as we are using aarch64.

I should add that there are still a load of errors output during the build re things not being deterministic. Also having looked at the content of the BOOT filesystem produced, there is a whole bunch of files and dirs named with random chars that looks like a corrupt filesystem.

---

<div class="post-metadata">

**Author:** ![eadan](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@eadan](https://hub.mender.io/u/eadan)\
**Post date:** [December 2, 2021, 3:28pm UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333/7 "2021-12-02T15:28:24Z")

</div>

ah, wrote it with dd instead of bmaptool and it booted! weird, the sdimg has a .bmap counterpart so assumed it was ok to use bmaptool with it.

---

<div class="post-metadata">

**Author:** ![eadan](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@eadan](https://hub.mender.io/u/eadan)\
**Post date:** [January 6, 2022, 12:50pm UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333/8 "2022-01-06T12:50:01Z")

</div>

For anybody else who might be interested I have this seemingly all working now. [GitHub - mangodan2003/meta-mender: Yocto Project meta layer for the Mender client](https://github.com/mangodan2003/meta-mender)

The only outstanding issue I have atm is re flashing the image with bmaptool which for somereason results in a system that wont boot.

---

<div class="post-metadata">

**Author:** ![eadan](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@eadan](https://hub.mender.io/u/eadan)\
**Post date:** [January 13, 2022, 11:57am UTC](https://hub.mender.io/t/bleeding-edge-yocto-and-raspberry-pi-4/4333/9 "2022-01-13T11:57:16Z")

</div>

The issue with using bmaptool seems to be something to do with the random data that might be on the device in the holes that it doesn’t write too. Maybe u-boot scans this space for non zero values and gets confused by it, just a guess. anyway it can be worked around by zeroing out the first area of the target device with dd. I haven’t experimented much but writing 128MB of zeros resolves the issue.
