From 9fa93abd39b67a9803ec3d336015f63a82ad8119 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Sat, 7 Nov 2020 15:32:22 +0000 Subject: [PATCH] Update --- README.md | 4 +++- netboot.sh | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c3fca4b..508452b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This script is used to re-install VPS to **Debian 9 (stretch) or 10 (buster)** w ## Usage - sudo sh -c "$(wget -qO- https://github.com/brentybh/debian-netboot/raw/master/netboot.sh)" -- + sudo bash -c "$(wget -qO- https://github.com/brentybh/debian-netboot/raw/master/netboot.sh)" -- ## Available Options @@ -40,6 +40,8 @@ This script is used to re-install VPS to **Debian 9 (stretch) or 10 (buster)** w - `--disk` - `--partitioning-method` - `--filesystem ext4` + - `--no-install-recommends` + - `--targeted-initramfs` - `--kernel` Specify another package for kernel image, e.g. `linux-image-cloud-amd64` - `--security-repository http://security.debian.org/debian-security` - `--install` diff --git a/netboot.sh b/netboot.sh index c8cf65a..564b0a1 100755 --- a/netboot.sh +++ b/netboot.sh @@ -50,6 +50,8 @@ dry_run= bbr= cleartext_password= gpt= +initramfs=generic +install_recommends=true while [ $# -gt 0 ]; do case $1 in @@ -175,6 +177,12 @@ while [ $# -gt 0 ]; do --gpt) gpt=true ;; + --targeted-initramfs) + initramfs=targeted + ;; + --no-install-recommends) + install_recommends=false + ;; *) _err "Illegal option $1" exit 1 @@ -432,7 +440,8 @@ $save_preseed << EOF # Base system installation -d-i base-installer/install-recommends boolean false +d-i base-installer/install-recommends boolean $install_recommends +d-i base-installer/initramfs-tools/driver-policy select $initramfs EOF if [ -n "$kernel" ]; then @@ -553,10 +562,10 @@ installer_directory="$boot_directory$installer" $save_grub_cfg << EOF menuentry 'Debian Installer' --id debi { -insmod part_msdos -insmod part_gpt -insmod ext2 -linux $installer_directory/linux$kernel_params -initrd $installer_directory/initrd.gz + insmod part_msdos + insmod part_gpt + insmod ext2 + linux $installer_directory/linux$kernel_params + initrd $installer_directory/initrd.gz } EOF