Commit Graph
53488 Commits
Author SHA1 Message Date
Lennart Poettering 810708f4b8 integritysetup: add remote-integritysetup.target to match remote-{crypt|verity}setup.target
Let's make the three subsystems more alike, and add remote-*setup.traget
for all three, enable them all three in the presets, and make them
behave in a similar fashion.
2025-02-25 21:40:05 +01:00
Lennart Poettering 395ac1c448 boot: split out call that adds reboot/poweroff/firmware entries 2025-02-25 21:15:10 +01:00
Lennart Poettering 612bc71210 boot: make secure boot enrollment less special
This is the last entry type that has special handling: with this in
place we now always invoke entry handlers the very same way. via the
.call() method of the BootEntry structure.
2025-02-25 21:15:10 +01:00
Lennart Poettering fb09163a01 boot: move check if secure boot enrollment applies to a single place
Let's check if sb enrollment applies at a single place: inside the
discovery function, and let's not bother with additional checks later.
2025-02-25 21:15:10 +01:00
Lennart Poettering fb6cf4bbb7 boot: make regular entries less special
Let's try to always invoke entries via the call() method of BootEntry
objects, to stick to a single uniform way to do so.
2025-02-25 21:15:10 +01:00
Lennart Poettering d870ae47b7 boot: only save entry for some entry types
Much like the previous one, let's also condition the entry selection
saving on entry types.
2025-02-25 21:14:27 +01:00
Lennart Poettering ae5e7f17d0 boot: only do random seed management for some entry types
Similar to the previous commits, let's carefully condition random seed
management (which might be slow, and simply pointless for various entry
types) on the entry type.
2025-02-25 21:14:27 +01:00
Lennart Poettering 729f3c21c5 boot: only do boot counting management for some menu entries
Let's do boot counting only for some menu entry types, and carefully
list which types those are.
2025-02-25 21:14:27 +01:00
Lennart Poettering 4801e16401 boot: make .call() method of BootEntry more complete
Let's pass some context information to the .call() methods so that it's
sufficient to implement the handlers for all entry types with them.

(This commit doesn't port the various entry types over though, that
happens in later commits.)
2025-02-25 21:14:27 +01:00
Lennart Poettering 95086da39f boot: split out line editor
let's make this beast of boot.c a bit more digestable
2025-02-25 21:08:38 +01:00
Yu Watanabe ed3a95b2fb test-bus-object: check if enumerated objects are sorted 2025-02-25 23:41:20 +09:00
Yu Watanabe 31cdcca8dc sd-bus: sort enumerated child objects
Fixes #8008.
2025-02-25 23:41:20 +09:00
Daan De Meyer a5bfd056c1 bootctl-install: Use i2d_PKCS7() instead of i2d_PKCS7_SIGNED()
For a detached signature, these are equivalent so let's use i2d_PKCS7()
like we do everywhere else.
2025-02-25 09:49:53 +00:00
Yu Watanabe d83bfdd5b0 timesync: add short comment for boolean argument 2025-02-25 13:45:07 +09:00
Yu Watanabe 9c999b53b9 timesync: drop meaningless boolean flag
The boolean flag is always true, as manager_save_time_and_rearm() is
called unconditionally.

