From: Harald Hoyer Date: Tue, 10 Sep 2013 08:48:18 +0000 (+0200) Subject: network/net-genrules.sh: react also on NAME X-Git-Tag: 033~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d681df8e5f341a6179c545b7f27c8106d543e2e1;p=thirdparty%2Fdracut.git network/net-genrules.sh: react also on NAME Recent systemd-udevd network renaming rules work on NAME. Also enqueue only one unique initqueue job. --- diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh index 31cd1e675..c4def61b2 100755 --- a/modules.d/40network/net-genrules.sh +++ b/modules.d/40network/net-genrules.sh @@ -54,23 +54,30 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh ifup='/sbin/ifup $env{INTERFACE}' [ -z "$netroot" ] && ifup="$ifup -m" - runcmd="RUN+=\"/sbin/initqueue --onetime $ifup\"" + runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\"" # We have some specific interfaces to handle if [ -n "$IFACES" ]; then echo 'SUBSYSTEM!="net", GOTO="net_end"' - echo 'ACTION=="remove", GOTO="net_end"' + echo 'ACTION!="add|change|move", GOTO="net_end"' for iface in $IFACES; do case "$iface" in ??:??:??:??:??:??) # MAC address - cond="ATTR{address}==\"$iface\"" ;; + cond="ATTR{address}==\"$iface\"" + echo "$cond, $runcmd, GOTO=\"net_end\"" + ;; ??-??-??-??-??-??) # MAC address in BOOTIF form - cond="ATTR{address}==\"$(fix_bootif $iface)\"" ;; + cond="ATTR{address}==\"$(fix_bootif $iface)\"" + echo "$cond, $runcmd, GOTO=\"net_end\"" + ;; *) # an interface name - cond="ENV{INTERFACE}==\"$iface\"" ;; + cond="ENV{INTERFACE}==\"$iface\"" + echo "$cond, $runcmd, GOTO=\"net_end\"" + cond="NAME==\"$iface\"" + echo "$cond, $runcmd, GOTO=\"net_end\"" + ;; esac # The GOTO prevents us from trying to ifup the same device twice - echo "$cond, $runcmd, GOTO=\"net_end\"" done echo 'LABEL="net_end"'