Bootloader upgrade process

amalle
Mon, 09 Sep 2024 14:19:09 +0000
General Discussions

Hi,

I am in the process of upgrading from zeus to kirkstone.
My new image now works correctly when installing it from scratch on a device, even mender updades from new versions are good.
But I have devices in the wild with the old zeus version and the old bootloader build (u-boot) is not compatible with the new version of the image.

The process of update seams simple :

Create a zeus image that we can mender update with the bootloader (lets call this version AA)

Pack the new bootloader (compatible with zeus images) and upgrade the bootloader creating an intermediate version (lets call it version BA)

Upgrade the rootfs to the new kirkstone image giving us BB the image we wanted all allong

However, I can’t figure out how to upgrade the bootloader.

My approach :
Install from scratch version BA (or version BB) and create a binary of the bootloader :

dd if=/dev/mmcblk2boot0 of=backup_mmcblk2boot0.bin
dd if=/dev/mmcblk2boot1 of=backup_mmcblk2boot1.bin

On a AA version overide the bootloader with the BA one :

echo 0 > /sys/block/mmcblk2boot0/force_ro
dd if=backup_mmcblk2boot0.bin of=/dev/mmcblk2boot0
sync
echo 1 > /sys/block/mmcblk2boot0/force_ro
echo 0 > /sys/block/mmcblk2boot1/force_ro
dd if=backup_mmcblk2boot1.bin of=/dev/mmcblk2boot1 bs=128
sync
echo 1 > /sys/block/mmcblk2boot1/force_ro
reboot

My results :
When booting u-boot logs show the new version

U-Boot 2022.04-lf_v2022.04+g333abc82094 (Sep 06 2024 - 08:27:05 +0000)

It’s actually not the new version, the rest of the logs like mmcboot command logs don’t mach the new version…

I have a bunch more logs and informations. I’ll keep it short to start with.

What I’m I missing ?
Thanks

9 posts - 2 participants