From: Martin Wilck Date: Mon, 16 Feb 2026 22:34:20 +0000 (+0100) Subject: feat(nvmf): allow using system interface naming policy X-Git-Tag: 112~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00df743123776a171f4701bfdecd7dcb6ccfb793;p=thirdparty%2Fdracut-ng.git feat(nvmf): allow using system interface naming policy 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 --- diff --git a/man/dracut.cmdline.7.adoc b/man/dracut.cmdline.7.adoc index fb4d3b0ba..43dbafd94 100644 --- a/man/dracut.cmdline.7.adoc +++ b/man/dracut.cmdline.7.adoc @@ -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=**____:: NVMe host NQN to use diff --git a/modules.d/74nvmf/parse-nvmf-boot-connections.sh b/modules.d/74nvmf/parse-nvmf-boot-connections.sh index c16103d82..fd36192ed 100755 --- a/modules.d/74nvmf/parse-nvmf-boot-connections.sh +++ b/modules.d/74nvmf/parse-nvmf-boot-connections.sh @@ -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