From: Lennart Poettering Date: Thu, 19 Jun 2014 14:15:01 +0000 (+0200) Subject: main: don't show help text anymore when we detect an unknown kernel cmdline value... X-Git-Tag: v215~296 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=9e01adfa90ab48e24b55a507d68768fc12e951f3 main: don't show help text anymore when we detect an unknown kernel cmdline value starting with "systemd." As generators and other components started to maintain their own kernel command line options this help text needed more and more exceptions and wasn't complete anyway. Fixing that would leak more information about specific generators into PID 1, which we should avoid. Given that kernel cmdline handling traditionally doesn't generate errors or show help texts, let's just remove the logic for it for systemd too. --- diff --git a/src/core/main.c b/src/core/main.c index b3ee1b9b8..863ba527c 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -375,43 +375,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value) { } else log_warning("Environment variable name '%s' is not valid. Ignoring.", value); - } else if (!streq(key, "systemd.restore_state") && - !streq(key, "systemd.gpt_auto") && - (startswith(key, "systemd.") || startswith(key, "rd.systemd."))) { - - const char *c; - - /* Ignore systemd.journald.xyz and friends */ - c = key; - if (startswith(c, "rd.")) - c += 3; - if (startswith(c, "systemd.")) - c += 8; - if (c[strcspn(c, ".=")] != '.') { - - log_warning("Unknown kernel switch %s. Ignoring.", key); - - log_info("Supported kernel switches:\n" - "systemd.unit=UNIT Default unit to start\n" - "rd.systemd.unit=UNIT Default unit to start when run in initrd\n" - "systemd.dump_core=0|1 Dump core on crash\n" - "systemd.crash_shell=0|1 Run shell on crash\n" - "systemd.crash_chvt=N Change to VT #N on crash\n" - "systemd.confirm_spawn=0|1 Confirm every process spawn\n" - "systemd.show_status=0|1|auto Show status updates on the console during bootup\n" - "systemd.log_target=console|kmsg|journal|journal-or-kmsg|syslog|syslog-or-kmsg|null\n" - " Log target\n" - "systemd.log_level=LEVEL Log level\n" - "systemd.log_color=0|1 Highlight important log messages\n" - "systemd.log_location=0|1 Include code location in log messages\n" - "systemd.default_standard_output=null|tty|syslog|syslog+console|kmsg|kmsg+console|journal|journal+console\n" - " Set default log output for services\n" - "systemd.default_standard_error=null|tty|syslog|syslog+console|kmsg|kmsg+console|journal|journal+console\n" - " Set default log error output for services\n" - "systemd.setenv=ASSIGNMENT Set an environment variable for all spawned processes\n" - "systemd.restore_state=0|1 Restore backlight/rfkill state at boot\n"); - } - } else if (streq(key, "quiet") && !value) { log_set_max_level(LOG_NOTICE);