Skip to content

Set the default uboot bootcounter

Denis Pynkin requested to merge wip/d4s/T7483_bootcounter into apertis/v2022dev0

The rollback mechanism in Apertis relies on the /boot/uboot.cnt to keep track of the failed boots. After 3 failed boots in a row it triggers U-Boot rollback using the altbootcmd mechanism. Since the rollback is only meaningful on the OSTree-based images, on the APT-based images the reset-uboot-bootcount.conf configuration causes uboot.cnt to be reset at every boot. However, if we do not let the boot process proceed enough for systemd-tmpfiles-setup to run, the uboot.cnt is not truncated and on the third run we get a rollback that breaks everything since on the APT images there's no extlinux/extlinux-rollback.conf rollback boot configuration to use.

Remove reset-uboot-bootcount.conf rule and add pre-generated file uboot.cnt instead to fix the issue described above:

echo "bd01 0000" | xxd -r -p - > uboot.cnt

generates the bootcounter file with "upgrade" flag unset to disable U-Boot's rollback/bootcounter mechanism.

Signed-off-by: Denis Pynkin denis.pynkin@collabora.com

Merge request reports

Loading