Skip to content

Commit

Permalink
grub2: Import greenboot configs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Oct 6, 2023
1 parent bc4b6eb commit c523463
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/grub2/grub-static-greenboot.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# greenboot support, aka boot counter and boot success reporting
insmod increment
# Check if boot_counter exists and boot_success=0 to activate this behaviour.
if [ -n "${boot_counter}" -a "${boot_success}" = "0" ]; then
# if countdown has ended, choose to boot rollback deployment,
# i.e. default=1 on OSTree-based systems.
if [ "${boot_counter}" = "0" -o "${boot_counter}" = "-1" ]; then
set default=1
set boot_counter=-1
# otherwise decrement boot_counter
else
decrement boot_counter
fi
save_env boot_counter
fi

# Reset boot_success for current boot
set boot_success=0
save_env boot_success

0 comments on commit c523463

Please sign in to comment.