pull/8/head
Bohan Yang 5 years ago
parent 92a2a5fcd1
commit 9c5b44056b
  1. 9
      netboot.sh

@ -47,6 +47,7 @@ power_off=
architecture= architecture=
boot_partition= boot_partition=
dry_run= dry_run=
bbr=
cleartext_password= cleartext_password=
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
@ -167,6 +168,9 @@ while [ $# -gt 0 ]; do
--dry-run) --dry-run)
dry_run=true dry_run=true
;; ;;
--bbr)
bbr=true
;;
*) *)
_err "Illegal option $1" _err "Illegal option $1"
exit 1 exit 1
@ -262,6 +266,7 @@ d-i preseed/early_command string anna-install network-console
EOF EOF
if [ -n "$authorized_keys_url" ]; then if [ -n "$authorized_keys_url" ]; then
_late_command "cd ~$username && mkdir -m 700 .ssh && busybox wget -qO .ssh/authorized_keys $authorized_keys_url" _late_command "cd ~$username && mkdir -m 700 .ssh && busybox wget -qO .ssh/authorized_keys $authorized_keys_url"
_late_command 'sed -ri "s/^#?PasswordAuthentication .+/PasswordAuthentication no/" /etc/ssh/sshd_config'
$save_preseed << EOF $save_preseed << EOF
d-i network-console/password-disabled boolean true d-i network-console/password-disabled boolean true
d-i network-console/authorized_keys_url string $authorized_keys_url d-i network-console/authorized_keys_url string $authorized_keys_url
@ -477,6 +482,10 @@ $save_preseed << EOF
d-i finish-install/reboot_in_progress note d-i finish-install/reboot_in_progress note
EOF EOF
if [ "$bbr" = true ]; then
_late_command '{ echo "net.core.default_qdisc=fq"; echo "net.ipv4.tcp_congestion_control=bbr"; } > /etc/sysctl.d/bbr.conf'
fi
if [ -n "$late_command" ]; then if [ -n "$late_command" ]; then
echo "d-i preseed/late_command string in-target sh -c '$late_command'" | $save_preseed echo "d-i preseed/late_command string in-target sh -c '$late_command'" | $save_preseed
fi fi

Loading…
Cancel
Save