#!/bin/bash -x # This file is part of Ian Kelling's automated-distro-installer # Copyright (C) 2024 Ian Kelling # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR if [[ $EUID != 0 ]]; then echo "$0: error: expected to be root." exit 1 fi sed 's/^/root:/' $FAI/distro-install-common/shadow/community0p | $ROOTCMD chpasswd -e # todo, need to set static ip here if ifclass demohost; then cat > $target/etc/network/interfaces </dev/null; then cat >$target/etc/network/interfaces <>$target/etc/network/interfaces < /proc/sys/net/ipv6/conf/bond0/accept_dad address $ip6 netmask 48 gateway $gateway6 EOF fi else cat > $target/etc/network/interfaces <>$target/etc/network/interfaces < /proc/sys/net/ipv6/conf/eth0/accept_dad address $ip6 netmask 48 gateway $gateway6 EOF fi fi fi # previously had an else condition after #elif ifclass VM || ifclass LINODE; then # iface $NIC1 inet manual # iface br0 inet dhcp # bridge_ports $NIC1 # bridge_stp off # bridge_maxwait 0 # however, on t9, on startup, br0, became # rename1 and didn't come up. i dunno why, # but the bridge is for vms that I rarely use, # so not bothering to figure it out. ##### end network setup ##### # note: systemd-resolved + ifupdown causes networking.service to fail in t11, # https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1907878 systemctl disable systemd-resolved # rm first to remove any symlink rm -f $target/etc/resolv.conf if ifclass demohost || [[ $GATEWAYS != 209.51.188.* ]]; then cat >$target/etc/resolv.conf <<'EOF' nameserver 8.8.8.8 EOF else cat >$target/etc/resolv.conf <<'EOF' domain fsf.org search fsf.org nameserver 209.51.188.16 nameserver 209.51.188.27 EOF fi