From b87ce94baf7efd043d8c261c15c165201beb0996 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Sat, 9 Jan 2021 06:30:39 +0000 Subject: [PATCH] Add grub timeout option --- README.md | 1 + debi.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8279859..556d536 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ This script is written to reinstall a VPS/virtual machine to Debian 10 Buster. * `--boot-partition` Should be used if `/boot` directory is mounted from a dedicated partition like a LVM setup * `--firmware` Load additional [non-free firmwares](https://wiki.debian.org/Firmware#Firmware_during_the_installation) * `--force-efi-extra-removable` [See](https://wiki.debian.org/UEFI#Force_grub-efi_installation_to_the_removable_media_path). **Useful on Oracle Cloud** + * `--grub-timeout 5` How many seconds the GRUB menu shows **before entering the installer** * `--dry-run` Print generated preseed and GRUB entry without downloading the installer and actually saving them ## Presets diff --git a/debi.sh b/debi.sh index 2d219c1..e96d917 100755 --- a/debi.sh +++ b/debi.sh @@ -64,6 +64,7 @@ architecture= boot_directory=/boot/ firmware=false force_efi_extra_removable=false +grub_timeout=5 dry_run=false while [ $# -gt 0 ]; do @@ -228,6 +229,10 @@ while [ $# -gt 0 ]; do --force-efi-extra-removable) force_efi_extra_removable=true ;; + --grub-timeout) + grub_timeout=$2 + shift + ;; --dry-run) dry_run=true ;; @@ -557,9 +562,9 @@ if [ "$dry_run" != true ]; then cd .. mkdir -p /etc/default/grub.d - tee /etc/default/grub.d/zz-debi.cfg 1>&2 << 'EOF' + tee /etc/default/grub.d/zz-debi.cfg 1>&2 << EOF GRUB_DEFAULT=debi -GRUB_TIMEOUT=5 +GRUB_TIMEOUT=$grub_timeout GRUB_TIMEOUT_STYLE=menu EOF