* u-boot-sifive package currently does not upgrade bootloader on loader1/loader2 partitions.
* there have now been bugs identified, meaning that upgrading u-boot is required to upgrade from v5.8 kernel to v5.11 (i.e. either in-focal, or from focal to hirsute).
* Add maintainer script that identifies if the machine one is running on is unleashed or unamtched, and appropriately upgrades the bootloader on loader1/loader2 partitions.
[Test Plan]
* Boot older unleashed or unmatched image
* Upgrade u-boot-sifive to latest package
* Reboot, and observe on the serial console that u-boot version number is incremented to the latest one.
* Repeat the test twice, once with unleashed board, once with unmatched board
* Upgrade the package under qemu VM and observe no side-effects / no attempts to upgrade anything.
[Where problems could occur]
* It is not possible to atomically upgrade loader1 and loader2 simultaniously.
* A backup of loader1 and loader2 partitions is not stored anywhere.
* Thus in case of errors rollback of older u-boot is not performed.
* However if dd of one or the other partition fails, it is unlikely that one can restore the backup.
[Impact]
* u-boot-sifive package currently does not upgrade bootloader on loader1/loader2 partitions.
* there have now been bugs identified, meaning that upgrading u-boot is required to upgrade from v5.8 kernel to v5.11 (i.e. either in-focal, or from focal to hirsute).
* Add maintainer script that identifies if the machine one is running on is unleashed or unamtched, and appropriately upgrades the bootloader on loader1/loader2 partitions.
[Test Plan]
* Boot older unleashed or unmatched image
* Upgrade u-boot-sifive to latest package
* Reboot, and observe on the serial console that u-boot version number is incremented to the latest one.
* Repeat the test twice, once with unleashed board, once with unmatched board
* Upgrade the package under qemu VM and observe no side-effects / no attempts to upgrade anything.
[Where problems could occur]
* It is not possible to atomically upgrade loader1 and loader2 simultaniously.
* A backup of loader1 and loader2 partitions is not stored anywhere.
* Thus in case of errors rollback of older u-boot is not performed.
* However if dd of one or the other partition fails, it is unlikely that one can restore the backup.