]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: add udev rule to avoid renaming nbft interfaces
authorMartin Wilck <mwilck@suse.com>
Tue, 23 May 2023 12:19:14 +0000 (14:19 +0200)
committerDaniel Wagner <wagi@monom.org>
Wed, 8 Nov 2023 12:53:35 +0000 (13:53 +0100)
In the initramfs, the interface naming is taken care of by dracut.
But there are various network-interface-naming policies in place which
may attempt to rename the interface, causing confusion and possibly
wrong interface parameters.

Add an udev rule that avoids renaming any network interface that
has been assigned a name nbft$N, which is by convention the naming
scheme that is used for NBFT device in the initramfs.

Note: The simpler 'NAME:="%k"' directive doesn't work because udev rejects
it ('Ignoring NAME="%k", as it will take no effect.'). The ":=" syntax makes
sure the interface isn't renamed any more by later rules. "INTERFACE" is set
by the kernel in the "add" uevent for a network interface.

Signed-off-by: Martin Wilck <mwilck@suse.com>
meson.build
nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in [new file with mode: 0644]

index d837aa9cf0e58c980b088107f50b5c87aada452a..864ed0d402e315d0d550deaaeeb16602718b98a9 100644 (file)
@@ -236,6 +236,7 @@ foreach file : systemd_files
 endforeach
 
 udev_files = [
+  '65-persistent-net-nbft.rules',
   '70-nvmf-autoconnect.rules',
   '71-nvmf-netapp.rules',
 ]
diff --git a/nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in b/nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in
new file mode 100644 (file)
index 0000000..344942b
--- /dev/null
@@ -0,0 +1,2 @@
+# Avoid renaming nbft$X interfaces
+SUBSYSTEM=="net", ACTION!="remove", ENV{INTERFACE}=="nbft*", NAME:="%E{INTERFACE}"