summaryrefslogtreecommitdiff
path: root/src/partition
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-01-25 15:56:30 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2023-01-25 19:50:44 +0000
commit2ecc7a5bca1b3dedfbef1ef44ec0d4b3fe0a5112 (patch)
treeb649b14dc30394f81f07a60b7f02440b5eed1938 /src/partition
parent37aabb488e6fbbe76cf6b02956bad432bfd5cec8 (diff)
downloadsystemd-2ecc7a5bca1b3dedfbef1ef44ec0d4b3fe0a5112.tar.gz
repart: Add roothash to output of all verity siblings
This can be used to match verity partitions together using the repart JSON output.
Diffstat (limited to 'src/partition')
-rw-r--r--src/partition/repart.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c
index c95b1d601d..920b442316 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -2471,8 +2471,10 @@ static int context_dump_partitions(Context *context) {
if (p->new_padding != UINT64_MAX)
sum_padding += p->new_padding;
- if (p->verity == VERITY_HASH) {
- rh = p->roothash ? hexmem(p->roothash, p->roothash_size) : strdup("TBD");
+ if (p->verity != VERITY_OFF) {
+ Partition *hp = p->verity == VERITY_HASH ? p : p->siblings[VERITY_HASH];
+
+ rh = hp->roothash ? hexmem(hp->roothash, hp->roothash_size) : strdup("TBD");
if (!rh)
return log_oom();
}