From 88c0698ea5b5b1455ab6c52a9915d2bbcc00ee8b Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 16 Jul 2023 01:45:44 +0300 Subject: [PATCH] Emit WARNING for the cmdline options that exist multiple times Don't emit ERROR here. Even GitHub Actions machines have repeated options in /proc/cmdline. Also see the comment in cmdline parsing for x86: https://elixir.bootlin.com/linux/v5.16.7/source/arch/x86/boot/cmdline.c#L21 ``` In accordance with standard Linux practice, if this option is repeated, this returns the last instance on the command line. ``` --- kconfig_hardened_check/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 1b6cc2e..a98fbe8 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -194,7 +194,7 @@ def parse_cmdline_file(parsed_options, fname): name = opt value = '' # '' is not None if name in parsed_options: - sys.exit(f'[!] ERROR: cmdline option "{name}" exists multiple times') + print(f'[!] WARNING: cmdline option "{name}" exists multiple times') value = normalize_cmdline_options(name, value) parsed_options[name] = value -- 2.31.1