diff options
| author | tranch <tranch.xiao@gmail.com> | 2026-07-27 13:34:03 +0800 |
|---|---|---|
| committer | tranch <tranch.xiao@gmail.com> | 2026-07-27 23:15:09 +0800 |
| commit | 3a066cbf78aabf2e2e013e5a9a911ba7f37eed27 (patch) | |
| tree | 8507d406e10c7d08130bd7cc2b51ca2efadc3720 | |
| parent | cb945b45e3df17e9cb9749f0ca70457dd20f5709 (diff) | |
| download | AeroCore-OS-3a066cbf78aabf2e2e013e5a9a911ba7f37eed27.tar.gz AeroCore-OS-3a066cbf78aabf2e2e013e5a9a911ba7f37eed27.zip | |
Preserve GRUB selection timeout
Hide the target GRUB menu through menu_auto_hide while keeping the
image-provided timeout. This leaves users time to choose rollback or
other boot entries when they explicitly reveal the menu.
Verified with bash -n and git diff --check.
| -rwxr-xr-x | installer/configure-target-grub.sh | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/installer/configure-target-grub.sh b/installer/configure-target-grub.sh index 2f16692..a0aa756 100755 --- a/installer/configure-target-grub.sh +++ b/installer/configure-target-grub.sh @@ -9,15 +9,6 @@ if [[ ! -d "${target_root}/etc" || ! -d "${target_root}/usr" ]]; then exit 1 fi -grub_defaults="${target_root}/etc/default/grub" -mkdir -p "$(dirname "${grub_defaults}")" - -if [[ -f "${grub_defaults}" ]] && grep -q '^GRUB_TIMEOUT=' "${grub_defaults}"; then - sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=0/' "${grub_defaults}" -else - printf 'GRUB_TIMEOUT=0\n' >> "${grub_defaults}" -fi - grub_editenv="" for candidate in \ "${target_root}/usr/bin/grub2-editenv" \ @@ -86,4 +77,6 @@ fi chroot "${target_root}" "${grub_mkconfig}" -o "${grub_config}" -echo "Configured target GRUB: GRUB_TIMEOUT=0, menu_auto_hide=1, ${grub_config}" +# Preserve the target image's GRUB timeout so users have time to choose an +# entry after explicitly showing the otherwise hidden menu. +echo "Configured target GRUB: menu_auto_hide=1, ${grub_config}" |
