network/net-genrules.sh: react also on NAME
Recent systemd-udevd network renaming rules work on NAME. Also enqueue only one unique initqueue job.master
parent
540a5169b9
commit
d681df8e5f
|
|
@ -54,23 +54,30 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||||
ifup='/sbin/ifup $env{INTERFACE}'
|
ifup='/sbin/ifup $env{INTERFACE}'
|
||||||
[ -z "$netroot" ] && ifup="$ifup -m"
|
[ -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
|
# We have some specific interfaces to handle
|
||||||
if [ -n "$IFACES" ]; then
|
if [ -n "$IFACES" ]; then
|
||||||
echo 'SUBSYSTEM!="net", GOTO="net_end"'
|
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
|
for iface in $IFACES; do
|
||||||
case "$iface" in
|
case "$iface" in
|
||||||
??:??:??:??:??:??) # MAC address
|
??:??:??:??:??:??) # MAC address
|
||||||
cond="ATTR{address}==\"$iface\"" ;;
|
cond="ATTR{address}==\"$iface\""
|
||||||
|
echo "$cond, $runcmd, GOTO=\"net_end\""
|
||||||
|
;;
|
||||||
??-??-??-??-??-??) # MAC address in BOOTIF form
|
??-??-??-??-??-??) # 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
|
*) # 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
|
esac
|
||||||
# The GOTO prevents us from trying to ifup the same device twice
|
# The GOTO prevents us from trying to ifup the same device twice
|
||||||
echo "$cond, $runcmd, GOTO=\"net_end\""
|
|
||||||
done
|
done
|
||||||
echo 'LABEL="net_end"'
|
echo 'LABEL="net_end"'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue