Merge pull request #31526 from poettering/proc-cmdline-underscorify

make sure we use underscores for kernel cmdline option names, not dashes
This commit is contained in:
Luca Boccassi
2024-02-28 17:59:46 +00:00
committed by GitHub
18 changed files with 86 additions and 55 deletions
+2 -2
View File
@@ -123,9 +123,9 @@ static int run(int argc, char *argv[]) {
log_setup();
r = proc_cmdline_get_bool("systemd.battery-check", PROC_CMDLINE_STRIP_RD_PREFIX|PROC_CMDLINE_TRUE_WHEN_MISSING, &arg_doit);
r = proc_cmdline_get_bool("systemd.battery_check", PROC_CMDLINE_STRIP_RD_PREFIX|PROC_CMDLINE_TRUE_WHEN_MISSING, &arg_doit);
if (r < 0)
log_warning_errno(r, "Failed to parse systemd.battery-check= kernel command line option, ignoring: %m");
log_warning_errno(r, "Failed to parse systemd.battery_check= kernel command line option, ignoring: %m");
r = parse_argv(argc, argv);
if (r <= 0)
+2 -2
View File
@@ -2202,9 +2202,9 @@ static void log_execution_mode(bool *ret_first_boot) {
/* Let's check whether we are in first boot. First, check if an override was
* specified on the kernel command line. If yes, we honour that. */
r = proc_cmdline_get_bool("systemd.condition-first-boot", /* flags = */ 0, &first_boot);
r = proc_cmdline_get_bool("systemd.condition_first_boot", /* flags = */ 0, &first_boot);
if (r < 0)
log_debug_errno(r, "Failed to parse systemd.condition-first-boot= kernel command line argument, ignoring: %m");
log_debug_errno(r, "Failed to parse systemd.condition_first_boot= kernel command line argument, ignoring: %m");
if (r > 0)
log_full(first_boot ? LOG_INFO : LOG_DEBUG,
+11 -11
View File
@@ -27,7 +27,7 @@
# .link
ifname=<interface>:<MAC>
net.ifname-policy=policy1[,policy2,...][,<MAC>] # This is an original rule, not supported by other tools.
net.ifname_policy=policy1[,policy2,...][,<MAC>] # This is an original rule, not supported by other tools.
# .netdev
vlan=<vlanname>:<phydevice>
@@ -1114,7 +1114,7 @@ static int parse_cmdline_ifname_policy(Context *context, const char *key, const
assert(context);
assert(key);
/* net.ifname-policy=policy1[,policy2,...][,<MAC>] */
/* net.ifname_policy=policy1[,policy2,...][,<MAC>] */
if (proc_cmdline_value_missing(key, value))
return -EINVAL;
@@ -1172,23 +1172,23 @@ int parse_cmdline_item(const char *key, const char *value, void *data) {
assert(key);
if (streq(key, "ip"))
if (proc_cmdline_key_streq(key, "ip"))
return parse_cmdline_ip(context, key, value);
if (streq(key, "rd.route"))
if (proc_cmdline_key_streq(key, "rd.route"))
return parse_cmdline_rd_route(context, key, value);
if (streq(key, "nameserver"))
if (proc_cmdline_key_streq(key, "nameserver"))
return parse_cmdline_nameserver(context, key, value);
if (streq(key, "rd.peerdns"))
if (proc_cmdline_key_streq(key, "rd.peerdns"))
return parse_cmdline_rd_peerdns(context, key, value);
if (streq(key, "vlan"))
if (proc_cmdline_key_streq(key, "vlan"))
return parse_cmdline_vlan(context, key, value);
if (streq(key, "bridge"))
if (proc_cmdline_key_streq(key, "bridge"))
return parse_cmdline_bridge(context, key, value);
if (streq(key, "bond"))
if (proc_cmdline_key_streq(key, "bond"))
return parse_cmdline_bond(context, key, value);
if (streq(key, "ifname"))
if (proc_cmdline_key_streq(key, "ifname"))
return parse_cmdline_ifname(context, key, value);
if (streq(key, "net.ifname-policy"))
if (proc_cmdline_key_streq(key, "net.ifname_policy"))
return parse_cmdline_ifname_policy(context, key, value);
return 0;
+2 -2
View File
@@ -751,9 +751,9 @@ static int condition_test_needs_update(Condition *c, char **env) {
assert(c->parameter);
assert(c->type == CONDITION_NEEDS_UPDATE);
r = proc_cmdline_get_bool("systemd.condition-needs-update", /* flags = */ 0, &b);
r = proc_cmdline_get_bool("systemd.condition_needs_update", /* flags = */ 0, &b);
if (r < 0)
log_debug_errno(r, "Failed to parse systemd.condition-needs-update= kernel command line argument, ignoring: %m");
log_debug_errno(r, "Failed to parse systemd.condition_needs_update= kernel command line argument, ignoring: %m");
if (r > 0)
return b;
+1 -1
View File
@@ -53,7 +53,7 @@ const NamingScheme* naming_scheme(void) {
return cache;
/* Acquire setting from the kernel command line */
(void) proc_cmdline_get_key("net.naming-scheme", 0, &buffer);
(void) proc_cmdline_get_key("net.naming_scheme", 0, &buffer);
/* Also acquire it from an env var */
e = getenv("NET_NAMING_SCHEME");
+2 -2
View File
@@ -20,10 +20,10 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
assert(key);
if (proc_cmdline_key_streq(key, "systemd.tpm2-wait")) {
if (proc_cmdline_key_streq(key, "systemd.tpm2_wait")) {
r = value ? parse_boolean(value) : 1;
if (r < 0)
log_warning_errno(r, "Failed to parse 'systemd.tpm2-wait' kernel command line argument, ignoring: %s", value);
log_warning_errno(r, "Failed to parse 'systemd.tpm2_wait=' kernel command line argument, ignoring: %s", value);
else
arg_tpm2_wait = r;
}