From d681df8e5f341a6179c545b7f27c8106d543e2e1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 10 Sep 2013 10:48:18 +0200 Subject: [PATCH] network/net-genrules.sh: react also on NAME Recent systemd-udevd network renaming rules work on NAME. Also enqueue only one unique initqueue job. --- modules.d/40network/net-genrules.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh index 31cd1e67..c4def61b 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"'