mirror of
https://github.com/systemd/systemd.git
synced 2025-03-28 02:50:16 +03:00
udev: drop "en" prefix from ID_NET_NAME_ONBOARD
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.
This commit is contained in:
parent
4c27f691a5
commit
8c053c83ae
@ -309,6 +309,9 @@
|
||||
|
||||
<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>
|
||||
|
@ -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;
|
||||
|
@ -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] &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user