Fix predictable network interface naming

In current systemd, this has been moved to systemd-network, which
we're not using yet. So revive the old udev rules from systemd 203.
This commit is contained in:
Eelco Dolstra 2014-04-18 19:34:45 +02:00
parent 465d6ff572
commit 232a9caa96
2 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,13 @@
# Copied from systemd 203.
ACTION=="remove", GOTO="net_name_slot_end"
SUBSYSTEM!="net", GOTO="net_name_slot_end"
NAME!="", GOTO="net_name_slot_end"
IMPORT{cmdline}="net.ifnames"
ENV{net.ifnames}=="0", GOTO="net_name_slot_end"
NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}"
NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}"
NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}"
LABEL="net_name_slot_end"

View File

@ -83,8 +83,8 @@ let
grep -l '\(RUN+\|IMPORT{program}\)="\(/usr\)\?/s\?bin' $i/*/udev/rules.d/* || true
done
${optionalString (!config.networking.usePredictableInterfaceNames) ''
ln -s /dev/null $out/80-net-name-slot.rules
${optionalString config.networking.usePredictableInterfaceNames ''
cp ${./80-net-name-slot.rules} $out/80-net-name-slot.rules
''}
# If auto-configuration is disabled, then remove