Lennart Poettering [Thu, 28 Apr 2022 20:30:50 +0000 (22:30 +0200)]
Merge pull request #23217 from keszybz/oomd-docs
More cross-references in bootctl/systemctl man pages
Evgeny Vereshchagin [Thu, 28 Apr 2022 01:26:04 +0000 (01:26 +0000)]
ci: bring fatal-meson-warnings back
It's a follow-up to https://github.com/systemd/systemd/pull/23204
v2: replaced xargs with exec as suggested by Jan Janssen
Zbigniew Jędrzejewski-Szmek [Thu, 28 Apr 2022 17:46:08 +0000 (19:46 +0200)]
Merge pull request #23216 from poettering/hwdb-v251-rc2
hwdb: updates for v251-rc2
Zbigniew Jędrzejewski-Szmek [Thu, 28 Apr 2022 15:46:03 +0000 (17:46 +0200)]
Merge pull request #23200 from keszybz/oomd-docs
Extend the documentation for oomd a bit
Zbigniew Jędrzejewski-Szmek [Thu, 28 Apr 2022 15:45:44 +0000 (17:45 +0200)]
TODO: more entries for bootctl
https://bugzilla.redhat.com/show_bug.cgi?id=
2079784#c9
Lennart Poettering [Thu, 28 Apr 2022 15:43:27 +0000 (17:43 +0200)]
hwdb: run "ninja update-hwdb-autosuspend" for v251-rc2
Lennart Poettering [Thu, 28 Apr 2022 15:37:34 +0000 (17:37 +0200)]
hwbd: run "update-hwdb" for v251-rc2
Lennart Poettering [Thu, 28 Apr 2022 15:41:48 +0000 (17:41 +0200)]
hwdb: make sure "ninja update-hwdb" works on f35
let's restore compatibility with pyparsing from fedora 35, i.e.:
python3-pyparsing-2.4.7-9.fc35.noarch
Lennart Poettering [Tue, 26 Apr 2022 08:53:47 +0000 (10:53 +0200)]
update TODO
Lennart Poettering [Thu, 28 Apr 2022 15:16:03 +0000 (17:16 +0200)]
NEWS: updates for 251-rc2
Zbigniew Jędrzejewski-Szmek [Thu, 28 Apr 2022 14:44:40 +0000 (16:44 +0200)]
man: cross-advertize bootctl and systemctl boot loader support
Zbigniew Jędrzejewski-Szmek [Tue, 26 Apr 2022 20:08:02 +0000 (22:08 +0200)]
oomd: "descendent" → "descendant"
The latter is the common spelling apparently.
Zbigniew Jędrzejewski-Szmek [Tue, 26 Apr 2022 20:05:41 +0000 (22:05 +0200)]
man: direct users to systemd-oomd if they read about OOMPolicy
OOMPolicy remains valid, but let's push users for the userspace solution.
Zbigniew Jędrzejewski-Szmek [Tue, 26 Apr 2022 20:04:31 +0000 (22:04 +0200)]
man: beef up the description of systemd-oomd.service
The gist of the description is moved from systemd.resource-control
to systemd-oomd man page. Cross-references to OOMPolicy, memory.oom.group,
oomctl, ManagedOOMSwap and ManagedOOMMemoryPressure are added in all
places.
The descriptions are also more down-to-earth: instead of talking
about "taking action" let's just say "kill". We *might* add configuration
for different actions in the future, but we're not there yet, so let's
just describe what we do now.
Zbigniew Jędrzejewski-Szmek [Thu, 28 Apr 2022 07:38:29 +0000 (09:38 +0200)]
Merge pull request #23204 from bluca/install_tag
meson: add install_tag and build alias for systemd-boot, libsystemd and libudev
Yu Watanabe [Wed, 27 Apr 2022 08:32:21 +0000 (17:32 +0900)]
hwdb: add keyboard mapping for HP ProBook 11G2
Closes #23108.
Luca Boccassi [Wed, 27 Apr 2022 21:00:48 +0000 (22:00 +0100)]
meson: add systemd-boot and systemd-stub build target aliases
Allows to quickly build systemd-boot by itself without having to
reference the full path of the build target:
$ ninja -C foo systemd-stub
ninja: Entering directory `foo'
[21/21] Generating src/boot/efi/linuxx64.efi.stub with a custom command
$ ninja -C foo systemd-boot
ninja: Entering directory `foo'
[10/10] Generating src/boot/efi/systemd-bootx64.efi with a custom command
Luca Boccassi [Wed, 27 Apr 2022 09:54:14 +0000 (10:54 +0100)]
meson: add install_tag to sd-boot, libsystemd and libudev
Allows to 'meson install --tags systemd-boot --no-rebuild' to install only the EFI
binaries, skipping the rest, for a very quick build:
$ ninja src/boot/efi/linuxx64.efi.stub
[21/21] Generating src/boot/efi/linuxx64.efi.stub with a custom command
$ ninja src/boot/efi/systemd-bootx64.efi
[10/10] Generating src/boot/efi/systemd-bootx64.efi with a custom command
$ DESTDIR=/tmp/foo meson install --tags systemd-boot --no-rebuild
Installing src/boot/efi/systemd-bootx64.efi to /tmp/foo/usr/lib/systemd/boot/efi
Requires Meson 0.60 to be used, prints a warning for unknown keyword
in earlier versions, but there's no failure
https://mesonbuild.com/Installing.html#installation-tags
Luca Boccassi [Wed, 27 Apr 2022 17:27:47 +0000 (18:27 +0100)]
Merge pull request #23206 from yuwata/meson-compression
meson: follow-ups about compression method
Zbigniew Jędrzejewski-Szmek [Wed, 27 Apr 2022 14:56:53 +0000 (16:56 +0200)]
Merge pull request #23119 from yuwata/test-sd-device-exclude-bdi
test: exclude "bdi" subsystem
Yu Watanabe [Wed, 27 Apr 2022 11:49:17 +0000 (20:49 +0900)]
meson: also use COMPRESSION_NONE for default compression
Yu Watanabe [Wed, 27 Apr 2022 11:47:38 +0000 (20:47 +0900)]
meson: show default compression method in summary
Zbigniew Jędrzejewski-Szmek [Wed, 27 Apr 2022 08:47:54 +0000 (10:47 +0200)]
Merge pull request #23131 from poettering/shared-compress
move compress.[ch] → src/basic/
Yu Watanabe [Tue, 19 Apr 2022 12:16:53 +0000 (21:16 +0900)]
test: exclude "bdi" subsystem and loop block devices
On several CI environments, it seems that some loop block devices and
corresponding bdi devices are sometimes removed during the test is
running. Let's exclude them.
Fixes #22970.
Yu Watanabe [Mon, 25 Apr 2022 02:20:11 +0000 (11:20 +0900)]
sd-device-enumerator: introduce sd_device_enumerator_add_nomatch_sysname()
Yu Watanabe [Mon, 25 Apr 2022 02:19:56 +0000 (11:19 +0900)]
sd-device-enumerator: use set_fnmatch()
Yu Watanabe [Mon, 25 Apr 2022 02:07:54 +0000 (11:07 +0900)]
set: introduce set_fnmatch()
Lennart Poettering [Tue, 26 Apr 2022 20:52:09 +0000 (22:52 +0200)]
Merge pull request #23161 from yuwata/nss-ipv6-disabled
nss: do not return IPv6 address when IPv6 is disabled
Lennart Poettering [Wed, 20 Apr 2022 14:08:36 +0000 (16:08 +0200)]
journal-verify: tighten check for compression of non-objects
Lennart Poettering [Wed, 20 Apr 2022 14:06:14 +0000 (16:06 +0200)]
compress: make Compression a regular non-sparse enum
Given we have two different types for the journal object flags and the
Compression enum, let's make the latter a regular non-sparse enum, and
thus remove some surprises. We have to convert anyway between the two,
and already do via COMPRESSION_FROM_OBJECT().
Lennart Poettering [Wed, 20 Apr 2022 13:35:28 +0000 (15:35 +0200)]
basic: move compress.[ch] → src/basic/
The compression helpers are used both in journal code and in coredump
code, and there's a good chance we'll use them later for other stuff.
Let's hence move them into src/basic/, to make them a proper internal
API we can use from everywhere where that's desirable. (pstore might be
a candidate, for example)
No real code changes, just some moving around, build system
rearrangements, and stripping of journal-def.h inclusion.
Daniele Medri [Tue, 26 Apr 2022 14:22:27 +0000 (16:22 +0200)]
po: update italian translations
Evgeny Vereshchagin [Fri, 22 Apr 2022 21:06:39 +0000 (21:06 +0000)]
ci: unpin CFLite
The idea was to catch CFLite regressions but since the action itself
pulls the latest docker images it can't be pinned properly and issues
like https://github.com/google/clusterfuzzlite/issues/91 are going to
pop up anyway. Let's unpin it by analogy with CIFuzz and hope it doesn't
break very often.
Zbigniew Jędrzejewski-Szmek [Tue, 26 Apr 2022 06:54:39 +0000 (08:54 +0200)]
oomd: actually fail if configuration is bad
Follow-up for
a858355e4a7168625ec1b9e5d17fdb6a11dfecb8.
Zbigniew Jędrzejewski-Szmek [Mon, 25 Apr 2022 08:57:51 +0000 (10:57 +0200)]
Merge pull request #23160 from keszybz/compress-defines
meson: simplify setting of default compression
wangyuhang [Sun, 24 Apr 2022 07:31:33 +0000 (15:31 +0800)]
test: use cp for journal copying when systemd-journal-remote non-existent
Yu Watanabe [Mon, 25 Apr 2022 01:06:08 +0000 (10:06 +0900)]
tree-wide: Fix typo
Jan Janssen [Sat, 23 Apr 2022 13:53:29 +0000 (15:53 +0200)]
tree-wide: Simplify variable declarations behind #ifdef
Lennart Poettering [Fri, 22 Apr 2022 19:41:17 +0000 (21:41 +0200)]
loopback-setup: tweak message if loopback device is already set up
Frantisek Sumsal [Fri, 22 Apr 2022 16:03:14 +0000 (18:03 +0200)]
test: extend the "hashed" unit names coverage a bit
Follow-up to #22759.
Yu Watanabe [Fri, 22 Apr 2022 18:01:25 +0000 (03:01 +0900)]
udevadm: wait: check if specified path not exist on --remove
Even if the corresponding device node or syspath are already removed,
the specified symlink to the device node may still exist.
Fixes #23166.
Yu Watanabe [Fri, 22 Apr 2022 01:31:55 +0000 (10:31 +0900)]
test: do not accept IPv6 local address if IPv6 is disabled
Yu Watanabe [Fri, 22 Apr 2022 01:31:22 +0000 (10:31 +0900)]
nss-myhostname: do not return IPv6 local address if IPv6 is disabled
MkfsSion [Sun, 17 Apr 2022 07:42:49 +0000 (15:42 +0800)]
cryptenroll,homectl: Introduce --fido2-credential-algorithm option
* Some authenticators(like Yubikey) support credential algorithm other than ES256
* Introduce a new option so users can make use of it
Lance [Fri, 22 Apr 2022 11:22:34 +0000 (04:22 -0700)]
hwdb: Fix rotation for HP Pro Tablet 408 G1
Benjamin Berg [Fri, 22 Apr 2022 13:59:34 +0000 (15:59 +0200)]
hwdb: Remap micmute to f20 for ASUS WMI hotkeys
For micmute userspace handles both micmute and f20, as Xorg cannot
handle the high keycode that the micmute key has. As such, adding the
remapping means that the key will work on Xorg clients and not just when
using wayland.
Lennart Poettering [Fri, 22 Apr 2022 13:00:48 +0000 (15:00 +0200)]
docs: suggest to erase /var/lib/systemd/credential.secret when preparing golden images
Lennart Poettering [Fri, 22 Apr 2022 13:00:30 +0000 (15:00 +0200)]
update TODO
Lennart Poettering [Fri, 22 Apr 2022 13:51:41 +0000 (15:51 +0200)]
Merge pull request #23157 from poettering/execute-refactor-fix
execute: refactor credential passing code, and fix two bugs
Zbigniew Jędrzejewski-Szmek [Fri, 22 Apr 2022 11:10:07 +0000 (13:10 +0200)]
meson: use a single constant for default compression setting
Suggested by Daniele Nicolodi:
https://github.com/systemd/systemd/pull/23160#discussion_r855853716
This is possible only if the macro is never used in #if, but only in C code.
This means that all places that use #if have to be refactored into C, but we
reduce the duplication a bit, and C is nicer to read than preprocessor
conditionals.
Zbigniew Jędrzejewski-Szmek [Thu, 21 Apr 2022 22:24:01 +0000 (00:24 +0200)]
meson: simplify setting of default compression
Follow-up for
da13d2ca0731b413841663052f2cc6832a855334. Instead of having
separate definitions of the bitmask flags, just define DEFAULT_COMPRESSION_FOO=0|1
directly.
(It *should* be possible to do this more simply, but the problem is that
anything that is used in #if cannot refer to C constants or enums. This is the
simplest I could come up with that preserves the property that we don't use #ifdef.)
The return value from compress_blob() is changed to propagate the error instead
of always returning -EOPNOTSUPP. The callers don't care about the specific error
value. compress_blob_*() are changed to return the compression method on success, so
that compress_blob() can be simplified. compress_stream_*() and compress_stream() are
changed in the same way for consistency, even though the callers do not currently use
this information (outside of tests).
Lennart Poettering [Fri, 22 Apr 2022 09:31:00 +0000 (11:31 +0200)]
test: also test nspawn system→service inheritance of creds
Lennart Poettering [Thu, 21 Apr 2022 15:35:38 +0000 (17:35 +0200)]
test: make sure that SetCredential=/LoadCredential fallback won#t regress
Lennart Poettering [Thu, 14 Apr 2022 16:08:36 +0000 (18:08 +0200)]
execute: add more debug logging
Lennart Poettering [Thu, 14 Apr 2022 16:01:28 +0000 (18:01 +0200)]
execute: restore ability that SetCredential= can act as fallback for LoadCredential=
If SetCredential= and LoadCredentials= are combined for the same
credential name, then the former shall act as fallback for the latter in
case the source file does not exist. That's documented, but didn't work.
Let's fix that.
Lennart Poettering [Wed, 13 Apr 2022 21:35:15 +0000 (23:35 +0200)]
execute: restore ability to propagate creds from further up (i.e. container manager and such)
This was broken in
3989bdc1ad7cca4d75c06cdf601fea2cb37ba337 let's
restore the functionality.
Basically, we want that if a relative name is specified as source to
load from we take it relative to the credentials dir the service manager
itself got passed.
Lennart Poettering [Wed, 13 Apr 2022 21:07:26 +0000 (23:07 +0200)]
execute: share error path between reg file/dir credential loading
Lennart Poettering [Wed, 13 Apr 2022 21:05:38 +0000 (23:05 +0200)]
execute: correct comments
This is not done first, but second.
Also, while we are at it, explain why faccessat() is OK here.
Lennart Poettering [Wed, 13 Apr 2022 21:03:22 +0000 (23:03 +0200)]
execute: sort directory entries when loading credentials recursively
Given that the recusive credential loading allows two ways to load the
same credentials, it's important to define a clear order so that it is
always the same one that wins.
i.e. if you use LoadCredential=foobar:/tmp/xyz and there are two files
/tmp/xyz/abc/cde and /tmp/xyz/abc_cde these would both result in a
credential foobar_abc_cde being set, hence it is important to make clear
which one shall win, and that it is always the same one.
Lennart Poettering [Wed, 13 Apr 2022 21:01:16 +0000 (23:01 +0200)]
execute: drop 'seen_creds' set
When checking whether we already loaded a credential before, let's just
use faccessat() in the credential dir we are populating. First of all,
we already do it exactly that way when appliying SetCredential= settings
later. Secondly, this is not performance relevant, and by using
faccessat() things simply become a lot simpler.
Lennart Poettering [Wed, 13 Apr 2022 20:51:13 +0000 (22:51 +0200)]
execute: simplify 'load_creds_args' struct a bit
Given we only need a single field off the ExecLoadCredential structure
we don't have to link it as a whole, but just copy that one bit over
directly, simplifying the struct a bit.
Lennart Poettering [Wed, 13 Apr 2022 20:48:30 +0000 (22:48 +0200)]
execute: let recurse_dir() concate the cred name for us
recurse_dir() allows specifiying a freely choosable initial path to
which to append the subdirs as it descends into the tree. If we pass the
configured id there, recurse_dir() will suffix the subdir to that for
us, so that we don't have to do that manually anymore in the callback,
simplifying things a bit.
Lennart Poettering [Wed, 13 Apr 2022 16:51:02 +0000 (18:51 +0200)]
execute: passing NULL as second argument for recurse_dir() is equivalent to ""
Lennart Poettering [Wed, 13 Apr 2022 16:51:56 +0000 (18:51 +0200)]
execute: debug log if a generated recursive cred name is too long
Lennart Poettering [Wed, 13 Apr 2022 16:43:02 +0000 (18:43 +0200)]
execute: rework load_credential() not to take an ExecLoadCredential object we must synthesize
Let's just simplify the logic and pass the fields we need as regular
arguments, even if that means the function now has a lot. It's otherwise
really weird that we have to fake a local ExecLoadCredential from the
real one.
Lennart Poettering [Wed, 13 Apr 2022 16:52:10 +0000 (18:52 +0200)]
execute: drop double empty line
Lennart Poettering [Wed, 13 Apr 2022 16:51:47 +0000 (18:51 +0200)]
execute: use ASSERT_PTR where appropriate
Lennart Poettering [Thu, 21 Apr 2022 08:37:12 +0000 (10:37 +0200)]
update TODO
Lennart Poettering [Thu, 21 Apr 2022 09:24:37 +0000 (11:24 +0200)]
tpm2-util: if we run in a container, ignore /sys/class/tpmrm/* contents
davijosw [Fri, 22 Apr 2022 01:41:37 +0000 (22:41 -0300)]
hwdb: add resolutions for the Vaio FE14 touchpad (#23136)
Daan De Meyer [Thu, 21 Apr 2022 12:47:23 +0000 (14:47 +0200)]
kernel-install: Skip execution if $KERNEL_INSTALL_BYPASS=1
Daan De Meyer [Wed, 20 Apr 2022 17:10:22 +0000 (19:10 +0200)]
mkosi: Update to latest commit
We recently added caching for the dependencies we build from source
in mkosi's github action which speeds up builds by +-10 minutes. Let's
update to the latest commit so we benefit from this in systemd's mkosi
CI as well.
Evgeny Vereshchagin [Thu, 21 Apr 2022 18:00:43 +0000 (18:00 +0000)]
oss-fuzz: turn off fuzz-introspector
fuzz-introspector passes -fuse-ld=gold and -flto using CFLAGS/LDFLAGS and due to
https://github.com/mesonbuild/meson/issues/6377#issuecomment-
575977919 and
https://github.com/mesonbuild/meson/issues/6377 it doesn't mix well with meson.
It's possible to build systemd with duct tape there using something like
https://github.com/google/oss-fuzz/pull/7583#issuecomment-
1104011067 but
apparently even with gold and lto some parts of systemd are missing from
reports (presumably due to https://github.com/google/oss-fuzz/issues/7598).
Let's just fail here for now to make it clear that fuzz-introspector isn't supported.
Lennart Poettering [Thu, 21 Apr 2022 13:36:03 +0000 (15:36 +0200)]
man: make clear that encrypted credentials are also authenticated
We use authenticated encryption, and that deserves mention. This in
particular relevant as the fact they are authenticated makes the
credentials useful as initrd parameterization items.
Sonali Srivastava [Thu, 21 Apr 2022 11:07:13 +0000 (16:37 +0530)]
hostnamed: update to use new style sd-bus macros
Lennart Poettering [Thu, 14 Apr 2022 15:57:33 +0000 (17:57 +0200)]
bus-unit-util: make sure we can set LoadCredentials= property with a single string
LoadCredentials= in unit files supports a syntax passing a single string
only (in which case the credentials are propagated down from the host).
but systemd-run's --property= setting doesn't allow that yet. Fix that.
Lennart Poettering [Thu, 21 Apr 2022 13:07:45 +0000 (15:07 +0200)]
Merge pull request #23148 from poettering/creds-util-mini-tweaks
creds-util: two minor tweaks
Matthew Blythe [Thu, 21 Apr 2022 06:50:13 +0000 (00:50 -0600)]
hwdb 60-keyboard Add HP/Compaq KBR0133
Lennart Poettering [Thu, 14 Apr 2022 21:19:02 +0000 (23:19 +0200)]
creds-util: upgrade message about TPM2 not working
Lennart Poettering [Thu, 14 Apr 2022 21:18:49 +0000 (23:18 +0200)]
creds-util: also warn about unencrypted creds host key if we are creating it
Previously we'd only warn when we consume it, but it's even more
relevant to warn if we save it to an unencrypted storage location.
Lennart Poettering [Thu, 21 Apr 2022 08:37:12 +0000 (10:37 +0200)]
main: voidify call to kmod_setup()
Lennart Poettering [Wed, 20 Apr 2022 20:30:22 +0000 (22:30 +0200)]
sd-bus: switch to a manual overflow check in sd_bus_track_add_name()
This is generally used in a directly client controllable way, hence we
should handle ref count overflow gracefully, instead of hitting an
assert().
As discussed:
https://github.com/systemd/systemd/pull/23099#discussion_r854341850
Lennart Poettering [Wed, 20 Apr 2022 20:10:43 +0000 (22:10 +0200)]
macro: upgrade ref counting overflow check assert() → assert_se()
The overflow check for ref counting should not be subject to NDEBUG,
hence upgrade assert() → assert_se(). (The check for zero is an
immediate bug in our code, and should be impossible to trigger, hence
it's fine if the check is optimized away if people are crazy enough to
set NDEBUG, so that can stay assert())
https://github.com/systemd/systemd/pull/23099#discussion_r854341850
Lennart Poettering [Wed, 20 Apr 2022 21:19:57 +0000 (23:19 +0200)]
update TODO
Lennart Poettering [Wed, 20 Apr 2022 21:18:02 +0000 (23:18 +0200)]
Merge pull request #23122 from poettering/creds-has-tpm2
tpm2: beef up tpm2 support checks
Lennart Poettering [Thu, 14 Apr 2022 12:38:52 +0000 (14:38 +0200)]
man: update TPM2 PCR documentation
The assignments were partly simply incorrectly documented, partly changed
with
4d32507f5186a89e98093659fbbe386787a97b9f and partly missing.
Moreover kernel 5.17 now measures all initrds to PCR 9 on its own
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=
f046fff8bc4c4d8f8a478022e76e40b818f692df)
Let's correct all this and bring it up-to-date.
And while we are at it extend the docs about this in systemd-stub, with
a new table that indicates which OS resource is protected by which PCR.
Yu Watanabe [Wed, 20 Apr 2022 19:11:19 +0000 (04:11 +0900)]
Merge pull request #23084 from poettering/creds-no-tpm2-fallback
creds: add semi-automatic fallback support for initrd credentials on systems lacking TPM2
Lennart Poettering [Wed, 20 Apr 2022 16:23:05 +0000 (18:23 +0200)]
Merge pull request #23099 from yuwata/sd-bus-track-fixlets
sd-bus: fix counter
Lennart Poettering [Thu, 14 Apr 2022 14:20:45 +0000 (16:20 +0200)]
update TODO
Lennart Poettering [Thu, 14 Apr 2022 12:46:40 +0000 (14:46 +0200)]
creds-util: permit credentials encrypted/signed by fixed zero length keys as fallback for systems lacking TPM2
This is supposed to be useful when generating credentials for immutable
initrd environments, where it is is relevant to support credentials even
on systems lacking a TPM2 chip.
With this, if `systemd-creds encrypt --with-key=auto-initrd` is used a
credential will be encrypted/signed with the TPM2 if it is available and
recognized by the firmware. Otherwise it will be encrypted/signed with
the fixed empty key, thus providing no confidentiality or authenticity.
The idea is that distributions use this mode to generically create
credentials that are as locked down as possible on the specific
platform.
Lennart Poettering [Thu, 14 Apr 2022 13:37:54 +0000 (15:37 +0200)]
creds-util: add an explicit 128bit ID for identifying "automatic" key determination
Previously, when encrypting creds you could pick which key to use for
this via a 128bit ID identifying the key type, and use an all zero ID
for rquesting automatic mode.
Let's change this to use an explicitly picked 128bit ID for automatic
mode, i.e. something other than all zeros. This is in preparation for
adding one further automatic mode with slightly different semantics.
no change in behaviour.
Note that the new 128bit id is never written to disk but only used
internally to indicate a specific case.
Lennart Poettering [Thu, 14 Apr 2022 13:26:02 +0000 (15:26 +0200)]
creds-util: refuse unexpected key types explicitly
Daan De Meyer [Wed, 20 Apr 2022 15:15:40 +0000 (17:15 +0200)]
Merge pull request #23124 from yuwata/fixes-for-post-merge-review
Fixes for post merge review
Lennart Poettering [Tue, 19 Apr 2022 13:08:23 +0000 (15:08 +0200)]
man: document new has-tpm2 verb
Lennart Poettering [Tue, 19 Apr 2022 12:47:02 +0000 (14:47 +0200)]
creds-tool: add new "has-tpm2" verb
Sometimes it's useful from shell scripts to check if we have a working
TPM2 chip around. For example, when putting together encrypted
credentials for the initrd (after all: it might be wise to place the
root pw in a credential for the initrd to consume, but do so only if we
can lock it to the TPM2, and not otherwise, so that we risk nothing).
Hence, let's add a new "systemd-creds has-tpm2" verb: it returns zero if we
have a working TPM2 (which means: supported by kernel + firmware + us),
or non-zero otherwise. Also show which parts are available.
Use-case: in future the 'kernel-install' script should use this when
deciding whether to augment kernels with security sensitive credentials.
Lennart Poettering [Tue, 19 Apr 2022 12:45:20 +0000 (14:45 +0200)]
bootctl: use new tpm2_support() helper to show TPM2 info
Let's improve the output regarding TPM2 support in "bootctl": let's show
whether we have local driver support and/or firmware support, and
colorize it.
(For now, don't show if we natively support TPM2, since the tool is
mostly bout boot time stuff, where it dosn't really matter much what we
do in userspace)
Lennart Poettering [Tue, 19 Apr 2022 12:44:26 +0000 (14:44 +0200)]
condition: rework ConditionSecurity=tpm2 check on top of tpm2_support()
No change in behaviour. Let's just use our new helper here.
Lennart Poettering [Tue, 19 Apr 2022 12:42:27 +0000 (14:42 +0200)]
tpm2-util: add helper that checks for the various facets of TPM2 support
So far we were a bit sloppy regarding checks for TPM2 support. Let's
make things more precise and introduce a single helper that checks for
three axis of TPM2 support: whether we have a loaded kernel driver,
whether the firmware used it, and whether we ourselves are compiled for
it.
This only adds the helper. Follow-up patches will use it at various
places.
Lennart Poettering [Wed, 20 Apr 2022 13:32:10 +0000 (15:32 +0200)]
update TODO
Lennart Poettering [Wed, 20 Apr 2022 12:49:43 +0000 (14:49 +0200)]
update TODO