]> git.ipfire.org Git - thirdparty/mkosi.git/commit
Make SignExpectedPCR tri-valued 1213/head
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Mon, 3 Oct 2022 14:55:57 +0000 (16:55 +0200)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Tue, 4 Oct 2022 12:35:52 +0000 (14:35 +0200)
commit54aeac21c9559538d26486e1e7dba31c4935ed63
tree9f29d65fee5f585680ad5318ba1966960d843018
parent62ffced538b2b8c6a679559500c626d09b6272ed
Make SignExpectedPCR tri-valued

This makes SignEpectedPCR a tri-valued option using aspecial value "auto" in
addition to boolean values, where it will check whether cryptography is
importable and systemd-measure in the PATH and value True in that case and False
else.

For a True value it checks both conditions and fails hard if they are not met.

The checks are kept in the CLI definition so that what comes out stays a clean
boolean value and doesn't leak any decisions into layers further down. This
unfortunately necesitates a custom default value in the tests, so that they are
robust against what's installed on the system they run on and also needs to use
a function for the argparse type=, since actions are not called for every value.
mkosi.md
mkosi/__init__.py
tests/test_config_parser.py