static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
int r;
+ assert(key);
+
/* root=, usr=, usrfstype= and roofstype= may occur more than once, the last
* instance should take precedence. In the case of multiple rootflags=
* or usrflags= the arguments should be concatenated */
else
arg_enabled = r;
- } else if (proc_cmdline_key_streq(key, "root")) {
+ } else if (streq(key, "root")) {
if (proc_cmdline_value_missing(key, value))
return 0;
log_debug("Disabling root partition auto-detection, root= is defined.");
}
- } else if (proc_cmdline_key_streq(key, "roothash")) {
+ } else if (streq(key, "roothash")) {
if (proc_cmdline_value_missing(key, value))
return 0;
if (!strextend_with_separator(&arg_root_options, ",", value))
return log_oom();
- } else if (proc_cmdline_key_streq(key, "rw") && !value)
+ } else if (streq(key, "rw") && !value)
arg_root_rw = true;
- else if (proc_cmdline_key_streq(key, "ro") && !value)
+ else if (streq(key, "ro") && !value)
arg_root_rw = false;
else if (proc_cmdline_key_streq(key, "systemd.image_policy"))
return parse_image_policy_argument(optarg, &arg_image_policy);
- else if (proc_cmdline_key_streq(key, "systemd.swap")) {
+ else if (streq(key, "systemd.swap")) {
r = value ? parse_boolean(value) : 1;
if (r < 0)
static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
int r;
- if (proc_cmdline_key_streq(key, "resume")) {
+ assert(key);
+
+ if (streq(key, "resume")) {
char *s;
if (proc_cmdline_value_missing(key, value))
arg_resume_offset_set = true;
- } else if (proc_cmdline_key_streq(key, "resumeflags")) {
+ } else if (streq(key, "resumeflags")) {
if (proc_cmdline_value_missing(key, value))
return 0;
if (!strextend_with_separator(&arg_resume_options, ",", value))
return log_oom();
- } else if (proc_cmdline_key_streq(key, "rootflags")) {
+ } else if (streq(key, "rootflags")) {
if (proc_cmdline_value_missing(key, value))
return 0;
if (!strextend_with_separator(&arg_root_options, ",", value))
return log_oom();
- } else if (proc_cmdline_key_streq(key, "noresume")) {
+ } else if (streq(key, "noresume")) {
+
if (value) {
log_warning("\"noresume\" kernel command line switch specified with an argument, ignoring.");
return 0;
struct ProcCmdlineInfo *info = ASSERT_PTR(data);
int r;
+ assert(key);
assert(info->manager);
/* The kernel command line option names are chosen to be compatible with what various tools already
* interpret, for example dracut and SUSE Linux. */
- if (proc_cmdline_key_streq(key, "nameserver")) {
+ if (streq(key, "nameserver")) {
if (proc_cmdline_value_missing(key, value))
return 0;
info->manager->read_resolv_conf = false;
- } else if (proc_cmdline_key_streq(key, "domain")) {
+ } else if (streq(key, "domain")) {
if (proc_cmdline_value_missing(key, value))
return 0;
static int parse(const char *key, const char *value, void *data) {
int r;
- if (proc_cmdline_key_streq(key, "systemd.run")) {
+ assert(key);
+
+ if (streq(key, "systemd.run")) {
if (proc_cmdline_value_missing(key, value))
return 0;
static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
int r;
- if (proc_cmdline_key_streq(key, "systemd.verity")) {
+ assert(key);
+
+ if (streq(key, "systemd.verity")) {
r = value ? parse_boolean(value) : 1;
if (r < 0)
else
arg_read_veritytab = r;
- } else if (proc_cmdline_key_streq(key, "roothash")) {
+ } else if (streq(key, "roothash")) {
if (proc_cmdline_value_missing(key, value))
return 0;
if (r < 0)
return log_oom();
- } else if (proc_cmdline_key_streq(key, "usrhash")) {
+ } else if (streq(key, "usrhash")) {
if (proc_cmdline_value_missing(key, value))
return 0;