From: Pawel Wieczorkiewicz Date: Tue, 8 Apr 2014 06:50:55 +0000 (+0200) Subject: 40network: Fix race condition when wait for networks X-Git-Tag: 047~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0094476fd889b27b391e063f456bf8683670bf0;p=thirdparty%2Fdracut.git 40network: Fix race condition when wait for networks If no network related params are specific, but rd.neednet=1 is set, the default initqueue action is to wait until one of the network interfaces is marked as setup properly. This also help with initqueue's race condition when the network interface shows up late References: bnc#866771 Signed-off-by: Hannes Reinecke --- diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh index 5ba08825b..e6035e5e4 100755 --- a/modules.d/40network/net-genrules.sh +++ b/modules.d/40network/net-genrules.sh @@ -105,6 +105,9 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh cond='ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}!="wlan|wwan"' # if you change the name of "91-default-net.rules", also change modules.d/80cms/cmssetup.sh echo "$cond, $runcmd" > /etc/udev/rules.d/91-default-net.rules + if [ "$NEEDNET" = "1" ]; then + echo 'for i in /tmp/net.*.did-setup; do [ -f "$i" ] && exit 0; done; exit 1' >$hookdir/initqueue/finished/wait-network.sh + fi fi # if you change the name of "90-net.rules", also change modules.d/80cms/cmssetup.sh