Browse Source

Add grub timeout option

Bohan Yang 5 years ago
parent
commit
b87ce94baf
2 changed files with 8 additions and 2 deletions
  1. 1 0
      README.md
  2. 7 2
      debi.sh

+ 1 - 0
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

+ 7 - 2
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