From 9c04096ab5fd8457e485b3069f0235f0de7ea2b6 Mon Sep 17 00:00:00 2001 From: tranch Date: Mon, 27 Jul 2026 13:34:03 +0800 Subject: 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. --- installer/configure-target-grub.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'installer') 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}" -- cgit v1.2.3