diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2023-12-08 12:33:06 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-12-19 11:15:52 +0100 |
commit | 3b2e7dc5a285edbbb1bf6aed2d88b889d801613f (patch) | |
tree | 3dcda000313d0fb0b09d67fe9ba44150ba0ca270 /rules.d | |
parent | Merge pull request #30491 from fbuihuu/vconsole-handle-kd-grahpics-mode (diff) | |
download | systemd-3b2e7dc5a285edbbb1bf6aed2d88b889d801613f.tar.xz systemd-3b2e7dc5a285edbbb1bf6aed2d88b889d801613f.zip |
udev: allow/denylist for reading sysfs attributes when composing a NIC name
Users can currently pick specific versions of NIC naming, but that
does not guarantee that NIC names won't change after the kernel adds
a new sysfs attribute.
This patch allows for an allow/deny list of sysfs attributes
that could be used when composing the name.
These lists can be supplied as an hwdb entry in the form of
/etc/udev/hwdb.d/50-net-naming-allowlist.hwdb
net:naming:drvirtio_net
ID_NET_NAME_ALLOW=0
ID_NET_NAME_ALLOW_ACPI_INDEX=1
ID_NET_NAME_ALLOW_ADDR_ASSIGN_TYPE=1
ID_NET_NAME_ALLOW_ADDRESS=1
ID_NET_NAME_ALLOW_ARI_ENABLED=1
ID_NET_NAME_ALLOW_DEV_PORT=1
ID_NET_NAME_ALLOW_FUNCTION_ID=1
ID_NET_NAME_ALLOW_IFLINK=1
ID_NET_NAME_ALLOW_INDEX=1
ID_NET_NAME_ALLOW_LABEL=1
ID_NET_NAME_ALLOW_PHYS_PORT_NAME=1
ID_NET_NAME_ALLOW_TYPE=1
Diffstat (limited to 'rules.d')
-rw-r--r-- | rules.d/75-net-description.rules | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rules.d/75-net-description.rules b/rules.d/75-net-description.rules index 7e62f8b26b..5ba70a6545 100644 --- a/rules.d/75-net-description.rules +++ b/rules.d/75-net-description.rules @@ -3,6 +3,8 @@ ACTION=="remove", GOTO="net_end" SUBSYSTEM!="net", GOTO="net_end" +IMPORT{builtin}="hwdb 'net:naming:dr$env{ID_NET_DRIVER}:'" + IMPORT{builtin}="net_id" SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" |