浏览代码

Add hold option

Bohan Yang 5 年之前
父节点
当前提交
778db65b3a
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 1 0
      README.md
  2. 6 1
      debi.sh

+ 1 - 0
README.md

@@ -66,6 +66,7 @@ This script is written to reinstall a VPS/virtual machine to Debian 10 Buster.
  * `--no-upgrade` 
  * `--eth` Disable *Consistent Network Device Naming* to get `eth0`, `eth1`, etc. back
  * `--bbr` Enable TCP BBR congestion control
+ * `--hold` Don't reboot or power off after installation
  * `--power-off` Power off after installation rather than reboot
  * `--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

+ 6 - 1
debi.sh

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