From: Alexander Popov Date: Sat, 15 Jul 2023 22:45:44 +0000 (+0300) Subject: Emit WARNING for the cmdline options that exist multiple times X-Git-Tag: v0.6.6~121 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=88c0698ea5b5b1455ab6c52a9915d2bbcc00ee8b;p=kconfig-hardened-check.git 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. ``` --- 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