diff options
| author | Simon Rettberg | 2014-01-08 19:20:46 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2014-01-08 19:20:46 +0100 |
| commit | c3f9da77a4649f3132a304becf201af9520f86e7 (patch) | |
| tree | e84a9f53689780e5a4d00a4e3c0bdeb6dfcadad5 /remote | |
| parent | [vmware] Make sure exit code is 0 (diff) | |
| download | tm-scripts-c3f9da77a4649f3132a304becf201af9520f86e7.tar.gz tm-scripts-c3f9da77a4649f3132a304becf201af9520f86e7.tar.xz tm-scripts-c3f9da77a4649f3132a304becf201af9520f86e7.zip | |
[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.
Diffstat (limited to 'remote')
| -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 "." + |
