chiark / gitweb /
terminal/grdrm: force deep modeset on enter
[elogind.git] / src / gpt-auto-generator / gpt-auto-generator.c
index cd24d9483ac4837705905f94ed2d455f7ce6711d..539e2e64b53b59568ee70c1de8d15223506e598c 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"
@@ -395,22 +394,30 @@ static int enumerate_partitions(dev_t devnum) {
                 return log_oom();
 
         parent = udev_device_get_parent(d);
-        if (!parent)
+        if (!parent) {
+                log_debug("Not a partitioned device, ignoring.");
                 return 0;
+        }
 
         /* Does it have a devtype? */
         devtype = udev_device_get_devtype(parent);
-        if (!devtype)
+        if (!devtype) {
+                log_debug("Parent doesn't have a device type, ignoring.");
                 return 0;
+        }
 
         /* Is this a disk or a partition? We only care for disks... */
-        if (!streq(devtype, "disk"))
+        if (!streq(devtype, "disk")) {
+                log_debug("Parent isn't a raw disk, ignoring.");
                 return 0;
+        }
 
         /* Does it have a device node? */
         node = udev_device_get_devnode(parent);
-        if (!node)
+        if (!node) {
+                log_debug("Parent device does not have device node, ignoring.");
                 return 0;
+        }
 
         log_debug("Root device %s.", node);
 
@@ -428,8 +435,6 @@ static int enumerate_partitions(dev_t devnum) {
                 return -errno;
         }
 
-        blkid_probe_enable_superblocks(b, 1);
-        blkid_probe_set_superblocks_flags(b, BLKID_SUBLKS_TYPE);
         blkid_probe_enable_partitions(b, 1);
         blkid_probe_set_partitions_flags(b, BLKID_PARTS_ENTRY_DETAILS);
 
@@ -454,8 +459,10 @@ static int enumerate_partitions(dev_t devnum) {
         }
 
         /* We only do this all for GPT... */
-        if (!streq_ptr(pttype, "gpt"))
+        if (!streq_ptr(pttype, "gpt")) {
+                log_debug("Not a GPT partition table, ignoring.");
                 return 0;
+        }
 
         errno = 0;
         pl = blkid_probe_get_partitions(b);
@@ -687,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;
 }