4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
6 if [[ $EUID != 0 ]]; then
7 echo "$0: error: expected to be root."
12 sed 's/^/root:/' $FAI/distro-install-common
/shadow
/community0p |
$ROOTCMD chpasswd
-e
14 # todo, need to set static ip here
15 if ifclass demohost
; then
16 cat > $target/etc
/network
/interfaces
<<EOF
19 iface lo inet loopback
23 source-directory /etc/network/interfaces.d
26 ip6
=$
(getent ahosts
$HOSTNAME |
grep ^
2001.
*RAW|
sed 's/ .*//' ||
:)
27 gateway6
=2001:470:142::1
29 # todo: this needs adjustment per machine
30 internal_ip
=10.0.0.25/16
32 if ip l show dev bond0
&>/dev
/null
; then
33 cat >$target/etc
/network
/interfaces
<<EOF
35 iface lo inet loopback
39 iface eth0 inet manual
44 iface eth1 inet manual
48 iface bond0 inet static
53 pre-up ip link add link bond0 name macvtap-bond0 type macvtap mode bridge
54 # no iptables files exist yet
55 # post-up iptables-restore < /etc/default/iptables ; ip6tables-restore < /etc/default/ip6tables || :
58 iface macvtap-bond0 inet static
61 post-up ip a add $internal_ip broadcast 10.0.255.255 dev macvtap-bond0
65 # I'm not sure ipv6 works well with the macvtap stuff. todo: research.
66 # anyways, other kvm hosts dont have it enabled.
67 if false
&& [[ $ip6 ]]; then
68 cat >>$target/etc
/network
/interfaces
<<EOF
69 iface bond0 inet6 static
70 pre-up echo 0 > /proc/sys/net/ipv6/conf/bond0/accept_dad
78 cat > $target/etc
/network
/interfaces
<<EOF
80 iface lo inet loopback
83 iface eth0 inet static
89 cat >>$target/etc
/network
/interfaces
<<EOF
90 iface eth0 inet6 static
91 pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_dad
100 # previously had an else condition after
101 #elif ifclass VM || ifclass LINODE; then
102 # iface $NIC1 inet manual
103 # iface br0 inet dhcp
107 # however, on t9, on startup, br0, became
108 # rename1 and didn't come up. i dunno why,
109 # but the bridge is for vms that I rarely use,
110 # so not bothering to figure it out.
113 ##### end network setup #####
115 # note: systemd-resolved + ifupdown causes networking.service to fail in t11,
116 # https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1907878
117 systemctl disable systemd-resolved
118 # rm first to remove any symlink
119 rm -f $target/etc
/resolv.conf
121 if ifclass demohost ||
[[ $GATEWAYS != 209.51.188.
* ]]; then
122 cat >$target/etc
/resolv.conf
<<'EOF'
126 cat >$target/etc
/resolv.conf
<<'EOF'
129 nameserver 209.51.188.16
130 nameserver 209.51.188.27