Commit Graph

51057 Commits

Author SHA1 Message Date
Lennart Poettering
58e359604f analyze: move "has-tpm2" from systemd-creds to systemd-analyze
The verb s not really specific to credential management, it was always a
bit misplaced. Hence move it to systemd-analyze, where we already have
some general TPM related verbs such as "srk" and "pcrs"
2024-09-12 12:56:03 +02:00
Mike Yuan
53c75243af network/wireguard: refuse default key if all zero
Follow-up for fa724cd52c

We attempt to retrieve default key if eqzero(Wireguard.private_key),
but a all zero default key should be refused too.
2024-09-12 09:25:50 +02:00
Lennart Poettering
2b735c7d71 resolvectl: rework StatusMode handling into a switch/case statement 2024-09-11 21:36:50 +02:00
Lennart Poettering
da8540583d resolvectl: rename shallow destructors …_done() 2024-09-11 21:36:36 +02:00
Daan De Meyer
783a15081e Merge pull request #34373 from poettering/resolved-dnssd-move-out
move dnssd configuration file parsing from generic code into dnssd source files
2024-09-11 21:36:24 +02:00
Lennart Poettering
967c84ebb0 resolved: simplify dns_scope_get_n_dns_servers(), don't count each time 2024-09-11 21:36:11 +02:00
Lennart Poettering
6e1fa7516a resolved: use dns_scope_ifindex() at more places
And add a mirroring dns_scope_ifname()
2024-09-11 21:35:58 +02:00
Lennart Poettering
14dc0fc4ef resolved: simplify initialization of DnsScope 2024-09-11 21:35:47 +02:00
Lennart Poettering
8b4fb52462 pcrlock: remove empty components from our list
This is a rework of e7a93e7521: instead of
handling components with n_variants being zero at every step of the way, we instead
remove it from our list after loading all components, given that such a
component simply makes not sense for the rest of our logic.
2024-09-11 21:35:34 +02:00
Lennart Poettering
368051ee6b resolved: use unlinkat() where appropriate 2024-09-11 21:34:51 +02:00
Daan De Meyer
aaa6c6e279 Merge pull request #34377 from DaanDeMeyer/symlinks
repart: Add MakeSymlinks=
2024-09-11 21:34:37 +02:00
Lennart Poettering
e5868783ca resolvectl: show DefaultRoute state in per-link DNS staus info too 2024-09-11 21:14:28 +02:00
Lennart Poettering
118592cc49 pcrlock: correct --help text regarding recovery pin
Fixes: #33917
2024-09-11 21:13:38 +02:00
Lennart Poettering
8d647ed2ff cryptenroll: don't try to get PCR bank if we know the device key
If we operate in "offline" mode, i.e. know the device key, then we will
not have a TPM2 connection, hence don't try to read the PCR bank to use form
it.

We don't need it anyway because we are not going to test unseal things.

Fixes: #33855
2024-09-11 21:07:53 +02:00
Daan De Meyer
c64ddefd5c repart: Add MakeSymlinks=
Similar to MakeDirectories=, but creates symlinks in the filesystem.
2024-09-11 18:45:05 +02:00
Daan De Meyer
e2b0f23713 repart: Add missing parameter comment 2024-09-11 18:44:59 +02:00
Daan De Meyer
bc48bd83d3 repart: Fix memory corruption 2024-09-11 17:52:20 +02:00
Lennart Poettering
8e1c345921 resolved: move dnssd parsers to resolved-dnssd.c
Let's keep only the parsers for the main config in resolved-conf.c
2024-09-11 17:00:03 +02:00
Lennart Poettering
c87afdf23d resolved: move resolved_dnssd_gperf_lookup() prototype definition to resolved-dnssd.h 2024-09-11 16:59:48 +02:00
Daan De Meyer
2232452379 repart: Reuse partition_needs_populate() more 2024-09-11 16:36:47 +02:00
Lennart Poettering
93f5821c95 man: fix help text for systemd-creds tool's "list" verb
I guess this was copy/pasted from sysupdate? Weird though. Fix it. And
also reword "cat" help text to make it more precise.
2024-09-11 15:21:21 +02:00
Lennart Poettering
f9807539b0 pcrlock: log if we generate an "empty" policy
Such a policy won't provide any protection, but it's still entirely fine
to have it like this in various contexts, for example at OS install
time, to allocate the nvindex and reference it in enrollments. However,
it does deserve mention, hence log about it at LOG_NOTICE level.

This is based on a similar patch by Arnaud Patard
<arnaud.patard@collabora.com> proposed at #33663.
2024-09-11 15:14:22 +02:00
Lennart Poettering
c355208d83 tpm2-util: fix whitespace 2024-09-11 10:28:36 +02:00
Lennart Poettering
87f5efdeb0 Merge pull request #34353 from yuwata/timesync-bus-document
timesync: add document for org.freedesktop.timesync1
2024-09-11 10:15:30 +02:00
Lennart Poettering
a482908cbc stub: add StubDevicePartUUID/StubImageIdentifier
These variables closely mirror the existing
LoaderDevicePartUUID/LoaderImageIdentifier variables. But the Stub…
variables indicate the location of the stub/UKI (i.e. of systemd-stub),
while the Loader… variables indicate the location of the boot loader
(i.e. of systemd-boot). (Except of course, there is no boot loader used,
in which case both sets point to the stub/UKI, as a special case).

This actually matters, as we support that sd-boot runs off the ESP,
while a UKI then runs off XBOOTLDR, i.e. two distinct partitions.
2024-09-11 06:48:27 +02:00
Lennart Poettering
77d496c083 stub: tweak setting of common Loader* EFI vars
Let's always check if we have data to set *first*, and only then check
if an EFI var is already set.

