From 4c3a36ec411e159be15eee1b79a87b4c0d6878a3 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Mon, 9 Nov 2020 04:17:51 +0000 Subject: [PATCH] Auto config EFI --- README.md | 2 ++ netboot.sh | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8478ed3..2622a99 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,9 @@ This script is used to re-install VPS to **Debian 9 (stretch) or 10 (buster)** w - `--skip-partitioning` - `--partitioning-method regular` - `--disk` + - `--mbr` - `--gpt` + - `--bios` - `--efi` - `--filesystem ext4` - `--kernel` Choose an package for the kernel image diff --git a/netboot.sh b/netboot.sh index 94ba9b1..c295e32 100755 --- a/netboot.sh +++ b/netboot.sh @@ -45,8 +45,8 @@ ntp=0.debian.pool.ntp.org skip_partitioning=false partitioning_method=regular disk= -gpt=false -efi=false +gpt=true +efi= filesystem=ext4 kernel= install_recommends=true @@ -161,9 +161,15 @@ while [ $# -gt 0 ]; do disk=$2 shift ;; + --mbr) + gpt=false + ;; --gpt) gpt=true ;; + --bios) + efi=false + ;; --efi) efi=true ;; @@ -403,6 +409,8 @@ EOF echo "d-i partman/default_filesystem string $filesystem" | $save_preseed + [ -z "$efi" ] && efi=false && [ -d /sys/firmware/efi ] && efi=true + $save_preseed << 'EOF' d-i partman-auto/expert_recipe string \ naive :: \