chiark / gitweb /
coredump: collect all /proc data useful for bug reporting
[elogind.git] / src / gpt-auto-generator / gpt-auto-generator.c
index 78643c9a3ce09eb05eb1c072c03c5bd6bb85913e..9251ddff75ba15d625a04d5cf29b753ce285e31d 100644 (file)
@@ -124,7 +124,7 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, char **devi
                 return log_oom();
 
         p = strjoin(arg_dest, "/", n, NULL);
-        if (!n)
+        if (!p)
                 return log_oom();
 
         f = fopen(p, "wxe");
@@ -144,7 +144,6 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, char **devi
                 "Before=umount.target cryptsetup.target\n"
                 "After=%s\n"
                 "IgnoreOnIsolate=true\n"
-                "After=systemd-readahead-collect.service systemd-readahead-replay.service\n\n"
                 "[Service]\n"
                 "Type=oneshot\n"
                 "RemainAfterExit=yes\n"
@@ -681,8 +680,8 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 r = parse_boolean(value);
                 if (r < 0)
                         log_warning("Failed to parse gpt-auto switch %s. Ignoring.", value);
-
-                arg_enabled = r;
+                else
+                        arg_enabled = r;
 
         } else if (streq(key, "root") && value) {
 
@@ -695,8 +694,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 arg_root_rw = true;
         else if (streq(key, "ro") && !value)
                 arg_root_rw = false;
-        else if (startswith(key, "systemd.gpt-auto.") || startswith(key, "rd.systemd.gpt-auto."))
-                log_warning("Unknown kernel switch %s. Ignoring.", key);
 
         return 0;
 }
@@ -775,8 +772,9 @@ int main(int argc, char *argv[]) {
                 return EXIT_SUCCESS;
         }
 
-        if (parse_proc_cmdline(parse_proc_cmdline_item) < 0)
-                return EXIT_FAILURE;
+        r = parse_proc_cmdline(parse_proc_cmdline_item);
+        if (r < 0)
+                log_warning("Failed to parse kernel command line, ignoring: %s", strerror(-r));
 
         if (!arg_enabled) {
                 log_debug("Disabled, exiting.");