Follow-up for 33e82f3ef3.
2025-02-25 13:39:46 +09:00
Yu Watanabe 2960a8cfe8 timesync: use event_reset_time_relative()
No functional change, just refactoring.
2025-02-25 13:29:34 +09:00
Yu Watanabe 1930f5afe6 fuzz: decompress_startswith() may return zero (#36490)
Also, disables fuzz-compress on oss-fuzz.
Fixes #36472.
2025-02-25 11:05:06 +09:00
Luca Boccassi 323213cfea repart: when using erofs and log level is not debug, use --quiet
mkfs.erofs is extremely verbose and will log every single file added
to the filesystem, which is a lot of them when building a rootfs.
2025-02-24 14:55:25 +00:00
Dan StreetmanandLuca Boccassi af69ea714d systemd-keyutil: add verb to conver PKCS#1 to PKCS#7
Add verb that takes a PKCS#1 signature (plain rsa) as input and a
certificates, and outputs a PKCS#7 binary detached signature (p7s),
which is what the kernel dm-verity driver expects.

Co-authored-by: Luca Boccassi <bluca@debian.org>
2025-02-23 14:14:09 +00:00
Daan De Meyer 012fd82d43 fstab-util: port use of setmntent() and friends to libmount (#36489) 2025-02-23 12:21:19 +01:00
Mike Yuan 19e1a908b5 sd-event: pidfdize sd_event_source_send_child_signal()
Follow-up for c6cc7efcd3

The documentation has been updated, but apparently I forgot
to update the function itself...

Also, actually pass flags to pidfd_send_signal(). Previously
it was spuriously ignored.
2025-02-23 12:16:58 +01:00
Yu Watanabe 0656b3a083 fuzz: tentatively disable fuzz-compress on oss-fuzz
It does not work on oss-fuzz for some reasons. See #11018.
2025-02-23 05:37:05 +09:00
Yu Watanabe 339f2f2eeb fuzz: decompress_startswith() may return zero
Fixes #36472.
2025-02-23 05:04:49 +09:00
Yu Watanabe 8e0037fb3b sd-event: always operate on child source via pidfd (#36480) 2025-02-23 04:41:28 +09:00
Mike Yuan 58bf70f925 fstab-util: port use of setmntent() and friends to libmount 2025-02-22 19:26:49 +01:00
Mike Yuan 87f7adb8a6 libmount-util: introduce libmount_parse_fstab() wrapper 2025-02-22 19:26:48 +01:00
Mike Yuan 2f3d986053 fstab-util: join 'filtered' only if requested by caller 2025-02-22 19:26:48 +01:00
Daan De Meyer 66584a9335 sbsign: Don't set bit in SpcPeImageData->flags
Neither sbsign nor pesign set this flag in SpcPeImageData->flags,
which is about which resources should be included specifying "Which
portions of the Windows PE file are hashed." according to the
authenticode spec. However, this is followed by "Although flags is
always present, it is ignored when calculating the file hash for both
signing and verification purposes". So as it doesn't seem to do
anything useful and the other tools don't set any of these flags
either, let's follow suite and not set this flag ourselves either.
2025-02-22 01:05:25 +01:00
Luca Boccassi dad055ee52 Coding style followups (#36476) 2025-02-21 21:58:54 +00:00
Mike Yuan 3ddbc34e15 process-util: refuse FORK_WAIT + FORK_FREEZE combination 2025-02-21 21:35:05 +00:00
Mike Yuan c6cc7efcd3 sd-event: always operate on child source via pidfd
Follow-up for 6e14c46bac

Nowadays a pidfd is guarenteed to be around for child
event sources, hence drop the effectively unused pid-based
branches.

Addresses https://github.com/systemd/systemd/pull/36410#discussion_r1959930716
2025-02-21 18:08:55 +01:00
Mike Yuan 4f63673482 sd-event: assert on hashmap_remove(child.pid)
Follow-up for 54988a27b9
and a342c71d36
2025-02-21 18:08:02 +01:00
Mike Yuan 37149e692a process-util: introduce SIGINFO_CODE_IS_DEAD helper 2025-02-21 18:08:02 +01:00
Mike Yuan db3e0393ea udev-builtin-blkid: merge var definitions, fix grammar
Follow-up for f8825c1364
2025-02-21 16:12:59 +01:00
Mike Yuan 012658fc85 basic/utf8: add missing assertion
Follow-up for 104a6b8c39
2025-02-21 16:12:59 +01:00
Mike Yuan 3ab19c1f0a basic/strv: minor coding style follow-ups
Follow-up for 428146dc89

Addresses https://github.com/systemd/systemd/pull/36271#discussion_r1958334800
2025-02-21 16:12:59 +01:00
Mike Yuan 384949f7de core: dlopen()'ify libapparmor
In Arch Linux we currently have a half-baked apparmor support,
in particular we cannot link systemd to libapparmor for service
context integration, since that will pull apparmor into base system.
Hence, let's turn this into a dlopen dep.

Ref: https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/issues/22
2025-02-21 14:22:51 +01:00
Lennart Poettering fc8f0089bf boot: when we detect that sd-boot is called as NBP, print friendly message
Fixes: #11850
2025-02-21 10:04:15 +01:00
Lennart Poettering 4f3a3b7695 sd-boot: also read type #1 entries from SMBIOS Type #11
With this we can now do:

systemd-vmspawn -n -i foobar.raw -s io.systemd.boot.entries-extra:particleos-current.conf=$'title ParticleOS Current\nuki-url http://example.com/somedir/uki.efi'

Assuming sd-boot is available inside the ESP of foobar.raw a new item
will show up in the boot menu that allows booting directly into the
specified UKI.
2025-02-21 10:04:15 +01:00
Lennart Poettering fab0f6e0fc vmspawn: simplify cmdline_add_vsock() a tiny bit 2025-02-21 10:04:15 +01:00
Lennart Poettering 89cecfb100 vmspawn: add --smbios11= switch for passing arbitrary smbios type #11 strings to vm 2025-02-21 10:04:15 +01:00
Lennart Poettering dde4c13a7f vmspawn: split out code that appends kernel command line into its own helper 2025-02-21 10:04:15 +01:00
Lennart Poettering 1089d0f89e boot: add new 'uki-url' bls type #1 menu items for booting remote UKIs
Companion BLS spec PR:

https://github.com/uapi-group/specifications/pull/135
2025-02-21 10:04:15 +01:00
Lennart Poettering e2a3d56218 boot: add new bls type #1 stanza "uki"
This one is between "efi" and "linux": we'll recognize such entries as
linux, but we'll just invoke them as EFI binaries.

This creates a high-level concept for invoking UKIs via indirection of a
bls type #1 entry, for example to permit invocation from a non-standard
path or for giving entries a different name.

Companion BLS spec PR:

https://github.com/uapi-group/specifications/pull/135

(Let's rename LOADER_UNIFIED_LINUX to LOADER_TYPE2_UKI at the same time
to reduce confusion what is what)
2025-02-21 10:04:15 +01:00
Lennart Poettering 06648d4187 boot: move behaviour checks into per-entry-type helpers 2025-02-21 10:04:15 +01:00
Lennart Poettering 149609cfcb boot: be stricter when filtering out invalid bls #1 entries 2025-02-21 10:04:15 +01:00
Lennart Poettering a6fbfd8db6 boot: bls type #1 with 'efi' stanza are bls type #1 too 2025-02-21 10:04:15 +01:00
Lennart Poettering f684168050 efi: add strcspn16()/strspn16() to efi libs too 2025-02-21 10:04:15 +01:00
Lennart Poettering d9d3e9d6c1 efi-string: add new xstr16_to_ascii() helper 2025-02-21 10:04:15 +01:00
Lennart Poettering e577d7d94a efi: modernize reconnect_all_drivers() a bit 2025-02-21 10:04:15 +01:00