summaryrefslogtreecommitdiff
path: root/installer/configure-target-grub.sh
diff options
context:
space:
mode:
authortranch <tranch.xiao@gmail.com>2026-07-27 13:34:03 +0800
committertranch <tranch.xiao@gmail.com>2026-07-27 23:15:09 +0800
commit9c04096ab5fd8457e485b3069f0235f0de7ea2b6 (patch)
tree8507d406e10c7d08130bd7cc2b51ca2efadc3720 /installer/configure-target-grub.sh
parentfbe898492cec0f2601ea0cbff2134380d119a3c1 (diff)
downloadAeroCore-OS-9c04096ab5fd8457e485b3069f0235f0de7ea2b6.tar.gz
AeroCore-OS-9c04096ab5fd8457e485b3069f0235f0de7ea2b6.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.
Diffstat (limited to 'installer/configure-target-grub.sh')
-rwxr-xr-xinstaller/configure-target-grub.sh13
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}"