Add --interface, --ssh-port; Always allow low-mem

pull/49/head
Bohan Yang 4 years ago
parent 31047a8cb3
commit 82fa85594c
  1. 6
      README.md
  2. 20
      debi.sh

@ -98,6 +98,8 @@ Otherwise, you can run this command to revert all changes made by the script:
## Available Options
* `--interface <string>` Manually select a network interface, e.g. eth1
* `--ethx` Disable *Consistent Network Device Naming* to get interface names like *ethX* back
* `--ip <string>` Disable the auto network config (DHCP) and configure a static IP address, e.g. `10.0.0.2`, `1.2.3.4/24`, `2001:2345:6789:abcd::ef/48`
* `--netmask <string>` e.g. `255.255.255.0`, `ffff:ffff:ffff:ffff::`
* `--gateway <string>` e.g. `10.0.0.1`, `none` if no gateway
@ -135,9 +137,9 @@ Otherwise, you can run this command to revert all changes made by the script:
* `--install 'ca-certificates libpam-systemd'` Install additional APT packages. Space-separated and quoted.
* `--safe-upgrade` **(Default)** `apt upgrade --with-new-pkgs`. [See](https://salsa.debian.org/installer-team/pkgsel/-/blob/master/debian/postinst)
* `--full-upgrade` `apt dist-upgrade`
* `--no-upgrade`
* `--ethx` Disable *Consistent Network Device Naming* to get interface names like *ethX* back
* `--no-upgrade`
* `--bbr` Enable TCP BBR congestion control
* `--ssh-port <integer>` SSH port
* `--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.

@ -195,6 +195,7 @@ has_backports() {
return 1
}
interface=auto
ip=
netmask=
gateway=
@ -227,6 +228,7 @@ install='ca-certificates libpam-systemd'
upgrade=
kernel_params=
bbr=false
ssh_port=
hold=false
power_off=false
architecture=
@ -250,6 +252,10 @@ while [ $# -gt 0 ]; do
ntp=ntp.aliyun.com
security_repository=mirror
;;
--interface)
interface=$2
shift
;;
--ip)
ip=$2
shift
@ -391,6 +397,10 @@ while [ $# -gt 0 ]; do
--bbr)
bbr=true
;;
--ssh-port)
ssh_port=$2
shift
;;
--hold)
hold=true
;;
@ -470,7 +480,7 @@ elif [ "$network_console" = true ] && [ -z "$authorized_keys_url" ]; then
prompt_password "Choose a password for the installer user of the SSH network console: "
fi
$save_preseed << 'EOF'
$save_preseed << EOF
# Localization
d-i debian-installer/language string en
@ -480,7 +490,7 @@ d-i keyboard-configuration/xkb-keymap select us
# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/choose_interface select $interface
EOF
[ -n "$ip" ] && {
@ -609,6 +619,8 @@ EOF
fi
}
[ -n "$ssh_port" ] && configure_sshd Port "$ssh_port"
$save_preseed << EOF
# Clock and time zone setup
@ -804,9 +816,7 @@ EOF
installer_directory="$boot_directory$installer"
# shellcheck disable=SC2034
mem=$(grep ^MemTotal: /proc/meminfo | { read -r x y z; echo "$y"; })
[ $((mem / 1024)) -le 512 ] && kernel_params="$kernel_params lowmem/low=1"
kernel_params="$kernel_params lowmem/low=1"
initrd="$installer_directory/initrd.gz"
[ "$firmware" = true ] && initrd="$initrd $installer_directory/firmware.cpio.gz"

Loading…
Cancel
Save