Add hold option

pull/8/head
Bohan Yang 5 years ago committed by GitHub
parent e9f0dc1a97
commit 778db65b3a
  1. 1
      README.md
  2. 7
      debi.sh

@ -66,6 +66,7 @@ This script is written to reinstall a VPS/virtual machine to Debian 10 Buster.
* `--no-upgrade` * `--no-upgrade`
* `--eth` Disable *Consistent Network Device Naming* to get `eth0`, `eth1`, etc. back * `--eth` Disable *Consistent Network Device Naming* to get `eth0`, `eth1`, etc. back
* `--bbr` Enable TCP BBR congestion control * `--bbr` Enable TCP BBR congestion control
* `--hold` Don't reboot or power off after installation
* `--power-off` Power off after installation rather than reboot * `--power-off` Power off after installation rather than reboot
* `--architecture <string>` e.g. `amd64`, `i386`, `arm64`, `armhf`, etc. * `--architecture <string>` e.g. `amd64`, `i386`, `arm64`, `armhf`, etc.
* `--boot-partition` Should be used if `/boot` directory is mounted from a dedicated partition like a LVM setup * `--boot-partition` Should be used if `/boot` directory is mounted from a dedicated partition like a LVM setup

@ -58,6 +58,7 @@ install='ca-certificates libpam-systemd'
upgrade= upgrade=
kernel_params= kernel_params=
bbr=false bbr=false
hold=false
power_off=false power_off=false
architecture= architecture=
boot_directory=/boot/ boot_directory=/boot/
@ -208,6 +209,9 @@ while [ $# -gt 0 ]; do
--bbr) --bbr)
bbr=true bbr=true
;; ;;
--hold)
hold=true
;;
--power-off) --power-off)
power_off=true power_off=true
;; ;;
@ -511,9 +515,10 @@ $save_preseed << 'EOF'
# Finishing up the installation # Finishing up the installation
d-i finish-install/reboot_in_progress note
EOF EOF
[ "$hold" != true ] && echo 'd-i finish-install/reboot_in_progress note' | $save_preseed
[ "$bbr" = true ] && run_later '{ echo "net.core.default_qdisc=fq"; echo "net.ipv4.tcp_congestion_control=bbr"; } > /etc/sysctl.d/bbr.conf' [ "$bbr" = true ] && run_later '{ echo "net.core.default_qdisc=fq"; echo "net.ipv4.tcp_congestion_control=bbr"; } > /etc/sysctl.d/bbr.conf'
[ -n "$late_command" ] && echo "d-i preseed/late_command string in-target bash -c '$late_command'" | $save_preseed [ -n "$late_command" ] && echo "d-i preseed/late_command string in-target bash -c '$late_command'" | $save_preseed

Loading…
Cancel
Save