mirror of
https://github.com/bohanyang/debi.git
synced 2026-09-27 06:26:15 +00:00
Add --interface, --ssh-port; Always allow low-mem
This commit is contained in:
@@ -98,6 +98,8 @@ Otherwise, you can run this command to revert all changes made by the script:
|
|||||||
|
|
||||||
## Available Options
|
## 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`
|
* `--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::`
|
* `--netmask <string>` e.g. `255.255.255.0`, `ffff:ffff:ffff:ffff::`
|
||||||
* `--gateway <string>` e.g. `10.0.0.1`, `none` if no gateway
|
* `--gateway <string>` e.g. `10.0.0.1`, `none` if no gateway
|
||||||
@@ -136,8 +138,8 @@ Otherwise, you can run this command to revert all changes made by the script:
|
|||||||
* `--safe-upgrade` **(Default)** `apt upgrade --with-new-pkgs`. [See](https://salsa.debian.org/installer-team/pkgsel/-/blob/master/debian/postinst)
|
* `--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`
|
* `--full-upgrade` `apt dist-upgrade`
|
||||||
* `--no-upgrade`
|
* `--no-upgrade`
|
||||||
* `--ethx` Disable *Consistent Network Device Naming* to get interface names like *ethX* back
|
|
||||||
* `--bbr` Enable TCP BBR congestion control
|
* `--bbr` Enable TCP BBR congestion control
|
||||||
|
* `--ssh-port <integer>` SSH port
|
||||||
* `--hold` Don't reboot or power off after installation
|
* `--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.
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ has_backports() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface=auto
|
||||||
ip=
|
ip=
|
||||||
netmask=
|
netmask=
|
||||||
gateway=
|
gateway=
|
||||||
@@ -227,6 +228,7 @@ install='ca-certificates libpam-systemd'
|
|||||||
upgrade=
|
upgrade=
|
||||||
kernel_params=
|
kernel_params=
|
||||||
bbr=false
|
bbr=false
|
||||||
|
ssh_port=
|
||||||
hold=false
|
hold=false
|
||||||
power_off=false
|
power_off=false
|
||||||
architecture=
|
architecture=
|
||||||
@@ -250,6 +252,10 @@ while [ $# -gt 0 ]; do
|
|||||||
ntp=ntp.aliyun.com
|
ntp=ntp.aliyun.com
|
||||||
security_repository=mirror
|
security_repository=mirror
|
||||||
;;
|
;;
|
||||||
|
--interface)
|
||||||
|
interface=$2
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--ip)
|
--ip)
|
||||||
ip=$2
|
ip=$2
|
||||||
shift
|
shift
|
||||||
@@ -391,6 +397,10 @@ while [ $# -gt 0 ]; do
|
|||||||
--bbr)
|
--bbr)
|
||||||
bbr=true
|
bbr=true
|
||||||
;;
|
;;
|
||||||
|
--ssh-port)
|
||||||
|
ssh_port=$2
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--hold)
|
--hold)
|
||||||
hold=true
|
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: "
|
prompt_password "Choose a password for the installer user of the SSH network console: "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$save_preseed << 'EOF'
|
$save_preseed << EOF
|
||||||
# Localization
|
# Localization
|
||||||
|
|
||||||
d-i debian-installer/language string en
|
d-i debian-installer/language string en
|
||||||
@@ -480,7 +490,7 @@ d-i keyboard-configuration/xkb-keymap select us
|
|||||||
|
|
||||||
# Network configuration
|
# Network configuration
|
||||||
|
|
||||||
d-i netcfg/choose_interface select auto
|
d-i netcfg/choose_interface select $interface
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
[ -n "$ip" ] && {
|
[ -n "$ip" ] && {
|
||||||
@@ -609,6 +619,8 @@ EOF
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ -n "$ssh_port" ] && configure_sshd Port "$ssh_port"
|
||||||
|
|
||||||
$save_preseed << EOF
|
$save_preseed << EOF
|
||||||
|
|
||||||
# Clock and time zone setup
|
# Clock and time zone setup
|
||||||
@@ -804,9 +816,7 @@ EOF
|
|||||||
|
|
||||||
installer_directory="$boot_directory$installer"
|
installer_directory="$boot_directory$installer"
|
||||||
|
|
||||||
# shellcheck disable=SC2034
|
kernel_params="$kernel_params lowmem/low=1"
|
||||||
mem=$(grep ^MemTotal: /proc/meminfo | { read -r x y z; echo "$y"; })
|
|
||||||
[ $((mem / 1024)) -le 512 ] && kernel_params="$kernel_params lowmem/low=1"
|
|
||||||
|
|
||||||
initrd="$installer_directory/initrd.gz"
|
initrd="$installer_directory/initrd.gz"
|
||||||
[ "$firmware" = true ] && initrd="$initrd $installer_directory/firmware.cpio.gz"
|
[ "$firmware" = true ] && initrd="$initrd $installer_directory/firmware.cpio.gz"
|
||||||
|
|||||||
Reference in New Issue
Block a user