summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-04-21 17:31:34 +0200
committerLennart Poettering <lennart@poettering.net>2021-04-23 17:56:55 +0200
commit1c41c1dc346dd0d5d235fe0866bbe2d9be924dcd (patch)
treea9499bec80e1f5cd5cbe435eb747650018151e4e /src/shared
parenttree-wide: enable automatic growing of file systems in images in various tool... (diff)
downloadsystemd-1c41c1dc346dd0d5d235fe0866bbe2d9be924dcd.tar.xz
systemd-1c41c1dc346dd0d5d235fe0866bbe2d9be924dcd.zip
repart: add GrowFileSystem= setting to set new GPT partition flag for newly created partitions
And set it to on by default, except if partition is marked read-only.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/gpt.c11
-rw-r--r--src/shared/gpt.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/gpt.c b/src/shared/gpt.c
index 69da6c7280..558b69c487 100644
--- a/src/shared/gpt.c
+++ b/src/shared/gpt.c
@@ -163,3 +163,14 @@ bool gpt_partition_type_knows_read_only(sd_id128_t id) {
gpt_partition_type_is_root_verity(id) || /* pretty much implied, but let's set the bit to make things really clear */
gpt_partition_type_is_usr_verity(id); /* ditto */
}
+
+bool gpt_partition_type_knows_growfs(sd_id128_t id) {
+ return gpt_partition_type_is_root(id) ||
+ gpt_partition_type_is_usr(id) ||
+ sd_id128_in_set(id,
+ GPT_HOME,
+ GPT_SRV,
+ GPT_VAR,
+ GPT_TMP,
+ GPT_XBOOTLDR);
+}
diff --git a/src/shared/gpt.h b/src/shared/gpt.h
index a99417219d..6581973793 100644
--- a/src/shared/gpt.h
+++ b/src/shared/gpt.h
@@ -136,3 +136,4 @@ bool gpt_partition_type_is_usr(sd_id128_t id);
bool gpt_partition_type_is_usr_verity(sd_id128_t id);
bool gpt_partition_type_knows_read_only(sd_id128_t id);
+bool gpt_partition_type_knows_growfs(sd_id128_t id);