repart: make No-Auto GPT partition flag configurable too

This is useful for provisioning initially empty secondary A/B root file
systems. We don't want those to ever be considered for automatic
mounting, for example in "systemd-nspawn --image=", hence we should
create them with the No-Auto flag turned on. Once a file system image is
dropped into the partition the flag may be turned off by the updater
tool, so that it is considered from then on.

Thew new option for this is called NoAuto. I dislike negated options
like this, but this is taken from the naming in the spec, which in turn
inherited the name from the same flag for Microsoft Data Partitions. To
minimize confusion, let's stick to the name hence.
This commit is contained in:
Lennart Poettering
2021-06-18 14:34:01 +09:00
committed by Yu Watanabe
parent 1a27c323dd
commit ff0771bfc8
4 changed files with 52 additions and 22 deletions
+14
View File
@@ -174,3 +174,17 @@ bool gpt_partition_type_knows_growfs(sd_id128_t id) {
GPT_TMP,
GPT_XBOOTLDR);
}
bool gpt_partition_type_knows_no_auto(sd_id128_t id) {
return gpt_partition_type_is_root(id) ||
gpt_partition_type_is_root_verity(id) ||
gpt_partition_type_is_usr(id) ||
gpt_partition_type_is_usr_verity(id) ||
sd_id128_in_set(id,
GPT_HOME,
GPT_SRV,
GPT_VAR,
GPT_TMP,
GPT_XBOOTLDR,
GPT_SWAP);
}
+1
View File
@@ -140,3 +140,4 @@ 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);
bool gpt_partition_type_knows_no_auto(sd_id128_t id);