X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FIANK%2F11-iank;h=ce0be4b5321fa9064258184a96c7b2eb3c409e9b;hb=HEAD;hp=54641b237bcc10b15b30b90bb0f8b662253f8609;hpb=a03d1a5cf4c6583c075a5b80e729f8f72ed0d338;p=automated-distro-installer diff --git a/fai/config/scripts/IANK/11-iank b/fai/config/scripts/IANK/11-iank index 54641b2..25c0503 100755 --- a/fai/config/scripts/IANK/11-iank +++ b/fai/config/scripts/IANK/11-iank @@ -24,6 +24,9 @@ if [[ $EUID != 0 ]]; then exit 1 fi +# ignore this line. hack to make shellcheck ignore $target +if [[ ! $target ]]; then target=; fi + if ! type -t fcopy &>/dev/null; then sudo apt-get -y install fai-client fi @@ -166,14 +169,32 @@ EOF fi # use networkmanager if this host has wireless. -if [[ $(iw dev) ]]; then +if [[ $(iw dev) || $HOSTNAME == so ]]; then $ROOTCMD bash -xe <$target/etc/NetworkManager/conf.d/10-globally-managed-devices.conf <<'EOF' +[device*] +managed=1 +EOF # in a default desktop install, it looks like netplan creates this file under # run/NetworkManager/conf.d in early boot. @@ -185,12 +206,17 @@ EOF dns=systemd-resolved EOF - $FAI/distro-install-common/ethusb-static - if [[ $(dig +short @10.2.0.1 -x 10.2.0.2 2>&1 ||:) == kd.b8.nz. ]] \ + + if [[ ! $FAI_WRAPPER || $SSH_CLIENT ]]; then + # for running from fai or remote connections, don't kill the internet + ethusb_arg=-c + fi + if [[ $(timeout 1 dig +short @10.2.0.1 -x 10.2.0.2 2>&1 ||:) == kd.b8.nz. ]] \ && ip n show 10.2.0.1 | grep . &>/dev/null; then - : # we are at home. note: logic duplicated in btrbk-run + # we are at_home + $FAI/distro-install-common/ethusb-static $ethusb_arg else - $FAI/distro-install-common/ethusb-nm + $FAI/distro-install-common/ethusb-static off $ethusb_arg fi @@ -222,6 +248,7 @@ fi if ifclass LINODE; then mkdir -p $target/etc/initramfs-tools/conf.d + # shellcheck disable=SC2154 # comes with LINODE environment cat >$target/etc/initramfs-tools/conf.d/mine <&1 | grep -Fx "Status: install ok installed" &>/dev/null; then + apt-get -y install wget + wget -O /target/tmp/x.deb https://linux-libre.fsfla.org/pub/linux-libre/freesh/pool/main/f/freesh-archive-keyring/freesh-archive-keyring_1.1_all.deb + $ROOTCMD dpkg -i /tmp/x.deb + $ROOTCMD apt-get update + $ROOTCMD apt-get -y install linux-libre + fi ;; esac