Commit Graph
79959 Commits
Author SHA1 Message Date
Mike Yuan 568bafca50 core/meson: move efi-random.c out of libcore
It's used only in core/main.c
2025-03-08 20:40:23 +01:00
Mike Yuan 5fe2b509aa core/main: remove unused include 2025-03-08 20:40:23 +01:00
Matteo Croce bd0d22c2a5 network: remove useless loop (#36648)
In route_metric_can_update() the loop iterates over the metrics, but
skips all indices except for RTAX_MTU.

Replace it with a simple compare.
2025-03-08 17:39:09 +01:00
Luca Boccassi d9208ff9a4 keyutil: support adding content into PKCS#7 signature (#36663)
Support including the data that was signed inside the PKCS#7 signature.
This creates a self-contained file where the signature of the data can
be verified without any other information, since the file contains the
data, signature, and certificate (which contains the public key used for
the signing).

One use case of this is IPE which requires a PKCS#7 signature that is
not "detached", i.e. includes the IPE configuration that has been
signed.

This also slightly adjusts the test case to use the x509 certificate
inside the PKCS#7 signature instead of supplying it externally during
verification.
2025-03-08 01:42:20 +00:00
Dan Streetman f80bb317f6 keyutil: support adding content into PKCS#7 signature 2025-03-07 18:36:23 -05:00
Lennart Poettering f09e8ccb0b homed: add key management toolchain (#36513)
if Lennart shall dogfood ParticleOS he needs acceptable tooling for
making his homed home dir accessible from his legacy fedora install, and
from local and remote particleos. Let's add explicit support for
scenarios like this:

1. add high level support for enrolling the account signing key from the
fedora install
2. add high level support for "adopting" a local but foreign .home file
on a system
3. add high level support for "registering" a remote user account on a
different system

(this lacks test cases and some docs, hence marked as wip)
2025-03-07 22:19:33 +01:00
Lennart Poettering 36be5dc81c virt: detect "linux,dummy-virt" devicetree VMs (#36655) 2025-03-07 18:24:24 +01:00
Lennart Poettering ce306d5401 add a mime type for *.home LUKS home dir files too (#36662) 2025-03-07 18:24:08 +01:00
Lennart Poettering 1ec2d28b6f update TODO 2025-03-07 18:15:13 +01:00
Lennart Poettering b9f711b66e test: add integration test for the functionality added in this PR 2025-03-07 18:15:10 +01:00
Lennart Poettering 2efffd036e homectl: rearrange --help text with sections
We support so many verbs now, help the user with some structure
2025-03-07 18:15:07 +01:00
Lennart Poettering 0e1ede4b4b homectl: add interface for controlling storage for negative machine ID matches 2025-03-07 18:15:04 +01:00
Lennart Poettering c7a4216509 homed: re-establish inotify watches on SIGUSR1
Let's define a clean way how we can reestablish file watches in homed.
This is a relevant in case we overmount /home/ as a whole. It's very
useful for our testcase in particular.
2025-03-07 18:15:01 +01:00
Lennart Poettering c3f54fcd3b homed: suppress warning if quota is not on on /var/ and elsewhere 2025-03-07 18:14:58 +01:00
Lennart Poettering efe2ce7277 homed: rescan /home/ in more occasions automatically
When unregistering a home there's a chance this "reveals" another home
by the same name in /home/, hence immediately schedule a rescan, the
same way we already schedule it in on remove.

Also, drop the conditionalization when scheduling a rescan during
remove, for the same reasons: a remove might reveal another home, and we
cannot check for that ahead of time. Trying to check is kinda a
pointless optimization anyway, since this is not a frequent operation
and rescanning is not the end of the world.
2025-03-07 18:14:55 +01:00
Lennart Poettering 17f48a8cc7 homectl: making stripping of signatures from user records optional 2025-03-07 18:14:52 +01:00
Lennart Poettering cc14c14782 homectl: also support registering (rather than creating) home directories via system credentials 2025-03-07 18:14:48 +01:00
Lennart Poettering e8801cc5b3 homectl: expose "register" verb to register a user record locally 2025-03-07 18:14:45 +01:00
Lennart Poettering cbf9a1c888 homed: add concept for "adopting" an existing homedir locally
Currently homed scans /home/ via inotify for new .home + .homedir/
popping up to register as local users. Let's also add an explicit way to
request this form of "adoption": a bus call that takes a path and that
makes a home dir activatable locally.

(Usecase: you cross boot between two systems – let's say your traditional
fedora and your ParticleOS – and want to use the same homedir from both:
simply mount the /home dir from the other somewhere, and then hit
"homectl adopt /somewhere/lennart.home" and you have the user locally
too).
2025-03-07 18:14:25 +01:00
Lennart Poettering ce94761deb user-record: add a concept of inverting per-host matching sections in user record
Sometimes it is useful to apply options on all hosts except some. Add a
simple concept for that.
2025-03-07 18:14:20 +01:00
Lennart Poettering 4f00011b68 homectl: add a 'dry-run' mode for registering/creating users
Since this only covers user creation/registration for now, let's hide it
behind an env var. We might reconsider this eventually and make it a
proper switch one day, but who knows, it after all has this "debug tool"
wiff.
2025-03-07 18:14:14 +01:00
Lennart Poettering 87c81a34eb homectl: also import signing keys at firstboot time 2025-03-07 18:14:09 +01:00
Lennart Poettering 88392a1f60 homectl: add signing key management verbs 2025-03-07 18:14:02 +01:00
Lennart Poettering f1b6417fea homed: add apis for managing home signing keys
This makes it easier to actually migrate home directories between
systems.
2025-03-07 18:13:40 +01:00
Lennart Poettering fd0dd2d4bc userdbctl: optionally show user/group data from JSON filerather than from system 2025-03-07 18:13:36 +01:00
Lennart Poettering 6a2097dd78 openssl-util: add helper for converting EVP_PKEY to PEM string
And also give the rverse a bit of love.
2025-03-07 18:13:16 +01:00
Lennart Poettering 7fd5979b83 hostnamectl: show transient hostname before static hostname
The transient one is generally the more relevant one, since it is
typically used to reach this host remotely, and it's what shells show
you. Hence show it first.
2025-03-07 17:12:36 +00:00
Dan Streetman 2d09fd72ea test: run PKCS#7 verification with both internal and external certificates 2025-03-07 11:52:44 -05:00
Lennart Poettering e33564ff4a mime: add mimetype for luks home dir 2025-03-07 17:27:20 +01:00
Lennart Poettering ccc51053f5 mime: use 'addon' icon for sysext ddis 2025-03-07 17:27:20 +01:00
Lennart Poettering dc4cf3e539 rules: tag /dev/tpm0 with "systemd" too
Strictly speaking we don't need to tag these devices, because tpm2-tss
already does so, but given we do this for /dev/tpmrm0, we should
probably do this comprehensively if we rely on this ourselves.

Fixes: #36653
2025-03-07 16:09:32 +01:00
Daan De Meyer 7c94fd1db6 mkosi: Skip other build scripts if we're running clangd 2025-03-07 16:09:03 +01:00
Daan De Meyer f0efc7ef34 mkosi: Switch to --rerun-build-scripts in mkosi.clangd 2025-03-07 16:09:03 +01:00
Daan De Meyer 65ac4d06e0 mkosi: Disable BuildSourcesEphemeral= (#36646)
None of the package specs leave leftover files in the source directory
anymore, so let's stop using BuildSourcesEphemeral=yes and check in CI
that we don't regress.
2025-03-07 15:55:05 +01:00
Daan De Meyer 2e6a041376 mkosi: Disable BuildSourcesEphemeral=
Let's stop using BuildSourcesEphemeral= and instead make sure we don't
generate any auxiliary files during the mkosi build process.

We achieve this through a combination of trap to remove any new files
we create and bind mounts from /tmp over existing files whenever we need
to modify an existing file.

We also add a CI step to ensure we don't regress
2025-03-07 15:28:53 +01:00
Daan De Meyer 3a16b02873 opensuse: Drop workarounds
None of these should be needed anymore.
2025-03-07 15:28:51 +01:00
Lennart Poettering 600e135a0b virt: detect "linux,dummy-virt" devicetree VMs
So apparently "linux,dummy-virt" is a devicetree in popular use by
various hypervisors, including crosvm:

https://github.com/google/crosvm/blob/e5d7a64d377d00b9b96bc026548769ab59cf216b/aarch64/src/fdt.rs#L692

and qemu:

https://github.com/qemu/qemu/blob/98c7362b1efe651327385a25874a73e008c6549e/hw/arm/virt.c#L283

and that's because the kernel ships support for that natively:

https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/linux%2Cdummy-virt.yaml

It's explicitly for using in virtualization. Hence it's suitable for
detecting it as generic fallback.

This hence adds the check, similar to how we already look for one other
qemu-specific devicetree.

I ran into this while playing around with the new Pixel "Linux Terminal"
app from google which runs a Debian in a crosvm apparently. So far
systemd didn't recognize execution in it at all. Let's at least
recognize it as VM at all, even if this doesn't recognize it as
crosvm.
2025-03-07 15:18:08 +01:00
Lennart Poettering 4d53d76f5e virt: some modernizations
Reduce scope of certain allocations, add more debug logging, and improve
some log messages.
2025-03-07 15:11:09 +01:00
Lennart Poettering f63a4ef4a0 update TODO 2025-03-07 14:59:29 +01:00
Lennart Poettering 60cc2d54e0 pid1: lower log level if BPF LSM is not available
Currently, if you boot PID 1 in a container you always see a complaint
that BPF LSM won't work. That's fine, and log worthy, but probably not
above debug level. After all this is a really common case, and we should
gracefully adopt to our execution environment.
2025-03-07 13:25:04 +00:00
Daan De Meyer b9ad203e05 mkosi: update fedora commit reference
* 38b41a729e Clean up debuginfo files as well in %clean
* 7bc5883654 Fix missing question mark
* d22561d59e Also drop auxiliary files related to sysusers compat
* e825459f2d Change python-zstd depenedency to python-zstandard
* 0a3907745e Version 257.4
* 1bdfa29ce2 Neuter sysusers macros
2025-03-07 13:38:00 +01:00
Luca Boccassi ab943600e9 load-fragment: Fix config_parse_namespace_flags() for DelegateNamespaces= (#36633)
Boolean values have to be handled separately for RestrictNamespaces=
because
they get stored in a field with reverse meaning (which namespaces are
retained),
so let's check which field we're parsing and set the proper value
accordingly.
2025-03-07 11:58:13 +00:00
Daan De Meyer 666062c07a core: Debug log if we cannot change the controlling terminal 2025-03-07 10:37:26 +01:00
Luca Boccassi cb26206f2f hostnamectl: show image info in hostnamectl (#36638)
On image-based systems these properties are quite fundamental, hence
show them in the hostnamed output.
2025-03-06 22:36:20 +00:00
Lennart Poettering 10b8d65f3f dissect: accept --usr-hash=… too, similar to --root-hash=…
This addresses an omission, given that we have both kinds of hashes
these days.
2025-03-06 23:35:31 +01:00
Дамјан Георгиевски 299b70f85a add vsock-mux/* in ssh config drop-in
https://github.com/systemd/systemd/pull/32941
added support for firecracker/cloud-hypervisor and
their unix-domain socket to AF_VSOCK multiplex.

but I forgot to add the pattern in the ssh config drop-in.
fix it now!
2025-03-06 22:34:34 +00:00
Daan De Meyer cbcaf9f47e TEST-13-NSPAWN: Set TERM=dumb when calling machinectl shell
We only consider something not a tty if it's not connected to a tty
and not connected to /dev/null, so let's use the environment variable
instead to tell machinectl shell that it shouldn't do any of its TTY
stuff.
2025-03-06 22:33:54 +00:00
Lennart Poettering 4efd46c44b terminal-util: during terminal reset clear from beginning of line to end of screen
tianocore does some weird shit with its terminal emulation and regular
fills half the terminal with grey background and then invokes us with
this not cleared up. Hence let us clear this up for it: as part of the
ansi sequence based reset let's position the cursor explicitly at the
beginning of the current line, and erase everything till the end of the
screen. This makes boot output in tianocore vms much much cleaner.

Note that this does *not* erase any terminal output *before* the cursor
position where we take over, because that typically contains valuable
information still we should not erase.
2025-03-06 22:32:32 +00:00
Lennart Poettering 4d44670dc6 update TODO 2025-03-06 23:11:20 +01:00
Lennart Poettering 457f4cfbba update TODO 2025-03-06 22:32:30 +01:00