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.
22 # Some example I read had stp on, but i don't need stp,
23 # and it causes a vm to fail pxe boot, presumably unless
25 # http://wiki.libvirt.org/page/PXE_boot_%28or_dhcp%29_on_guest_failed
32 elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
34 [ -n "$IPADDR" ] && cat > $target/etc
/network
/interfaces
<<-EOF
37 iface lo inet loopback
38 iface $NIC1 inet static
43 hwaddress ether $(cat /sys/class/net/$NIC1/address)
45 [ -n "$NETWORK" ] && echo "localnet $NETWORK" > $target/etc
/networks
46 if [ ! -L $target/etc
/resolv.conf
-a -e /etc
/resolv.conf
]; then
47 cp -p /etc
/resolv.conf
$target/etc
51 # here fcopy is mostly used, when installing a client for running in a
52 # different subnet than during the installation
53 fcopy
-iM /etc
/resolv.conf
54 fcopy
-iM /etc
/network
/interfaces
/etc
/networks