udevadm trigger
udevadm settle
+ [ -n "$ETHDEV_TIMEOUT" ] || ETHDEV_TIMEOUT=15
+ echo "Using timeout of $ETHDEV_TIMEOUT seconds for network configuration."
+
if [ -z "${NETBOOT}" ] && [ -z "${FETCH}" ] && \
[ -z "${HTTPFS}" ] && [ -z "${FTPFS}" ]
then
devlist="$devlist $device"
done
- [ -n "$ETHDEV_TIMEOUT" ] || ETHDEV_TIMEOUT=15
- echo "Using timeout of $ETHDEV_TIMEOUT seconds for network configuration."
-
# this is tricky (and ugly) because ipconfig sometimes just hangs/runs into
# an endless loop; iff execution fails give it two further tries, that's
# why we use '$devlist $devlist $devlist' for the other for loop
done
else
- ipconfig ${DEVICE} | tee /netboot.config
- fi
-
- # source relevant ipconfig output
- OLDHOSTNAME=${HOSTNAME}
- . /tmp/net-${DEVICE}.conf
- [ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
- export HOSTNAME
-
- if [ -n "${DEVICE}" ]
- then
- HWADDR="$(cat /sys/class/net/${DEVICE}/address)"
+ for interface in ${DEVICE}; do
+ ipconfig -t "$ETHDEV_TIMEOUT" ${interface} | tee /netboot-${interface}.config
+ [ -e /tmp/net-${interface}.conf ] && . /tmp/net-${interface}.conf
+ if [ "$IPV4ADDR" != "0.0.0.0" ]
+ then
+ break
+ fi
+ done
fi
- if [ ! -e "/etc/resolv.conf" ]
- then
- echo "Creating /etc/resolv.conf"
+ for interface in ${DEVICE}; do
+ # source relevant ipconfig output
+ OLDHOSTNAME=${HOSTNAME}
+ [ -e /tmp/net-${interface}.conf ] && . /tmp/net-${interface}.conf
+ [ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
+ export HOSTNAME
- if [ -n "${DNSDOMAIN}" ]
+ if [ -n "${interface}" ]
then
- echo "domain ${DNSDOMAIN}" > /etc/resolv.conf
- echo "search ${DNSDOMAIN}" > /etc/resolv.conf
+ HWADDR="$(cat /sys/class/net/${interface}/address)"
fi
- for i in ${IPV4DNS0} ${IPV4DNS1} ${IPV4DNS1}
- do
- echo "nameserver $i" >> /etc/resolv.conf
- done
- fi
+ if [ ! -e "/etc/resolv.conf" ]
+ then
+ echo "Creating /etc/resolv.conf"
- # Check if we have a network device at all
- if ! ls /sys/class/net/"$DEVICE" > /dev/null 2>&1 && \
- ! ls /sys/class/net/eth0 > /dev/null 2>&1 && \
- ! ls /sys/class/net/wlan0 > /dev/null 2>&1 && \
- ! ls /sys/class/net/ath0 > /dev/null 2>&1 && \
- ! ls /sys/class/net/ra0 > /dev/null 2>&1
- then
- panic "No supported network device found, maybe a non-mainline driver is required."
- fi
+ if [ -n "${DNSDOMAIN}" ]
+ then
+ echo "domain ${DNSDOMAIN}" > /etc/resolv.conf
+ echo "search ${DNSDOMAIN}" > /etc/resolv.conf
+ fi
+
+ for i in ${IPV4DNS0} ${IPV4DNS1} ${IPV4DNS1}
+ do
+ echo "nameserver $i" >> /etc/resolv.conf
+ done
+ fi
+
+ # Check if we have a network device at all
+ if ! ls /sys/class/net/"$interface" > /dev/null 2>&1 && \
+ ! ls /sys/class/net/eth0 > /dev/null 2>&1 && \
+ ! ls /sys/class/net/wlan0 > /dev/null 2>&1 && \
+ ! ls /sys/class/net/ath0 > /dev/null 2>&1 && \
+ ! ls /sys/class/net/ra0 > /dev/null 2>&1
+ then
+ panic "No supported network device found, maybe a non-mainline driver is required."
+ fi
+ done
}
do_netmount()
mount --move /live/image /root/live/image
fi
+ # aufs2 in kernel versions around 2.6.33 has a regression:
+ # directories can't be accessed when read for the first the time,
+ # causing a failure for example when accessing /var/lib/fai
+ # when booting FAI, this simple workaround solves it
+ ls /root/* >/dev/null 2>&1
+
maybe_break live-bottom
log_begin_msg "Running /scripts/live-bottom\n"