]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
feat(nvmf): allow using system interface naming policy
authorMartin Wilck <mwilck@suse.com>
Mon, 16 Feb 2026 22:34:20 +0000 (23:34 +0100)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sun, 12 Jul 2026 13:32:04 +0000 (09:32 -0400)
nm-initrd-generator from NetworkManager 1.54 or newer supports parsing the
NBFT directly. Because NM allows identifying network interface by MAC
address, we don't need the ifname= setting any more to identify the
interface at the cmdline stage. We just need to check whether the system
has an NBFT with at least one entry.

Introduce the cmdline parameter "rd.nvmf.nm" to force dracut to use
nm-initrd-generator to set up network interfaces from the NBFT.

Signed-off-by: Martin Wilck <mwilck@suse.com>
man/dracut.cmdline.7.adoc
modules.d/74nvmf/parse-nvmf-boot-connections.sh

index fb4d3b0babb22f8327bddb4952cd2e394a07566c..43dbafd948dbb6fc5666ade15bae659327a45d4b 100644 (file)
@@ -946,6 +946,13 @@ Requires the dracut 'nvmf' module.
     the initramfs was built. Targets specified with rd.nvmf.discover on the
     kernel command line will still be tried.
 
+**rd.nvmf.nm**::
+    Rely on NetworkManagers nm-initrd-generator tool to set up network
+    interfaces from the NVMe Boot Firmware Table (NBFT). This has the effect
+    that the network interfaces generated from the NBFT will have regular
+    interface names rather than ++nbft0++ etc. *This requires NetworkManager
+    1.54.0 or higher*.
+
 **rd.nvmf.hostnqn=**__<hostNQN>__::
     NVMe host NQN to use
 
index c16103d8280a57a4b214b07704cff1df9ba89220..fd36192ed2eec812c71c532bbe7ac5cdc7904e24 100755 (executable)
@@ -203,6 +203,12 @@ nbft_parse() {
 
     nbft_json=$(nvme nbft show -H -o json) || return 0
     n_nbft=$(nbft_run_jq ". | length" "$nbft_json") || return 0
+    if [ "$n_nbft" -gt 0 ] && getargbool 0 rd.nvmf.nm; then
+        # nm-initrd-generator will take care of the interface setup.
+        # We set valid_nbft_entry_found to enable netroot (see below).
+        : > /tmp/valid_nbft_entry_found
+        return 0
+    fi
 
     while [ "$j" -lt "$n_nbft" ]; do
         all_hfi_json=$(nbft_run_jq ".[$j].hfi" "$nbft_json") || continue