3 # Original script by Andreas Teuchert <ant+dl@hsg-kl.de>
4 # Modified by Frédéric Boiteux <fboiteux@calistel.com>
8 PREREQ="blacklist udev"
23 # Boot type in initramfs's config
24 bootconf=$(egrep '^BOOT=' /conf/initramfs.conf | tail -1)
26 # can be superseded by command line (used by Debian-Live's netboot for example)
27 for ARGUMENT in $(cat /proc/cmdline); do
30 NETBOOT="${ARGUMENT#netboot=}"
35 if [ "$bootconf" != "BOOT=nfs" ] && [ "$NETBOOT" = "" ]; then
36 # Not a net boot : nothing to do
40 # we want to do some basic IP
43 # Available Ethernet interfaces ?
44 l_interfaces=$(cd /sys/class/net/ && ls -d eth* 2>/dev/null)
46 if [ $(echo $l_interfaces | wc -w) -lt 2 ]; then
47 # only one interface : no choice
48 echo "DEVICE=$l_interfaces" >> /conf/param.conf
53 echo -n "Looking for a connected Ethernet interface ..."
55 for interface in $l_interfaces; do
56 # ATTR{carrier} is not set if this is not done
57 echo -n " $interface ?"
58 ipconfig -c none -d $interface -t 1 >/dev/null 2>&1
62 for step in 1 2 3 4 5; do
63 for interface in $l_interfaces; do
64 carrier=$(cat /sys/class/net/$interface/carrier \
67 if [ "$carrier" = 1 ]; then
68 echo " found $interface."
69 # inform initrd's init script :
70 echo "DEVICE=$interface" >> /conf/param.conf