diff options
| -rwxr-xr-x | remote/rootfs/rootfs-stage31/data/bin/setup_network | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/remote/rootfs/rootfs-stage31/data/bin/setup_network b/remote/rootfs/rootfs-stage31/data/bin/setup_network index f7746c71..79ae0886 100755 --- a/remote/rootfs/rootfs-stage31/data/bin/setup_network +++ b/remote/rootfs/rootfs-stage31/data/bin/setup_network @@ -66,15 +66,20 @@ for LINE in $IP_OUT; do # youdev echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$IFMAC\", ATTR{dev_id}==\"0x0\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"$IFACE\"" >> "${FUTURE_ROOT}/etc/udev/rules.d/70-net-boot-nic-name.rules" # continue... - echo -n "Wait for interface $BRIDGE: " - while true; do - # check linkstate - [ "x$(cat /sys/class/net/${BRIDGE}/operstate)" == "xup" ] && break - # else - echo -n "." - sleep 1 - done - echo "." IFACE="" done +echo -n "Waiting for interface $BRIDGE: " +# Some systems don't have operstate. Seems to be hardware dependent +[ ! -e "/sys/class/net/${BRIDGE}/operstate" ] && sleep 2 +while true; do + # still no operstate? assume up and hope for the best... + [ ! -e "/sys/class/net/${BRIDGE}/operstate" ] && break + # check linkstate + [ "x$(cat "/sys/class/net/${BRIDGE}/operstate")" == "xup" ] && break + # else + echo -n "." + usleep 500000 +done +echo "." + |
