summaryrefslogtreecommitdiff
path: root/src/gpt-auto-generator
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-11-23 18:51:30 +0100
committerLennart Poettering <lennart@poettering.net>2018-12-18 14:38:30 +0100
commit8a9c44edf90d122f80a0234f5416eabb0d6061e0 (patch)
treec34e0bc5819ede8abd3401b16bb55640fa400fd1 /src/gpt-auto-generator
parente4abfc77c4b575ddc0baaf7f64146843f5da48a8 (diff)
downloadsystemd-8a9c44edf90d122f80a0234f5416eabb0d6061e0.tar.gz
gpt-auto: compare kernel cmdline args with proc_cmdline_key_streq()
Diffstat (limited to 'src/gpt-auto-generator')
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index a6d7bcc755..28479386b9 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -558,7 +558,8 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
assert(key);
- if (STR_IN_SET(key, "systemd.gpt_auto", "rd.systemd.gpt_auto")) {
+ if (proc_cmdline_key_streq(key, "systemd.gpt_auto") ||
+ proc_cmdline_key_streq(key, "rd.systemd.gpt_auto")) {
r = value ? parse_boolean(value) : 1;
if (r < 0)
@@ -566,7 +567,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
else
arg_enabled = r;
- } else if (streq(key, "root")) {
+ } else if (proc_cmdline_key_streq(key, "root")) {
if (proc_cmdline_value_missing(key, value))
return 0;
@@ -576,7 +577,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
arg_root_enabled = streq(value, "gpt-auto");
- } else if (streq(key, "roothash")) {
+ } else if (proc_cmdline_key_streq(key, "roothash")) {
if (proc_cmdline_value_missing(key, value))
return 0;
@@ -585,9 +586,9 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
arg_root_enabled = false;
- } else if (streq(key, "rw") && !value)
+ } else if (proc_cmdline_key_streq(key, "rw") && !value)
arg_root_rw = true;
- else if (streq(key, "ro") && !value)
+ else if (proc_cmdline_key_streq(key, "ro") && !value)
arg_root_rw = false;
return 0;