3 # modified from upstream fai example
4 error
=0; trap 'error=$(($?>$error?$?:$error))' ERR
# save maximum error code
6 if ifclass DHCPC
&& [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
9 cat > $target/etc
/network
/interfaces
<<-EOF
12 iface lo inet loopback
16 cat > $target/etc
/network
/interfaces
<<-EOF
19 iface lo inet loopback
20 iface $NIC1 inet manual
21 # make a bridge by default so we can have bridged vms.
29 elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
31 [ -n "$IPADDR" ] && cat > $target/etc
/network
/interfaces
<<-EOF
34 iface lo inet loopback
35 iface $NIC1 inet static
40 hwaddress ether $(cat /sys/class/net/$NIC1/address)
42 [ -n "$NETWORK" ] && echo "localnet $NETWORK" > $target/etc
/networks
43 if [ ! -L $target/etc
/resolv.conf
-a -e /etc
/resolv.conf
]; then
44 cp -p /etc
/resolv.conf
$target/etc
48 # here fcopy is mostly used, when installing a client for running in a
49 # different subnet than during the installation
50 fcopy
-iM /etc
/resolv.conf
51 fcopy
-iM /etc
/network
/interfaces
/etc
/networks