summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-07-02 18:34:39 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-07-03 15:45:51 +0200
commit90a255779d1f8e6697e08e91918df88bb52274ad (patch)
treefe807f19a13e381319ba1d4fe9d9c3ff7cff04b0 /src/shared
parentmkosi: Copy packages to the build directory as well (diff)
downloadsystemd-90a255779d1f8e6697e08e91918df88bb52274ad.tar.xz
systemd-90a255779d1f8e6697e08e91918df88bb52274ad.zip
repart: Allow overriding fstype per partition designator
$SYSTEMD_REPART_OVERRIDE_FSTYPE is too invasive. Often you want to override the fstype only for a specific designator, so let's support that as well.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/gpt.c12
-rw-r--r--src/shared/gpt.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/gpt.c b/src/shared/gpt.c
index d80ee16f2e..fc71ef431b 100644
--- a/src/shared/gpt.c
+++ b/src/shared/gpt.c
@@ -339,6 +339,18 @@ bool gpt_partition_type_knows_no_auto(GptPartitionType type) {
PARTITION_SWAP);
}
+bool gpt_partition_type_has_filesystem(GptPartitionType type) {
+ return IN_SET(type.designator,
+ PARTITION_ROOT,
+ PARTITION_USR,
+ PARTITION_HOME,
+ PARTITION_SRV,
+ PARTITION_ESP,
+ PARTITION_XBOOTLDR,
+ PARTITION_TMP,
+ PARTITION_VAR);
+}
+
bool gpt_header_has_signature(const GptHeader *p) {
assert(p);
diff --git a/src/shared/gpt.h b/src/shared/gpt.h
index 411749900f..e64ba8439d 100644
--- a/src/shared/gpt.h
+++ b/src/shared/gpt.h
@@ -72,6 +72,7 @@ const char* gpt_partition_type_mountpoint_nulstr(GptPartitionType type);
bool gpt_partition_type_knows_read_only(GptPartitionType type);
bool gpt_partition_type_knows_growfs(GptPartitionType type);
bool gpt_partition_type_knows_no_auto(GptPartitionType type);
+bool gpt_partition_type_has_filesystem(GptPartitionType type);
typedef struct {
uint8_t partition_type_guid[16];