summaryrefslogtreecommitdiffstats
path: root/src/shared/dissect-image.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-02-27 13:45:17 +0100
committerLennart Poettering <lennart@poettering.net>2023-02-27 19:11:17 +0100
commit41aca66ba4f3a72ad709ef27e334392ef177450c (patch)
tree308a3a85cdb8fbb24297f64a4589dca58fa2cb41 /src/shared/dissect-image.c
parentupdate TODO (diff)
downloadsystemd-41aca66ba4f3a72ad709ef27e334392ef177450c.tar.xz
systemd-41aca66ba4f3a72ad709ef27e334392ef177450c.zip
Revert "dissect-image: don't probe swap partitions needlessly"
This reverts commit df4524cb3796529b435af309f5e6a2d92bcdaaa0. This commit is just wrong. The thing is that we *don't* know automatically that the partition contains a swap image, because it could be encrypted. Hence revert. Fixes: #26595
Diffstat (limited to '')
-rw-r--r--src/shared/dissect-image.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c
index ce37dd31ce..b20e21cce2 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -984,7 +984,10 @@ static int dissect_image(
if (pflags & SD_GPT_FLAG_NO_AUTO)
continue;
- fstype = "swap";
+ /* Note: we don't set fstype = "swap" here, because we still need to probe if
+ * it might be encrypted (i.e. fstype "crypt_LUKS") or unencrypted
+ * (i.e. fstype "swap"), and the only way to figure that out is via fstype
+ * probing. */
/* We don't have a designator for SD_GPT_LINUX_GENERIC so check the UUID instead. */
} else if (sd_id128_equal(type.uuid, SD_GPT_LINUX_GENERIC)) {