Commit Graph

85122 Commits

Author SHA1 Message Date
Yu Watanabe
f01daa30f1 docs/MOUNT_REQUIREMENTS: fix typo
Follow-ups for 3e94ae6f1e.
2025-11-25 22:52:10 +09:00
Yu Watanabe
05afbcc377 process-util: fix typo
Follow-up for a08f2ea02d.
2025-11-25 22:52:10 +09:00
Daan De Meyer
d867010caa mkosi: Add hyperscale profile (#39329)
In the CentOS Hyperscale SIG, we maintain a backport of systemd with
its own rpm spec forked from rawhide.

Let's make it easy to build upstream rpms using the Hyperscale spec
by adding a mkosi hyperscale profile.
2025-11-25 13:50:45 +01:00
Daan De Meyer
32b10d0d28 TEST-88-UPGRADE: Stop resolved hook socket before downgrading
Otherwise it'll remain active and cause networkd to get started again
during the downgrade.
2025-11-25 11:49:31 +01:00
Zbigniew Jędrzejewski-Szmek
7fd5f7aade Adjust code to query terminal size and other attributes (#39832) 2025-11-25 11:43:26 +01:00
Daan De Meyer
91af194001 mkosi: Add fixed qemu ppa for Noble temporarily
Until https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2127974
is fixed and rolled out, let's use enr0n's ppa with the fixed qemu
to make CI pass.
2025-11-25 11:02:34 +01:00
Daan De Meyer
c41c4b2bf3 mkosi: Add hyperscale profile
In the CentOS Hyperscale SIG, we maintain a backport of systemd with
its own rpm spec forked from rawhide.

Let's make it easy to build upstream rpms using the Hyperscale spec
by adding a mkosi hyperscale profile.
2025-11-25 11:02:34 +01:00
Daan De Meyer
fb514c2f8f mkosi: Rework how the pkgenv environment variables are set
Instead of including distribution specific files in the subimages,
let's have one common mkosi.pkgenv/ directory that handles all the
matching which is then included in the subimages.

This gives us more control on exactly how we do the matching.
2025-11-25 11:02:34 +01:00
Daan De Meyer
2fe49e8a4c mkosi: update mkosi commit reference to 10544812b35a668d4aac9834c78ee8166e99bc78
* 10544812b3 Don't fix up vmlinuz locations if not required
* 9baf551923 Reduce amount of packages in default image
* 9e1a2f18b8 Add support for assert sections
* c7c6e2c0b1 ubuntu: Switch to devel as the default release
* 0822deb69c Improve logging when we can not extract kernel version from filename
* 1fd7ef3db7 Do not build default initrd if Initrds= is specified
* 611c8b46c8 Don't unconditionally sync when PackageCacheDirectory=/var
* ab37f24d38 README: add link to OBS docs for mkosi builds
* 02bf256ebb completion: add reuse ignore comments
* 10ccb0b04f Make sure not all subimages depend on default-initrd subimage
* 442e1ce0f1 mkosi-tools: systemd-boot-tools is now available for all arches
* 307fc1dba3 action: make it work when used as a submodule
* c37a55f91b config: serialize dataclass instances in our JSONEncoder
* f26cb34155 log: set terminal window title in complete_step while mkosi runs
* 280c78e681 Make sure inherited settings are applied for the default initrd
* ae4f2fd718 Fix typo
* 5644f3e83e build(deps): bump github/codeql-action from 3.29.7 to 3.30.5
* 7d7b26b8c9 build(deps): bump actions/checkout from 4.2.2 to 5.0.0
* e805253447 postmarketos: implement is_kernel_package
* dd51d2e019 postmarketos: provide missing i386-vars.fd
* e23e6de66b Do not relabel files when building extension image
* ab05ead5eb Bump various systemd version checks to 258
* 382cc8b450 preset: drop systemd-networkd-wait-online.service
* 477b6b2ed5 mkosi-initrd: install systemd-container in network profile
* 1d167c0b53 mkosi-initrd: add 89-ethernet.network for network profile
* b1e81dec3a mkosi-initrd: Install libseccomp explicitly
* 3c431a141c opensuse: repository non-oss-debug is invalid
* 62ab363149 ci: add an s390x build job for additional coverage
* 62765f2d07 mailmap: deduplicate Daan
* 47f963f40b Revert "ci: Disable PPC jobs temporarily"
* 6a48f83dda dnf: Always specify --best again
* 3702368616 sandbox: Make all relative paths absolute during argparsing
* a587af0bf7 dnf: Fix /var package cache directory check in package_subdirs()
* 56cdbc25b5 Always use repository metadata from /var package cache directory
* 669d4418a3 Add note on Encrypt=yes to Passphrase= docs
* caa129edae Drop BuildSourcesEphemeral=yes from default image config
* 7edca63478 Add devicetree-auto support for UKI
* 6cb1649074 Don't add ncdu for ppc64-le on Fedora
* e019d2d2a6 ci: Disable PPC jobs temporarily
2025-11-25 11:02:34 +01:00
Yu Watanabe
27971114d5 factory: do not install nsswitch.conf when nss is disabled
When systemd is built with musl, nss modules are not supported,
hence the file is not necessary. Let's not install the file.
2025-11-25 10:48:31 +01:00
Zbigniew Jędrzejewski-Szmek
e698ee5705 basic/terminal-util: ignore failures in cleanup
Some of the functions were ignoring failure in cleanup, others weren't. If we
got a reply, it's better to use it, so ignore failures in cleanup everywhere.
2025-11-24 21:48:28 +01:00
Zbigniew Jędrzejewski-Szmek
46f6742911 basic/terminal-util: operate on one fd in get_default_background_color()
This moves the open call earlier, so that we do any state-changing operations
if we actually managed to open the nonblocking fd. The code is easier to follow
this way and might be more robust.

Suprisingly, this fixes https://github.com/systemd/systemd/issues/39055: it
seems that run0 chowns /dev/stdin (in my case /dev/pts/0) to root:root, and the
second run0 can read and write stdin/stdout throught the already-open fds,
but fd_reopen fails.

Fixes https://github.com/systemd/systemd/issues/39055.
2025-11-24 21:47:57 +01:00
Lennart Poettering
3a5d9ee980 discover-image: use _SD_PATH_INVALID where appropriate
The enum definition only exists for cases like this, use it, instead of
its literal value.

This doesn't effectively change anything, but cleans up the code a bit.
2025-11-24 17:42:04 +00:00
Lennart Poettering
b26e6207cb dissect-image: make verity params for mountfsd_mount_image() optional 2025-11-24 17:41:06 +00:00
Chris Down
e45f2aede9 Revert "nspawn: Fix broken host links for container journals" (#39879)
Reverts systemd/systemd#39727
2025-11-25 01:13:43 +08:00
Daan De Meyer
8c22cb264d core: Make libmount optional (#39878) 2025-11-24 17:19:26 +01:00
Antonio Alvarez Feijoo
7599d26436 run: fix two minor memory leaks
```
==19541== 8 bytes in 1 blocks are still reachable in loss record 1 of 3
==19541==    at 0x4841744: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19541==    by 0x50125C9: strdup (strdup.c:42)
==19541==    by 0x4C55925: getusername_malloc (user-util.c:154)
==19541==    by 0x1121D6: parse_argv_sudo_mode (run.c:1098)
==19541==    by 0x123B13: run (run.c:3032)
==19541==    by 0x124198: main (run.c:3100)
==19541==
==19541== 11 bytes in 1 blocks are still reachable in loss record 2 of 3
==19541==    at 0x4841744: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19541==    by 0x50125C9: strdup (strdup.c:42)
==19541==    by 0x112A9C: parse_argv_sudo_mode (run.c:1182)
==19541==    by 0x123B13: run (run.c:3032)
==19541==    by 0x124198: main (run.c:3100)
```
2025-11-24 16:03:34 +00:00
Lennart Poettering
77a1e2dec6 Revert "nspawn: Fix broken host links for container journals" 2025-11-24 16:34:00 +01:00
Daan De Meyer
5df44d0f6a core: Make libmount optional
Instead of skipping libcore entirely when libmount is not available,
let's only compile out the pieces that need libmount. This makes the
meson logic much less complex and allows systemd-analyze to be built
when libmount is not available.
2025-11-24 16:23:10 +01:00
Daan De Meyer
9c2cd09420 test: Skip protect_kernel_logs test if libmount is missing
libmount is required for setup_namespace() so skip the test if it
is not available.
2025-11-24 16:10:31 +01:00
Lennart Poettering
39c343daa6 nspawn: fix CI 2025-11-24 15:53:47 +01:00
Yu Watanabe
da22ccf48f openssl-util: introduce openssl_extract_public_key() helper function
This splits out common logic in keyutil and systemd-measure.

Note, previously d2i_PUBKEY_fp() was used, but now it is replaced with
d2i_PUBKEY(), as musl seems to not support reading from memstream.
2025-11-24 22:49:55 +09:00
Daan De Meyer
4f6ef13f43 run0: Stay in cwd if --empower is specified without a user
If we run "run0 --empower", the expectation is to stay in the
current working directory, not switch to ~.
2025-11-24 14:39:34 +01:00
Lennart Poettering
c746488537 block dlopen() once we transition into some foreign namespace (#39824)
Let's make sure we never accidentally end up loading code from a foreign
namespace.
2025-11-24 14:14:16 +01:00
Daan De Meyer
d60206c49a meson: Still build libshared even if libmount is disabled (#39871)
Currently, if the libmount feature is disabled, we don't build libshared
and as a result skip building every other executable as well. Among
other things, this makes our nodeps CI builds kind of pointless since
hardly any code will be compiled.

Let's improve on the situation by making libmount properly optional in
libshared. Then, we only skip building the executables that actually
need libmount.
2025-11-24 14:05:29 +01:00
Yu Watanabe
0cc96fc213 test: use log_tests_skipped_errno() at one more place
Follow-up for 12d2abe082.
2025-11-24 21:16:39 +09:00
Daan De Meyer
7336f2c748 meson: Still build libshared even if libmount is disabled
Currently, if the libmount feature is disabled, we don't build
libshared and as a result skip building every other executable as
well. Among other things, this makes our nodeps CI builds kind of
pointless since hardly any code will be compiled.

Let's improve on the situation by making libmount properly optional
in libshared. Then, we only skip building the executables that
actually need libmount.
2025-11-24 13:09:41 +01:00
Daan De Meyer
e910f9bc63 test-reread-partition-table: Don't keep open fds around
Avoids EBUSY from BLKRRPART when built without libblkid support.
2025-11-24 13:09:41 +01:00
Daan De Meyer
dee7dfea1d test-reread-partition-table: Only check for CAP_SYS_ADMIN
We might have CAP_SYS_ADMIN even without being root.
2025-11-24 13:09:41 +01:00
Daan De Meyer
43687c22ab tests: Assume we're running in a chroot if check fails
running_in_chroot() will fail when a test is executed as a non-root
user without CAP_DAC_READ_SEARCH as it won't be able to access
/proc/1/root.

Let's make things more robust by skipping tests if we can't detect
if we're in a chroot or not, since if we can't even detect if we're
in a chroot or not, chances are we're missing the required privileges
to execute the test anyway.
2025-11-24 13:09:41 +01:00
Yu Watanabe
f866ff3df8 tree-wide: replace tab with space, adjust missing or duplicated space 2025-11-24 12:45:06 +01:00
Yu Watanabe
332bce5bd7 oomd: move check if processes can be killed into oomd_cgroup_kill()
This also adds a debuuging log if the check failed.
Addresses https://github.com/systemd/systemd/pull/39773#discussion_r2549439336.

Follow-up for 38e9d40c80.
2025-11-24 12:40:13 +01:00
Luca Boccassi
5da6a8ee6e man,doc: add uapi spec numbers to all links to uapi specs (#39867) 2025-11-24 11:15:09 +00:00
Lennart Poettering
ed3fcaae11 crash-handler: also disable dlopen(), just in case 2025-11-24 11:56:47 +01:00
Lennart Poettering
a08f2ea02d process-util: also disable dlopen() in safe_fork() 2025-11-24 11:56:47 +01:00
Lennart Poettering
9252e26f4c core: load libcryptsetup before forking off child that might need it 2025-11-24 11:56:47 +01:00
Lennart Poettering
c64a486058 sysext: load libraries before forking off worker child 2025-11-24 11:56:47 +01:00
Lennart Poettering
09596e7d1a repart: load libraries before forking off child 2025-11-24 11:56:47 +01:00
Lennart Poettering
52594c3184 udev: load a bunch of libs before we fork off worker processes 2025-11-24 11:56:47 +01:00
Lennart Poettering
5b2f52814b dissect-image: load library before we fork off metadata extractor child process 2025-11-24 11:56:47 +01:00
Lennart Poettering
e683dce1f1 portabled: load a bunch of libs before we fork off a dissector child processes 2025-11-24 11:56:47 +01:00
Lennart Poettering
6069de1ed3 pid1: pull in libmount unconditionally 2025-11-24 11:56:47 +01:00
Lennart Poettering
efaf5a763d execute: load a bunch of libs before we disable dlopen() 2025-11-24 11:56:35 +01:00
Lennart Poettering
800d11c36c nspawn: load three libraries we'll need later before we fork() a child 2025-11-24 11:49:44 +01:00
Lennart Poettering
2c7bdaf9f1 dlfcn-util: let's make our dlopen() code fail if we enter a container namespace
Now that we dlopen() so many deps, it might happen by accident that we
end up dlopen()ening stuff when we entered a container, which we should
really avoid, to not mix host and container libraries.

Let's add a global variable we can set when we want to block dlopen() to
ever succeed. This is then checked primarily in
dlopen_many_sym_or_warn(), where we'll generate EPERM plus a log
message.

There are a couple of other places we invoke dlopen(), without going
through dlopen_many_sym_or_warn(). This adds the same check there.
2025-11-24 09:19:33 +01:00
Craig McLure
ab5a79ff5d hwdb: Add alternative mode for Beacn Mic (#39868)
The Beacn Mic's alt-mode behaves identically to it's primary mode from a
communication perspective, it just presents a different channel
configuration to ALSA.
2025-11-24 15:02:10 +09:00
Lennart Poettering
fc3adbbbcb man: always prefix links to uapi specs with their UAPI.XY spec number
Let's try to establish the spec numbers, by mentioning them in most doc
links.

Follow-up for: https://github.com/uapi-group/specifications/pull/187
2025-11-23 18:09:11 +01:00
Lennart Poettering
81b52a013c docs: reference UAPI specs by their number when linked 2025-11-23 17:16:09 +01:00
Yu Watanabe
19deb47ade firstboot: drop redundant and spurious errno check
Follow-up for 2319154a6b.
2025-11-23 22:36:50 +09:00
Luca Boccassi
941b91600c boot: ensure profile IDs do not get leaked and overwritten when there are tries suffixes
boot_entry_parse_tries() replaces the id, which means the id
with the profile appended is lost (leaked) and replaced by a plain filename
in case there are tries suffixes. This means the wrong order is used in
displaying the entries in the menu, as the main profile is always last
given id_without_profile has the tries suffixes and sorts higher,
while the main profile has no id_without_profile and the id sorts lower
since it does not have the tries suffix.

Follow-up for 4301ad00ef
2025-11-23 11:04:51 +09:00