]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: drop "en" prefix from ID_NET_NAME_ONBOARD 12518/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 9 May 2019 10:41:52 +0000 (12:41 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 10 May 2019 08:24:28 +0000 (10:24 +0200)
The comment in udev-builtin-net_id.c (removed in grandparent commit) showed the
property without the prefix. I assume that was always the intent, because it
doesn't make much sense to concatenate anything to an arbitrary user-specified
field.

man/systemd.net-naming-scheme.xml
src/udev/net/naming-scheme.h
src/udev/udev-builtin-net_id.c

index f86ad8d63a9e327e0541a1b68da210ff9c6a0ed6..eb8faad254eb99d903264de2e8823aad3cbdac00 100644 (file)
 
           <para>Support for netdevsim (simulated networking devices) was added. Previously those devices were
           not renamed.</para>
+
+          <para>Previously two-letter interface type prefix was prepended to
+          <varname>ID_NET_LABEL_ONBOARD=</varname>. This is not done anymore.</para>
         </varlistentry>
 
         <para>Note that <constant>latest</constant> may be used to denote the latest scheme known (to this
@@ -336,9 +339,8 @@ ID_NET_NAME_PATH=enp0s31f6
       <title>PCI Ethernet card with firmware index "1"</title>
 
       <programlisting>ID_NET_NAME_ONBOARD=eno1
-ID_NET_NAME_ONBOARD_LABEL=enEthernet Port 1
+ID_NET_NAME_ONBOARD_LABEL=Ethernet Port 1
       </programlisting>
-      <!-- FIXME: nuke the prefix! -->
     </example>
 
     <example>
index f27e1e0d3c35ac7e2980b393bcf7996a73c8a7f8..4061eec99e7cdf8b8ba54ccf15d4302d387c4f59 100644 (file)
@@ -28,12 +28,13 @@ typedef enum NamingSchemeFlags {
         NAMING_ZERO_ACPI_INDEX = 1 << 3, /* Use zero acpi_index field, see d81186ef4f6a888a70f20a1e73a812d6acb9e22f */
         NAMING_ALLOW_RERENAMES = 1 << 4, /* Allow re-renaming of devices, see #9006 */
         NAMING_NETDEVSIM       = 1 << 5, /* Generate names for netdevsim devices, see eaa9d507d85509c8bf727356e3884ec54b0fc646 */
+        NAMING_LABEL_NOPREFIX  = 1 << 6, /* Don't prepend ID_NET_LABEL_ONBOARD with interface type prefix */
 
         /* And now the masks that combine the features above */
         NAMING_V238 = 0,
         NAMING_V239 = NAMING_V238 | NAMING_SR_IOV_V | NAMING_NPAR_ARI,
         NAMING_V240 = NAMING_V239 | NAMING_INFINIBAND | NAMING_ZERO_ACPI_INDEX | NAMING_ALLOW_RERENAMES,
-        NAMING_V243 = NAMING_V240 | NAMING_NETDEVSIM,
+        NAMING_V243 = NAMING_V240 | NAMING_NETDEVSIM | NAMING_LABEL_NOPREFIX,
 
         _NAMING_SCHEME_FLAGS_INVALID = -1,
 } NamingSchemeFlags;
index 8fa8ee3d5a9c7fbd0d0e8980feaf55db28b7c275..c487bc00df23b24606b7eb0615b8d09edd1d2c9d 100644 (file)
@@ -881,7 +881,9 @@ static int builtin_net_id(sd_device *dev, int argc, char *argv[], bool test) {
                         udev_builtin_add_property(dev, test, "ID_NET_NAME_ONBOARD", str);
 
                 if (names.pci_onboard_label &&
-                    snprintf_ok(str, sizeof str, "%s%s", prefix, names.pci_onboard_label))
+                    snprintf_ok(str, sizeof str, "%s%s",
+                                naming_scheme_has(NAMING_LABEL_NOPREFIX) ? "" : prefix,
+                                names.pci_onboard_label))
                         udev_builtin_add_property(dev, test, "ID_NET_LABEL_ONBOARD", str);
 
                 if (names.pci_path[0] &&