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>
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
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