Checking for the EFI var is more expensive after all.
2024-09-11 06:48:27 +02:00
Lennart Poettering
66d3605896 bootctl: show new sd-boot/sd-stub feature flags 2024-09-11 06:47:16 +02:00
Maanya Goenka
25d1b96880 src/sysext: Use versioned names when logging extensions used for merge operation
If this is not done, and there are two images, image_1.raw and image_2.raw under
an image.raw.v folder, then the log will say "Using extensions image" instead of
using "Using extensions image_2.raw" which is the desired behavior for v-picked extensions.
2024-09-11 06:44:38 +02:00
Lennart Poettering
41a9a502a1 meson: increase default number of available sections for the stub
Now that we have multi-profile UKIs people likely want to stick more PE
sections into them than before. Hence, bump the number of available PE
section slots to 30 (up from 15). Also, make this configurable at build
time since some folks probably want even more, and others don't want
this at all.

(pre-allocating too many shouldn't matter too much btw, I'd advise
everyone to overshoot, except maybe on the tiniest of embedded boards)
2024-09-11 04:47:00 +09:00
Yu Watanabe
4a851db694 timesync: add support of basic command line options 2024-09-11 04:08:06 +09:00
Yu Watanabe
40108953c5 timesync: use BusObjectImplementation 2024-09-11 04:03:57 +09:00
Lennart Poettering
d794c10d96 cryptsetup: use the new crypt_token_set_external_path() API if available
Let's make use of libcryptsetup's new crypt_token_set_external_path()
API in place of the interposition stuff we have been doing before. Let's
kill it entirely, given that this was a developer feature only anyway
(and guarded by an appropriate ifdef).

Fixes: #30098
2024-09-11 02:56:55 +09:00
Lennart Poettering
34ed064f67 homectl: when chainloading a shell, prefix "-" rather than overriding first char
Login shells are supposed to marked via a dash as first char. We follow
that logic, but right now we simply overwrite the first char of the
shell. That might not be the right choice, given that this turns
"zsh" into "-sh", which suggests some bourne shell process.

Hence, let's correct things, and instead prefix a dash, which should be
safer.

Inspired by findings on https://github.com/systemd/systemd/issues/34153#issuecomment-2338104907
2024-09-10 17:24:21 +02:00
Lennart Poettering
3a2a8585e6 Merge pull request #34339 from poettering/uki-with-many-boot
sd-boot: synthesize one menu entry for each profile of multi-profile UKIs
2024-09-10 16:25:34 +02:00
Yu Watanabe
08491c0cdf Merge pull request #34331 from yuwata/network-netdev-cleanups
network/netdev: several cleanups for attaching/detaching netdev, and setting/getting ifindex from netdev
2024-09-10 22:05:55 +09:00
Tomas Bzatek
34e56246b1 udev/ata_id: export read look-ahead values
Indicates whether the ATA read look-ahead feature is supported
and enabled.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2024-09-10 22:04:30 +09:00
Lennart Poettering
8c0d7222b4 boot: don't hardcode drop-in paths at multiple places
Instead, let's define them once, and pass them through as parameters
everywhere.
2024-09-10 14:38:11 +02:00
Lennart Poettering
382e4da4a5 boot: synthesize a separate menu entry from each .profile section
This iterates through the .profile sections a UKI provides and uses it
to generate multiple menu entries from them, one for each .profile
section.
2024-09-10 14:38:11 +02:00
Yu Watanabe
f49c8e6553 network/state-file: save assigned .netdev file even if the interface is unmanaged
Follow-up for 2cf9b1a0ee.
2024-09-10 19:30:17 +09:00
Yu Watanabe
d0899c6a55 network/vxcan: also manage peer interface name by manager
Then, the Link object for the peer interface can have a reference to the
corresponding NetDev object.
2024-09-10 19:30:17 +09:00
Yu Watanabe
971c0ce85c network/vxcan: refuse when peer and the main interface names are equivalent 2024-09-10 19:30:17 +09:00
Yu Watanabe
2d5f58cf41 network/l2tp: manage l2tp session name by Manager
Then, Link object for an L2TP session can have reference to the
corresponding NetDev object.
2024-09-10 19:30:17 +09:00
Yu Watanabe
121d32b09c network/l2tp: refuse duplicated session name 2024-09-10 19:30:17 +09:00
Yu Watanabe
c480e4cd66 network/l2tp: downgrade log level of several messages
Also, use log_section_warning_errno() where applicable.
2024-09-10 19:30:17 +09:00
Yu Watanabe
909acd37b8 network/veth: also manage peer name by Manager
Then, the Link object for the peer interface can have a reference to the
corresponding NetDev object.
2024-09-10 19:30:17 +09:00
Yu Watanabe
98fbb3b5b0 network/veth: refuse when peer and the main interface names are equivalent 2024-09-10 19:30:17 +09:00
Yu Watanabe
c60cd572bd network/netdev: add attach(), detach(), set_ifindex(), and get_ifindex() to netdev vtable
Currently no vtable sets these functions, but will be used later.
2024-09-10 19:30:17 +09:00
Yu Watanabe
36ca0164ab network/netdev: allow to register the same NetDev object with multiple names
Preparation for later commits.
2024-09-10 19:30:17 +09:00
Yu Watanabe
5dc20e1acd network/netdev: split out netdev_set_ifindex_internal() and _impl()
No functional change, just refactoring and preparation for later
commits.
2024-09-10 19:30:13 +09:00
Yu Watanabe
bfacb8fe1d network/netdev: split out netdev_attach() and netdev_attach_name() from netdev_load_one()
No functional change, just refactoring and preparation for later
commits.
2024-09-10 19:29:05 +09:00