summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2013-03-17 13:23:33 +0900
committerTom Gundersen <teg@jklm.no>2013-03-18 18:28:59 +0100
commit0cf2d0d023389957f57175c9cfb6aba56c0df343 (patch)
tree9a4cc1803088e53006408b5414c133ed0543fe2f /rules
parent6ec0ac43bb1f9f8b8b435ba6e5d55dc7cc84c3c6 (diff)
downloadsystemd-0cf2d0d023389957f57175c9cfb6aba56c0df343.tar.gz
udev: net-name-slot - disable by kernel command line switch
The properties will still be set in the udev database, but they will not be used for setting the interface names. As for the other kernel commandline switches, we allow it to be prefixed by 'rd.' to only apply in the initrd.
Diffstat (limited to 'rules')
-rw-r--r--rules/80-net-name-slot.rules5
1 files changed, 5 insertions, 0 deletions
diff --git a/rules/80-net-name-slot.rules b/rules/80-net-name-slot.rules
index 2834e82dbf..e83eb3ff5f 100644
--- a/rules/80-net-name-slot.rules
+++ b/rules/80-net-name-slot.rules
@@ -4,6 +4,11 @@ ACTION=="remove", GOTO="net_name_slot_end"
SUBSYSTEM!="net", GOTO="net_name_slot_end"
NAME!="", GOTO="net_name_slot_end"
+IMPORT{cmdline}="net.predictable-names"
+ENV{net.predictable-names}=="0", GOTO="net_name_slot_end"
+IMPORT{cmdline}="rd.net.predictable-names"
+ENV{rd.net.predictable-names}=="0", TEST=="/etc/initrd-release", 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}"