Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boot counting #24

Merged
merged 2 commits into from
Jul 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Makefile.util.def
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,14 @@ script = {
};

script = {
name = '00_menu_auto_hide';
common = util/grub.d/00_menu_auto_hide.in;
name = '01_fallback_counting';
common = util/grub.d/01_fallback_counting.in;
installdir = grubconf;
};

script = {
name = '01_menu_auto_hide';
common = util/grub.d/01_menu_auto_hide.in;
installdir = grubconf;
};

Expand Down
12 changes: 12 additions & 0 deletions util/grub.d/01_fallback_counting.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /bin/sh -e

# Boot Counting
if [ "\${boot_counter}" -a "\${boot_success}" = "0"]; then
if [ "\${boot_counter}" = "0" -o "\${boot_counter}" = "-1" ]; then
set default=1
set boot_counter=-1
else
set boot_counter=$((\${boot_counter}-1))
fi
save_env boot_counter
fi
File renamed without changes.