Commit Graph

79619 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
65ced7578e preset: enable remote verity targets too
Let's make cryptsetup and veritysetup more symmetric, and enable the
remote target for the latter the same way we enable the remote target
for the former by default.
2025-02-25 21:38:39 +01:00
Lennart Poettering
33ab1b5b7e meson: add more space for sections
I ran into the limit with ParticleOS, with 6 profiles, hence I think the
current default value is a bit low. let's bump it 4x, to 120. This is
still a lot lower than 500 or so which Debian uses downstream.

We can look into raising this further should we collide with this again,
but for now, let's try 120 and see how it goes in practice.
2025-02-26 00:33:55 +09:00
Lennart Poettering
b7908e1cb7 update TODO 2025-02-25 14:32:23 +01:00
Daan De Meyer
54b67a669f mkosi: Enable History= option (#36500)
This option makes mkosi "remember" all the CLI options specified on the
command line when building an image. This means they don't need to be
specified again when booting the image afterwards or doing any other
operation on the image with "mkosi xxx".

As an example of how this is useful, currently, when running "mkosi -d
opensuse -f" to build an opensuse image and then running "mkosi sandbox
-- meson test -C build TEST-86-MULTI-UKI-PROFILE", running the test will
try to add virtiofs mounts of the fedora~rawhide build directory on my
machine instead of the opensuse one. With the History= option enabled,
it will use the opensuse tumbleweed directory as expected.
2025-02-25 12:44:41 +01:00
Daan De Meyer
75cf5b0d3a mkosi: Enable History= option
This option makes mkosi "remember" all the CLI options specified on
the command line when building an image. This means they don't need
to be specified again when booting the image afterwards or doing any
other operation on the image with "mkosi xxx".

As an example of how this is useful, currently, when running "mkosi
-d opensuse -f" to build an opensuse image and then running "mkosi
sandbox -- meson test -C build TEST-86-MULTI-UKI-PROFILE", running
the test will try to add virtiofs mounts of the fedora~rawhide build
directory on my machine instead of the opensuse one. With the History=
option enabled, it will use the opensuse tumbleweed directory as expected.

We stop setting --extra-search-path and --output-dir in the integration test
wrapper as these are settings that are "remembered" by enabling the History=
option.
2025-02-25 10:59:50 +01:00
Daan De Meyer
890e1ad318 test: Do not add integration tests if want_tests == 'false' 2025-02-25 10:59:50 +01: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
Daan De Meyer
ba29de84cf TEST-64-UDEV-STORAGE: Stop using mkosi configure scripts
Now that we have mkosi sandbox, meson runs with the mkosi tools tree
mounted (if one is used at all), so we can implement all the qemu feature
checks in meson itself, removing the need for mkosi configure scripts.
2025-02-25 10:13:50 +01:00
Daan De Meyer
2db2cb3034 TEST-53-ISSUE-16347: Implement rtc via custom argument
Let's get rid of the configure script for this use case by just
implementing the necessary logic in integration-test-wrapper.py.
We need to get rid of our usage of configure scripts to allow enabling
the History= setting.
2025-02-25 10:13:48 +01:00
Daan De Meyer
4b8edc68f9 mkosi: Update to latest 2025-02-25 10:13:36 +01: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 Streetman
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
KidGrimes
81cb404a92 hwdb: add axis range corrections for the Lenovo Yoga Slim 7 14ARE05 2025-02-21 22:44:17 +00:00
Luca Boccassi
44e62bc62b mkosi: add libapparmor1 to package list for opensuse
TEST-02-UNITTESTS.sh[4381]: [ 2329.636166] test-dlopen-so[650]: libapparmor.so.1 is not installed: libapparmor.so.1: cannot open shared object file: No such file or directory
TEST-02-UNITTESTS.sh[4381]: [ 2329.636174] test-dlopen-so[650]: Assertion 'dlopen_libapparmor() >= 0' failed at src/test/test-dlopen-so.c:103, function run(). Aborting.

Follow-up for 384949f7de
2025-02-21 22:35:44 +00: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
Lin Jian
7593173c94 docs/CONTROL_GROUP_INTERFACE: fix typo 2025-02-21 16:51:49 +00: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
4a2f437790 Support booting from rootfs acquired via HTTP (#36314)
This extends systemd-import-generator to not only download a disk image
at boot, but also attach it to a loopback device, so that we can boot
from it.

We have most of the pieces already in place, this just polishes some
things, to make this round.

The topmost commit contains example command lines that just work to make
`systemd-vmspawn` boot from a `mkosi serve` call.

Note that this does not address how to get the UKI running on the target
system, this only deals with the later boot phase once the UKI is
already running.

This is WIP, because it lacks docs, and I want to do some more
polishing. But it works great.

Ultimate goal, provide a complete solution so that we also can do uefi
http boot for ukis
2025-02-21 11:26:14 +01:00
Lennart Poettering
898944a51a update TODO 2025-02-21 10:04:15 +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