diff options
author | Tom Gundersen <teg@jklm.no> | 2013-03-17 13:23:33 +0900 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2013-03-18 18:28:59 +0100 |
commit | 0cf2d0d023389957f57175c9cfb6aba56c0df343 (patch) | |
tree | 9a4cc1803088e53006408b5414c133ed0543fe2f | |
parent | 6ec0ac43bb1f9f8b8b435ba6e5d55dc7cc84c3c6 (diff) |
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.
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | man/systemd-udevd.service.xml | 8 | ||||
-rw-r--r-- | rules/80-net-name-slot.rules | 5 |
3 files changed, 13 insertions, 2 deletions
@@ -28,8 +28,6 @@ Fedora 19: * cgroup attrs: - update dbus interface docs in wiki -* kernel cmdline switch to turn off predictable network interface names - * journal is not closed properly at shutdown when run in a container? * localed: diff --git a/man/systemd-udevd.service.xml b/man/systemd-udevd.service.xml index 35e254384e..18734eed1d 100644 --- a/man/systemd-udevd.service.xml +++ b/man/systemd-udevd.service.xml @@ -154,6 +154,14 @@ non-working kernel modules.</para> </listitem> </varlistentry> + <varlistentry> + <term><varname>net.predictable-names=</varname></term> + <term><varname>rd.net.predictable-names=</varname></term> + <listitem> + <para>Rename network interfaces to give them predictable names + when possible. Defaults to 1.</para> + </listitem> + </varlistentry> </variablelist> </refsect1> 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}" |