initrd: skip NBFT parsing when already defined on the cmdline

Skip the internal NBFT table parsing when nbft interfaces
are already defined on the cmdline, e.g. from the original
95nvmf dracut module.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
This commit is contained in:
Tomas Bzatek
2025-04-15 15:43:19 +02:00
committed by Beniamino Galvani
parent 81839c0da8
commit f0d6b339bf

View File

@@ -1454,6 +1454,7 @@ nmi_cmdline_reader_parse(const char *etc_connections_dir,
guint64 dhcp_timeout = 90;
guint64 dhcp_num_tries = 1;
gboolean nvmf_nonbft = FALSE;
gboolean have_dracut_nbft = FALSE;
reader = reader_new();
@@ -1470,7 +1471,10 @@ nmi_cmdline_reader_parse(const char *etc_connections_dir,
/* pass */
} else if (nm_streq(tag, "net.ifnames"))
net_ifnames = !nm_streq(argument, "0");
else if (nm_streq(tag, "rd.peerdns"))
else if (nm_streq(tag, "ifname")) {
if (NM_STR_HAS_PREFIX(argument, "nbft"))
have_dracut_nbft = TRUE;
} else if (nm_streq(tag, "rd.peerdns"))
reader->ignore_auto_dns = !_nm_utils_ascii_str_to_bool(argument, TRUE);
else if (nm_streq(tag, "rd.net.timeout.dhcp")) {
if (nm_streq0(argument, "infinity")) {
@@ -1566,7 +1570,7 @@ nmi_cmdline_reader_parse(const char *etc_connections_dir,
nvmf_nonbft = TRUE;
}
if (!nvmf_nonbft) {
if (!nvmf_nonbft && !have_dracut_nbft) {
NMConnection **nbft_connections, **c;
nbft_connections = nmi_nbft_reader_parse(sysfs_dir, &reader->hostname);