From c3f9da77a4649f3132a304becf201af9520f86e7 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 8 Jan 2014 19:20:46 +0100 Subject: [rfs-stage31] Don't wait for br0 up if /sys/.../operstate doesn't exist This has been observed on one client machine when building on openSUSE 12.3 When operstate is not there we sleep for two seconds and try again, if it's still nonexistent we just assume the link is up since we can't do much anyways. --- .../rootfs/rootfs-stage31/data/bin/setup_network | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'remote') 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 "." + -- cgit v1.2.3-55-g7522