- r = verify_gpt_partition(udev_device_get_devnum(q), &type_id, &nr, &fstype);
- if (r < 0) {
- log_error("Failed to verify GPT partition: %s", strerror(-r));
- udev_device_unref(q);
- goto finish;
- }
- if (r == 0)
- goto skip;
-
- if (sd_id128_equal(type_id, SD_ID128_MAKE(06,57,fd,6d,a4,ab,43,c4,84,e5,09,33,c8,4b,4f,4f)))
- add_swap(node, fstype);
- else if (sd_id128_equal(type_id, SD_ID128_MAKE(93,3a,c7,e1,2e,b4,4f,13,b8,44,0e,14,e2,ae,f9,15))) {
-
- if (!home || nr < home_nr) {
- free(home);
- home = strdup(node);
- if (!home) {
- r = log_oom();
- goto finish;
- }
-
- home_nr = nr;
-
- free(home_fstype);
- home_fstype = fstype;
- fstype = NULL;
+ subnode = udev_device_get_devnode(q);
+ if (!subnode)
+ continue;
+
+ pp = blkid_partlist_devno_to_partition(pl, qn);
+ if (!pp)
+ continue;
+
+ flags = blkid_partition_get_flags(pp);
+
+ /* Ignore partitions that are not marked for automatic
+ * mounting on discovery */
+ if (flags & GPT_FLAG_NO_AUTO)
+ continue;
+
+ nr = blkid_partition_get_partno(pp);
+ if (nr < 0)
+ continue;
+
+ stype = blkid_partition_get_type_string(pp);
+ if (!stype)
+ continue;
+
+ if (sd_id128_from_string(stype, &type_id) < 0)
+ continue;
+
+ if (sd_id128_equal(type_id, GPT_SWAP)) {
+
+ if (flags & GPT_FLAG_READ_ONLY) {
+ log_debug("%s marked as read-only swap partition, which is bogus, ignoring.", subnode);
+ continue;