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.
This commit is contained in:
Lennart Poettering
2021-04-23 17:56:55 +02:00
parent c65f854af6
commit 1c41c1dc34
5 changed files with 104 additions and 36 deletions
+11
View File
@@ -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);
}
+1
View File
@@ -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);