forked from fedora-iot/greenboot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This pairs with coreos/bootupd#543 to have bootupd support injecting the greenboot grub logic only if greenboot is installed.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# greenboot support, aka boot counter and boot success reporting | ||
# This will be installed via bootupd | ||
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 |