U-BOOT + Debian Family?

Hi everyone !

We are testing Mender Enterprise for our embedded solution, with the following use case:

  • U-BOOT + Debian (bookworm)
  • embedded devices, u-boot+debian is the OEM choice, x86 and aarch64. We can re-generate images and customize them, though.

Reading along the Mender documentation, it seems that U-Boot is generally supported, although, I have only read about u-boot on the Yocto part of the documentation.

We are trying to figure out:

  1. Is U-boot + Debian a supported scenario by Mender ?

  2. Is there a documentation for such scenario ? (i could only find this yocto page as current guideline)

  3. Will there be Debian-oriented patching tools for debian replicating those in meta-mender ?

Thank you very much in advance,
Wishing you a great day.

Hi @fce,

The question is not that much about Debian + U-Boot, it’s more like - is U-Boot available for the device/platform in question?
Our usual recommendation for Debian is using the mender-convert tool as described here. On the Raspberry Pi, for example it injects a patched u-boot binary.

So it is definitely supported, but I don’t think we have a patching guide (yet).

Greets,
Josef

Hi @TheYoctoJester,

thank you for the prompt response.

Ok. We will take an look at the usage of those binaries in order to make a similar u-boot patch, and integrate it in an homogeneous way.

I will report back here.

Thank you.
Have a nice week-end,

If you do not want to patch U-Boot there is also the possibility of adding the bootcount logic using scripting. To get the U-Boot glue updated when updating the kernel using a Debian package you can use some hook scripts.

2 Likes

Hi @TheYoctoJester and @lueschem,

Reporting back on the current evolution on the topic.

After investigating the scenario, we are currently in this situation:

  1. Yes @TheYoctoJester , to answer to your question, our board was, fortunately, supported by upstream u-boot.
  2. So, what we were missing was the mender boot partition switch logic, which we investigated looking at how it was done in meta-mender and the RPI custom u-boot provided by mender.
  3. In the end, we are currently using a solution just as @lueschem suggested. Carrying with us a boot script, very very similar to the one posted by @lueschem.

pros:

  • This provided to be a solution that required no forking or patching of u-boot.
  • The script that we ended up with is quite short, and simple, just as the one by @lueschem

cons

  • we had to implemented such script by re-verse engineering the u-boot patch
  • we are concerned, therefore, with the fact that it is now up to us to guarantee that such script keeps being in line and in sync with mender’s update logic, both in terms of algorithm, and even the exact name of u-boot variables, which are set by the client through fw_setenv.
  • we will have, yet, to thoroughly test the rollback logic with our script, still.

proposal:

@TheYoctoJester Could Mender provide an official boot script in the mender-convert github repo, or a section of boot-script with the main boot switch algorithm ?
Such script could be just the extraction in a text file of the u-boot functions that are already written in the u-boot patches by meta-mender.

In such way we would know that those officially work, and could better follow eventual modifications.

Thank you in advance,

Have a nice day,

Hi @fce,

Thanks a lot for the elaborate and detailed answer. Glad to hear that things are working well for you, and thanks @lueschem for the thought kickstart :slight_smile:

If I understood your post correctly, there are effectively two action points. Should I have missed something, please kick me (virtually).

  1. the request to document a complete view of the A/B logic, possibly using the u-boot start script. This is a good idea! I thought a bit about it, and indeed, the bits to understand it fully are scattered across three different locations as far as I can tell right now. I‘ll try to assemble something better here tomorrow.
  2. Using the RPi-style boot mechanism to do the A/B switching. This one I looked a bit into, and it did not immediately strike me as easy to merge with the Mender approach. We have talked about it, and definitely want to go for it. However the required effort to really make it upstream and production is not fully known, and as it does not provide any immediate value, also not very high on the priority list. If somebody makes a proposal on how a community contributed incarnation could look for it, and where it could be located, I‘m all ears on helping it. But I don‘t have a good grip on it right now, sorry.

Hope this help further undersanding, and if you have an idea on how to proceed, let me know!

Greetz,
Josef

Hi @TheYoctoJester,

Thank you for your response. I will retrieve the information and will be back to you.