Skip to content

Commit

Permalink
src/context: add support for systemd.verity_root_data= in the kernel …
Browse files Browse the repository at this point in the history
…cmdline

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 <[email protected]>
Signed-off-by: Gaël PORTAY <[email protected]>
  • Loading branch information
elboulangero authored and jluebbe committed Apr 8, 2021
1 parent 2182bcf commit 2e5d389
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2e5d389

Please sign in to comment.