diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-03-23 16:16:42 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-04-19 23:16:02 +0200 |
commit | e73309c532999cb15490a78575dd882b24bbe96f (patch) | |
tree | d9e64f73526c04b33c1b025fb633cca6b6314941 /src/shared/gpt.c | |
parent | 5c08da586fc8fe7cda4010e0057cb79ba1d74335 (diff) | |
download | systemd-e73309c532999cb15490a78575dd882b24bbe96f.tar.gz |
repart: add new ReadOnly= and Flags= settings for repart dropins
Let's make the GPT partition flags configurable when creating new
partitions. This is primarily useful for the read-only flag (which we
want to set for verity enabled partitions).
This adds two settings for this: Flags= and ReadOnly=, which strictly
speaking are redundant. The main reason to have both is that usually the
ReadOnly= setting is the one wants to control, and it' more generic.
Moreover we might later on introduce inherting of flags from CopyBlocks=
partitions, where one might want to control most flags as is except for
the RO flag and similar, hence let's keep them separate.
Diffstat (limited to 'src/shared/gpt.c')
-rw-r--r-- | src/shared/gpt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/shared/gpt.c b/src/shared/gpt.c index 5f2de0d947..846b2fe48f 100644 --- a/src/shared/gpt.c +++ b/src/shared/gpt.c @@ -146,3 +146,14 @@ bool gpt_partition_type_is_usr_verity(sd_id128_t id) { sd_id128_equal(id, GPT_USR_RISCV32_VERITY) || sd_id128_equal(id, GPT_USR_RISCV64_VERITY); } + +bool gpt_partition_type_knows_read_only(sd_id128_t id) { + return gpt_partition_type_is_root(id) || + gpt_partition_type_is_usr(id) || + sd_id128_equal(id, GPT_HOME) || + sd_id128_equal(id, GPT_SRV) || + sd_id128_equal(id, GPT_VAR) || + sd_id128_equal(id, GPT_TMP) || + 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 */ +} |