]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dissect-image: add crypto_LUKS and swap to blkid probe filter
authorDaan De Meyer <daan@amutable.com>
Fri, 3 Apr 2026 13:43:57 +0000 (13:43 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 3 Apr 2026 17:13:24 +0000 (19:13 +0200)
allowed_fstypes() returns the list of filesystem types that we are
willing to mount. However, the blkid probe filter needs to detect
additional non-mountable types: crypto_LUKS (so that LUKS-encrypted
partitions can be identified and decrypted) and swap (so that swap
partitions can be identified).

Without these types in the BLKID_FLTR_ONLYIN filter, blkid reports
"No type detected" for encrypted and swap partitions, causing
image policy checks to fail (e.g. "encrypted was required") and
mount operations to fail with "File system type not supported".

Note that verity types (DM_verity_hash, verity_hash_signature) do
not need to be added here because their fstype is assigned directly
during partition table parsing, not via blkid probing.

Follow-up for e33eb053fb.

src/shared/dissect-image.c

index 2bef82dd34b5309ebd5e313d2f819c565255fc69..ef73b11014b68baca69b14b3691c3ffdaa46d16a 100644 (file)
@@ -195,6 +195,13 @@ static int probe_blkid_filter(blkid_probe p) {
         if (r < 0)
                 return r;
 
+        /* allowed_fstypes() returns the list of filesystem types that we are willing to mount. For the
+         * blkid probe filter we additionally need to be able to detect crypto_LUKS (so that we can set up
+         * LUKS decryption for encrypted partitions) and swap (so that we can identify swap partitions). */
+        r = strv_extend_many(&fstypes, "crypto_LUKS", "swap");
+        if (r < 0)
+                return r;
+
         errno = 0;
         r = sym_blkid_probe_filter_superblocks_type(p, BLKID_FLTR_ONLYIN, fstypes);
         if (r != 0)