From 2e5d389a7b03847f5b7e3e7e5b463fc88af24448 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Tue, 14 May 2019 13:35:35 +0700 Subject: [PATCH] src/context: add support for systemd.verity_root_data= in the kernel cmdline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both systemd[1] and systemd-veritysetup-generator[2] define and use the specific systemd kernel parameter systemd.verity_root_data= to setup the integrity protected for the root file-system. This looks for the kernel parameter systemd.verity_root_data= to guess the booted slot name if root= is not unset. [1]: https://www.freedesktop.org/software/systemd/man/kernel-command-line.html#roothash= [2]: https://www.freedesktop.org/software/systemd/man/systemd-veritysetup-generator.html#systemd.verity_root_data= Signed-off-by: Arnaud Rebillout Signed-off-by: Gaƫl PORTAY --- src/context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/context.c b/src/context.c index 968266bec..ee8993938 100644 --- a/src/context.c +++ b/src/context.c @@ -53,6 +53,9 @@ static const gchar* get_cmdline_bootname(void) } bootname = regex_match("root=(\\S+)", contents); + if (!bootname) + bootname = regex_match("systemd\\.verity_root_data=(\\S+)", contents); + if (!bootname) return NULL;