chiark / gitweb /
udev: net-name-slot - disable by kernel command line switch
authorTom Gundersen <teg@jklm.no>
Sun, 17 Mar 2013 04:23:33 +0000 (13:23 +0900)
committerTom Gundersen <teg@jklm.no>
Mon, 18 Mar 2013 17:28:59 +0000 (18:28 +0100)
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.

TODO
man/systemd-udevd.service.xml
rules/80-net-name-slot.rules

diff --git a/TODO b/TODO
index fcc34712787343e6fcec133d129aa4c08c5a6ca9..c73e8dc9804089a5c50104a51ba3bdac63f69a79 100644 (file)
--- a/TODO
+++ b/TODO
@@ -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:
index 35e254384ef8c2fd8e85b5029db5ece4d9b1e23d..18734eed1dbe8728781a22f48c2c3895d874f9b2 100644 (file)
           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>
 
index 2834e82dbfab26a58aa675818988aaeec81f6ef6..e83eb3ff5fb6bea57dd0d823fa53c8b1201e3f68 100644 (file)
@@ -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}"