]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto: compare kernel cmdline args with proc_cmdline_key_streq()
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Nov 2018 17:51:30 +0000 (18:51 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Dec 2018 13:38:30 +0000 (14:38 +0100)
src/gpt-auto-generator/gpt-auto-generator.c

index a6d7bcc7552f4dc567847b81de1e7fa5e301efe1..28479386b9be42679acd1e01f90f32483c2f7458 100644 (file)
@@ -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;