]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto: make arg_root_rw a tri-state
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Nov 2018 18:49:13 +0000 (19:49 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Dec 2018 13:47:46 +0000 (14:47 +0100)
No change in behaviour, but let's track whether ro or rw are specified
on the kernel cmdline at all.

src/gpt-auto-generator/gpt-auto-generator.c

index 28479386b9be42679acd1e01f90f32483c2f7458..425f5421caa629a58eb9123261992af4da802a7c 100644 (file)
@@ -39,7 +39,7 @@
 static const char *arg_dest = NULL;
 static bool arg_enabled = true;
 static bool arg_root_enabled = true;
-static bool arg_root_rw = false;
+static int arg_root_rw = -1;
 
 static int add_cryptsetup(const char *id, const char *what, bool rw, bool require, char **device) {
         _cleanup_free_ char *e = NULL, *n = NULL, *d = NULL, *id_escaped = NULL, *what_escaped = NULL;
@@ -640,7 +640,7 @@ static int add_root_mount(void) {
                         "/dev/gpt-auto-root",
                         in_initrd() ? "/sysroot" : "/",
                         NULL,
-                        arg_root_rw,
+                        arg_root_rw > 0,
                         NULL,
                         "Root Partition",
                         in_initrd() ? SPECIAL_INITRD_ROOT_FS_TARGET : SPECIAL_LOCAL_FS_TARGET);