Set the default uboot bootcounter
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