Vivian Wang [Wed, 17 Dec 2025 06:03:30 +0000 (14:03 +0800)]
stub: Use log_debug if addons has no applicable sections
This can happen expectedly if an addon purely provides .dtbauto
sections, and there's no match for this machine. Reduce the log message
of this case to "debug" level.
rename() may yield ENOTEMPTY rather than EEXIST for existing dir,
so catch that too. Also, both the source and target must be
writable when exchanging.
Test coverage for this logic (i.e. user units with ExecStartPre=)
will be added later.
* 9e31235211 pacman: Make sure hookdir exists
* 20009b7f48 make_image: log systemd-repart *.conf files at the --debug level
* b94b415db9 run: Increase string limit for strace when debugging sandbox
* 9f6d9405d6 Ring the terminal bell after the last image has been built
* b509b4246d Add glob in default initrd to exclude some exotic drivers
* 189394b8b9 Allow KernelModules= globs to also match relative to modules root dir
* 92bd086e4e zypper: add --force-resolution flag
* 3637749702 kmod: Only add fully resolved fw path if it exists
* d41ac276c9 Add details to KernelModulesInitrd= doc
* 1b6960ddb1 Fix SplitArtifacts=repart-definitions for addons
* 07464f38d6 Add log_step call in build_kernel_modules_initrd
* 18f5885362 Use proper constants for ansi colors
* 454c1602b6 mkosi-obs: add SplitArtifacts=repart-definitions and use it
* 9e57461af6 Copy repart definitions to staging directory
* 1acab18874 Add SplitArtifacts=repart-definitions
* c5c5c225e8 mkosi-obs: always include verity certificate
* ac5babb8e0 Revert "Use Path.relative_to instead of Path.parts"
* cbb1daeb76 action: Use environment variables instead of inputs
* 97c81eef72 portable: support split roothash
PCR 16 is intended for debugging purposes, and is the only PCR that can
be reset by software. Let's prefer that for testing.
PCR 11 has a purpose (i.e. kernel is measured there on UKI systems, as
are the boot phases), hence let's not use that for testing.
That should remove any interference of boot time ordering and testing
our tpm code, as we will write to PCR 16 only, and reset it before we
rely on it.
This likely, kind of fixes #39582, but the issue mixes two things, PCR
11 issues on real-life hardware, and PCR 11 isues in our artificial
tests. Only the latter is addressed by this PR, the other issue needs
more debugging, but without logs we cannot do much.
Mike Yuan [Sat, 13 Dec 2025 16:56:51 +0000 (17:56 +0100)]
core/service: set unit log context in helper processes that bypass cgroup
Since these helper processes aren't spawned in the unit cgroup,
let's explicitly attach unit log context so that all logging gets
attributed to the unit, including the ones done in library calls.
Luca Boccassi [Mon, 15 Dec 2025 22:51:16 +0000 (22:51 +0000)]
ci: remove --quiet from mkosi integration suite run
Given the integration tests take a while to run, it is useful to see
at which point it is while it is running. Sometimes only a test
script or such subset is changed, which means there's no need to
wait for the entire suite to run, especially with the sanitizers
job which is super slow.
Luca Boccassi [Mon, 15 Dec 2025 20:51:04 +0000 (20:51 +0000)]
Translations update from Fedora Weblate (#40097)
Translations update from [Fedora
Weblate](https://translate.fedoraproject.org) for
[systemd/main](https://translate.fedoraproject.org/projects/systemd/main/).
Nick Rosbrook [Wed, 10 Dec 2025 21:56:50 +0000 (16:56 -0500)]
mkosi: use qemu from noble-proposed instead of ppa
This is also temporary, but demonstrates that the version of qemu
currently in noble-proposed fixes https://launchpad.net/bugs/2127974,
which will ultimately allow for the fix to be released to noble-updates.
Daan De Meyer [Sun, 14 Dec 2025 12:34:17 +0000 (13:34 +0100)]
namespace: Clone root dir descriptor before use (#39939)
Before doing anything with the root directory file descriptor, let's
make sure we clone it first so that the caller can't mess with mount fd
attributes via mount_setattr() anymore.
We clone during parsing instead of in executor so that the caller can't
mess with the mount fd between invocations.
Daan De Meyer [Fri, 28 Nov 2025 19:28:01 +0000 (20:28 +0100)]
namespace: Clone root dir descriptor before use
Before doing anything with the root directory file descriptor, let's
make sure we clone it first so that the caller can't mess with mount fd
attributes via mount_setattr() anymore.
We clone during parsing instead of in executor so that the caller can't
mess with the mount fd between invocations.
Daan De Meyer [Fri, 28 Nov 2025 18:06:37 +0000 (19:06 +0100)]
mount-util: Add mount_fd_clone() helper
The kernel prevents you from open_tree()'ing an open_tree() fd unless it
was created from the caller's mount namespace. For various use cases, we
want to be able to open_tree() arbitrary mount file descriptors. Turns
out there's a way go get around it by mounting the mount file descriptor
in a throw-away mount namespace and then open_tree()'ing the mount file
descriptor. Let's implement this as a new helper mount_fd_clone() and
add a test for it.
Because move_mount()'ing the original fd makes it pretty useless as it
can't be move_mount()'ed again, we optionally make a second clone which
can replace the original fd so it can be cloned again later.
Kai Lueke [Thu, 11 Dec 2025 10:49:20 +0000 (19:49 +0900)]
sysext: Fix config file support with --root=
Config files for --root= weren't picked up as expected because the
--root= flag got parsed after the config file.
Switch the order of config file and CLI flag parsing while letting the
CLI flags overwrite things set by the config files by tracking state
during parsing.
Daan De Meyer [Wed, 3 Dec 2025 10:08:56 +0000 (11:08 +0100)]
discover-image: Rework image_make()
Currently, image_new() will calculate the image
path as the combination of dir_path and filename,
which is completely broken if filename is absolute
and dir_path is set.
Let's fix this by thoroughly cleaning up the
image_make() interface. Instead of having four
different arguments to pass in the image path,
let's reduce that to two, a file descriptor and a
path. If no file descriptor is provided, we create
own ourselves by opening the given path.
The callsites are updated to pass in an existing file
descriptor when available. Path calculation is moved
to callers instead of image_make().
Daan De Meyer [Thu, 11 Dec 2025 16:21:08 +0000 (17:21 +0100)]
tree-wide: Use meson test -q
meson test output is extremely verbose, printing
a separate line for each successful test. Let's
add -q/--quiet everywhere so it only prints full
lines for skipped and failed tests.
As commented, the unknown values should have been filtered out
in pid1's initial parsing already, and the communication between
pid1 and executor is entirely internal which makes the graceful
practice counterproductive.
Luca Boccassi [Thu, 11 Dec 2025 05:38:26 +0000 (05:38 +0000)]
core: gracefully skip unknown policy designators in RootImagePolicy et al (#40060)
Usually we gracefully ignore unknown configuration parameters, so that
service files can be written by upstreams and used across a variegated
range of distributions with various versions of systemd, to avoid
forcing users to the minimum common denominator and only adding settings
that are supported by the oldest distro supported.
Image policies do not behave like this, and any unknown partition or
policy designator causes the whole unit to fail to parse and a hard
error.
Change it so that parsing RootImagePolicy and friends via unit file or
D-Bus logs but otherwise ignores unknown specifiers, like other options
do.
This allows us to add new specifiers in the future, and users to adopt
them immediately.
Daan De Meyer [Wed, 3 Dec 2025 12:36:52 +0000 (13:36 +0100)]
test: Stop using grep -q in integration test
When a TTY is attached to the test unit, grep -q will generate SIGPIPE
for the previous command in the pipeline which in combo with `pipefail`
will cause the command to fail with exit status 141 which will fail the
test.
Replace with >/dev/null to avoid this from happening.
See also https://www.gnu.org/software/grep/manual/html_node/Usage.html
> There is a related problem with Bash’s set -e -o pipefail. Since grep
> does not always read all its input, a command outputting to a pipe read
> by grep can fail when grep exits before reading all its input, and the
> command’s failure can cause Bash to exit.
tar-util: allow to build without acl support (#39965)
This adds minimal definitions provided by libacl to make tar-util built
without libacl support.
Fixes the following compile error:
```
../src/shared/tar-util.c:62:9: error: unknown type name 'acl_t'
62 | acl_t acl_access, acl_default;
| ^~~~~
```
hwdb: sensor: Remove Lenovo IdeaPad D330 accel mount matrix
Reading values from iio-sensor we are getting bad values. This matrix was added because the panel was a vertical one but the normal position is horizontal and the sensor is not bad oriented.
Removing the matrix ensure we have correct orientation values and prevent from misleads where the incorrect values we were getting messed up.
For example mutter actually is setting incorrect screen rotation for devices with panel orientation quirks.
I'm pretty sure that there are more devices where we have incorrectly "corrected" the sensor values when the only problem was the panel orientation.
Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
resolve: always read /etc/resolv.conf on reload systemd-resolved
When systemd-resolved is used in resolv.conf foreign mode, reloading the
systemd-resolved daemon does not read resolv.conf when not touched since
the last time resolved read the file. Since the DNS servers list is
flushed during a reload, resolved forgets about the servers
in /etc/resolv.conf
When reloading the daemon it is expected that all configuration is
reloaded regardless of the disk timestamps.
Ricardo Salveti [Tue, 9 Dec 2025 19:55:57 +0000 (04:55 +0900)]
boot: handle empty initrd files (#40040)
Commit f8fa4222c9ac3e74e91c64e25e9532c99559cf99 added extra logic to
account for the size of the initrds before allocating the required memory pages,
but missed checking if the initrds were empty before allocating memory.
Extend the initrd options only when the initrd is valid, and add extra
check for validating that there is at least one valid initrd file before
allocating memory, fixing the following crash when booting with empty
initrd files:
Jeremy Kerr [Tue, 9 Dec 2025 13:22:55 +0000 (22:22 +0900)]
udev-builtin-net_id: fix construction of USB specifier-based names
Commit 0bac1ed242 ("tree-wide: Fix constness issues with newer glibc")
split a temporary var in get_usb_specifier to const and non-const
versions, but missed converting a couple of uses. This means we get
names of with components of:
port: uN
config: cC.I
interface: iC.I
instead of:
port: uN
config: cC
interface: iI
This results in net names like enu1c1.0i1.0, as we also no longer hit
the config==1 and interf==0 elision cases.
Change the config portion handling to start from the correct position,
and the earlier check for NULL.
Lukáš Zaoral [Mon, 8 Dec 2025 14:42:40 +0000 (15:42 +0100)]
ukify: prefer compression.zstd when available
Python 3.14 introduced support for zstd in the standard library [1]. Therefore,
let's prefer it when available to decrease the number of necessary external
dependencies.
David Tardon [Fri, 5 Dec 2025 12:09:16 +0000 (13:09 +0100)]
find-esp: replace assert by a runtime check
The path--as a whole--is no longer being opened with O_DIRECTORY, hence
the assertion is not valid.
Reproducer:
# SYSTEMD_RELAX_ESP_CHECKS=1 bootctl list --esp-path=`pwd`/README
Assertion 'S_ISDIR(sxa.stx_mode)' failed at src/shared/find-esp.c:295, function verify_fsroot_dir(). Aborting.
q66 [Sat, 6 Dec 2025 16:53:29 +0000 (17:53 +0100)]
meson: drop ln --relative check
The coreutils release that included this was in 2012. Since then,
systemd requires a newer meson, mostly uses install_symlink, and
so on. Additionally, where it does use this feature, it uses the
'-r' short flag. There are implementations of 'ln' that do have
support for '-r' but no longopts. Things will still work on those
but this check will fail.
* 5a476a92de Use Path.relative_to instead of Path.parts
* 03f41faf9f Update doc for mkosi ssh to mention sd v256 sshd-vsock
* e054976d18 Rewrite note on fw deps of kernel modules in manpage
* a046243a50 Add python3-pefile to fedora tools conf
* 0bab54087e Fix truthy condition
* 01c38544b2 code review
* 563dca41da code review
* 6074d14c0e code review
* 7e842db3b1 Don't discard ordering of include/exclude entries in KernelModules=
* 0047b64785 build(deps): bump github/codeql-action from 4.31.2 to 4.31.6
* f13325bc4b build(deps): bump actions/checkout from 5.0.0 to 6.0.0
* 9ac31d1795 Add zram and nfnetlink to default initrd
* 4bdb47b6da verity: copy signing certificate to /usr/lib/verity.d/
* 8865afde9e Improve manpage output using pandoc lua filter (#4005)
* a425313c58 Pass environment to systemd-sysusers invocation
* 23f09d5de7 Make Ruff check for dangling whitespace
* abeed73d13 qemu: Add missing sandbox
* a05872e523 Ssh=yes maps to Ssh=always, update the manpage
* 79489534ca Warn of mkosi's sshd lacking support in distros' SElinux policy
* 696f99da43 Manpage: Update supported output formats
* 21675c4822 Silence swtpm SHA1 signature deprecation warning
* df53510982 DOC: update Ssh= to note sd-v256+ already generates sshd-vsock
* 50ccef7926 Configure default tools tree with ToolsTree=yes
* 0b701c690d opensuse: do not install openSUSE-release for Leap >= 16.0
* 4bababf421 opensuse: fix mirror URL for Leap >= 16.0
* c43123398c config.py: add config_default_proxy_exclude()
* 07a0a2be67 installer: Only mount configured state subdirs into sandbox
* d5efbf6f8c build(deps): bump github/codeql-action from 3.30.5 to 4.31.2
* 2912ed20d5 PTY forward fixes
* 66dab75259 sandbox: Drop all capabilities that don't make sense in userns
* 8fe5df4400 Respect SYSTEMD_TINT_BACKGROUND and SYSTEMD_ADJUST_TERMINAL_TITLE
* b9d208789d log: Drop konsole hack
* 7fa6eac65c Clarify that mkosi.images is not picked up in mkosi.conf.d
* 08a0f768dd vmspawn: Support BindUser=
* c7c3eaee4e mkosi-vm: Enable universe repository for ubuntu in mkosi-vm
* 688e77f1a8 vmspawn: Use --grow-image
* c47b7fe57b arch: Switch to the newly established fastly mirror
* 7db8f2cda3 Match compressed pacman packages too
* e3b3b93c50 Prevent using Overlay=yes with Format=portable
* 83a25324b3 Make sure apt sources are installed when BaseTrees= is in the mix
* f6fa2fd6a0 test: add unit tests for parents_below() utility function
* 1eafbd8d03 Don't print newlines in stash_terminal_title()
* bbaf92b50e Don't print newline after ansi sequences
* d1b84f5fb3 Look for .sdmagic before we consider a PE binary a UKI/addon
* b4efdbf14e Treat /opt the same as /usr for the sandbox
* 71ffced0f1 Rework PACKAGE_GLOBS to be a PackageManager classmethod
* 29605c2757 Various SPDX and whitespace fixes
Morgan [Sun, 7 Dec 2025 00:48:49 +0000 (09:48 +0900)]
logind: fix initial button state is not fetched when device is registered late (#39978)
If buttons that are not initialized from manager_startup() due to still
being processed by udev, the initial state is not checked. (commit 405be62f05d76f1845f347737b5972158c79dd3e)
This caused a problem which initial "close" state being not recognized
if lid switch of some system getting initialized later.