From bf7530ccc1a937ce8e46ebb90c394c5b6bf85d37 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 23 Jul 2021 10:53:45 +0200 Subject: [PATCH] initrd: honor "ip=single-dhcp" option as alias for "dhcp" This mode was added to network-legacy in [1]. NetworkManager anyway always does DHCP in parallel, so this is basically an alias for "dhcp". Note that network-legacy's "single-dhcp" will stop waiting for DHCP once the first device gets an address. NetworkManager currently cannot do that. While it runs DHCP in parallel, all devices need to settle and there is no concept where completing one device makes the overall "startup complete" process finish early. That could however be added. Anyway, while not being exactly the same, it's still more useful to do something similar instead of not working at all. See-also: https://github.com/dracutdevs/dracut/pull/853 See-also: https://github.com/dracutdevs/dracut/pull/961 See-also: https://github.com/dracutdevs/dracut/pull/1048 [1] https://github.com/dracutdevs/dracut/commit/4026cd3b012be7f06c7572bdf50dd54a18ecb684 --- src/nm-initrd-generator/nmi-cmdline-reader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-initrd-generator/nmi-cmdline-reader.c b/src/nm-initrd-generator/nmi-cmdline-reader.c index 35978ba3e4..15a3de8067 100644 --- a/src/nm-initrd-generator/nmi-cmdline-reader.c +++ b/src/nm-initrd-generator/nmi-cmdline-reader.c @@ -604,7 +604,7 @@ reader_parse_ip(Reader *reader, const char *sysfs_dir, char *argument) NM_SETTING_IP4_CONFIG_METHOD_DISABLED, NULL); } - } else if (nm_streq0(kind, "dhcp")) { + } else if (NM_IN_STRSET(kind, "dhcp", "single-dhcp")) { g_object_set(s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO,