]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 months agocore/condition: fix segfault when key not found in os-release
Zbigniew Jędrzejewski-Szmek [Thu, 13 Feb 2025 14:49:50 +0000 (15:49 +0100)] 
core/condition: fix segfault when key not found in os-release

'ConditionOSRelease=|ID_LIKE$=*rhel*' results in a segfault.
The key 'ID_LIKE' is not present in Fedora's os-release file.

I think the most reasonable behaviour is to treat missing keys as empty.
This matches the "shell-like" sprit, since in a shell empty keys would
by default be treated as empty too. Thus, "ID_LIKE=" would match, if
ID_LIKE is not present in the file, and ID_LIKE=!$foo" would also match.
The other option would be to make those matches fail, but I think that'd
make the feature harder to use, esp. with negative matches.

Documentation is updated to clarify the new behaviour.

https://bugzilla.redhat.com/show_bug.cgi?id=2345544
(cherry picked from commit de02b551adcf74e5677454fd36bf7653b1a4def1)

9 months agomkosi: Update to latest
Daan De Meyer [Wed, 12 Feb 2025 10:09:36 +0000 (11:09 +0100)] 
mkosi: Update to latest

In https://github.com/systemd/mkosi/pull/3497, mkosi has started parsing
options passed after the verb as regular mkosi options instead of options
for the invoked command. We adapt to this change by adding '--' as a delimiter
everywhere where required.

(cherry picked from commit b429f82eaf774d9b9f67c201770074a9ec72647e)

9 months agoukify: Calculate section size more correctly
Daan De Meyer [Wed, 29 Jan 2025 13:44:27 +0000 (14:44 +0100)] 
ukify: Calculate section size more correctly

We should only use Misc_VirtualSize if it's smaller than SizeOfRawData,
since in that case it'll be the non-aligned section size. Otherwise we
have to use SizeOfRawData to get the size on disk.

(cherry picked from commit 33b25fa11c408ae40f2aa4300220504329a23a52)

9 months agoukify: print debug/progress messages to stderr
Luca Boccassi [Sun, 19 Jan 2025 15:42:47 +0000 (15:42 +0000)] 
ukify: print debug/progress messages to stderr

Otherwise json will be interleaved with plain text messages

(cherry picked from commit 7d64e2f368ec7c683fee95d21f527c406b8eb5e6)

9 months agologin: Queue session for garbage collection on leader death
msizanoen [Wed, 12 Feb 2025 14:27:25 +0000 (21:27 +0700)] 
login: Queue session for garbage collection on leader death

This ensures sessions are cleaned up properly in case the user service
manager was manually stopped.

(cherry picked from commit a6bccda28d398925397d3a8f0c7491ba03941f23)

9 months agologin: Continue watching leader pidfd after stop
msizanoen [Wed, 12 Feb 2025 15:09:01 +0000 (22:09 +0700)] 
login: Continue watching leader pidfd after stop

This ensures that garbage collection will be triggered when the leader
process dies.

(cherry picked from commit b2a4109031c1bd79c498f8642df150deeebe1708)

9 months agoudev-watch: do not try to remove invalid watch handle
Yu Watanabe [Wed, 12 Feb 2025 00:23:33 +0000 (09:23 +0900)] 
udev-watch: do not try to remove invalid watch handle

When a new device is processed, there should be no watch handle for
the device, hence udev_watch_clear() provides -1. Let's not try to call
inotify_rm_watch() in that case.

This should not change any behavior. Just for suppressing spurious
debugging log:
=====
(udev-worker)[3626140]: zram1: Removing watch handle -1.
=====

(cherry picked from commit b3b442062045eac61a9dd3ed73b650dfb5be0b46)

9 months agoudev-watch: mention that the failure is ignored
Yu Watanabe [Wed, 12 Feb 2025 00:22:49 +0000 (09:22 +0900)] 
udev-watch: mention that the failure is ignored

(cherry picked from commit a52aad3b4bb735a22ce67110142d135819589a87)

9 months agoudev-worker: add debugging log about success of flock() for whole block device
Yu Watanabe [Wed, 12 Feb 2025 00:20:51 +0000 (09:20 +0900)] 
udev-worker: add debugging log about success of flock() for whole block device

(cherry picked from commit 951def0e276c041a262b3f147bb42206195fe13e)

9 months agotmpfiles: fix copypasta in create_symlink() (FIFO -> symlink)
Mike Yuan [Sun, 9 Feb 2025 14:38:05 +0000 (15:38 +0100)] 
tmpfiles: fix copypasta in create_symlink() (FIFO -> symlink)

(cherry picked from commit 6f91e7a3bea2c5046354b31cb650b54e3b2884d5)

9 months agoukify: do not fail if pefile complains about hardcoded 256MB limit
Luca Boccassi [Thu, 30 Jan 2025 01:19:59 +0000 (01:19 +0000)] 
ukify: do not fail if pefile complains about hardcoded 256MB limit

pefile has an hardcoded limit to 256MB per section:

https://github.com/erocarrera/pefile/issues/396

When building an initrd with large firmware files and
lots of kernel modules, this limit can be reached.
Skip over those warnings.

(cherry picked from commit 32caed550f5a81eb87d2e39bc83917df2898d844)

9 months agoimport: update to current fedora keyring
Lennart Poettering [Fri, 7 Feb 2025 13:58:29 +0000 (14:58 +0100)] 
import: update to current fedora keyring

Add a bunch of more released keys. Kinda a follow-up for c8c5ce5772b08da0ad317331b1f4929c1b466ae0

(cherry picked from commit 8135d37f81917f2a7f98a52bdae92eae5878946d)

9 months agoimport-pubring.gpg: add openSUSE build key
Thorsten Kukuk [Fri, 7 Feb 2025 13:36:06 +0000 (14:36 +0100)] 
import-pubring.gpg: add openSUSE build key

(cherry picked from commit c8c5ce5772b08da0ad317331b1f4929c1b466ae0)

9 months agostub: Mention that VirtualSize should be <= SizeOfRawData
Daan De Meyer [Tue, 4 Feb 2025 13:52:02 +0000 (14:52 +0100)] 
stub: Mention that VirtualSize should be <= SizeOfRawData

(cherry picked from commit 2443b4d9a17787fd0a63d6591fbdb74650c43994)

9 months agomissing_sched: add CLONE_PIDFD
Michael Olbrich [Sun, 9 Feb 2025 12:32:36 +0000 (13:32 +0100)] 
missing_sched: add CLONE_PIDFD

CLONE_PIDFD was introduced in v5.2 and in sched.h in glibc-2.31 so
without this, building with older version fails with:

src/basic/raw-clone.h:41:108: error: 'CLONE_PIDFD' undeclared (first use in this function); did you mean 'CLONE_FILES'?

(cherry picked from commit e91c5cf06ab7ca9e5576c6feac5f743927f2b063)

9 months agobootctl: minor reordering of fields in output
Lennart Poettering [Sun, 9 Feb 2025 22:34:29 +0000 (23:34 +0100)] 
bootctl: minor reordering of fields in output

Let's move the currently used/default/oneshot entry output after the
basic info about the boot loader itself, since conceptually these are
objects kinda "one level down" from the boot loader perspective. Hence,
let's *first* show all info about the boot loader itself before we
display the objects it manages.

This is just a trivial change in output, just swaps th elines for these
fields with the ones showing where the boot loader is installed.

(cherry picked from commit af5b961ad8f22be04f47c1c0e729b1e6fd78b423)

9 months agobootctl: suppress output of empty partition info if we also have no idea about EFI...
Lennart Poettering [Sun, 9 Feb 2025 22:23:38 +0000 (23:23 +0100)] 
bootctl: suppress output of empty partition info if we also have no idea about EFI binary path

So far we'd output both the partition and the binary path always, even
if we didn't know either (but in that case show empty information).
Let's address this, and show partition info only if we know it, or if we
know the EFI binary path, but suppress both if we know neither.

Note that we'll show the partition info if we don't know it still if we
know the EFI binary path used for boot, since it is relative to the
partition of course, and hence it's really strange to know one but not
the other, hence it deserves some mentioning in the output.

(cherry picked from commit df418fa234a5b12e302a336df82c97f33871ae35)

9 months agobootctl: also shown whether stub loader partition data was passed
Lennart Poettering [Sun, 9 Feb 2025 22:21:08 +0000 (23:21 +0100)] 
bootctl: also shown whether stub loader partition data was passed

Let's make the stub and loader output sections more alike, and say in
both cases whether we recieved that data from the boot phase or not the
same way.

(cherry picked from commit 26bfd97216ab55664214d1e0fac7065e5573a36b)

9 months agobootctl: fix potential uninitialized memory access
Lennart Poettering [Sun, 9 Feb 2025 08:53:39 +0000 (09:53 +0100)] 
bootctl: fix potential uninitialized memory access

And while we are at it, let' get rid of have_xyz_partition_uuid
variables, to simplify things.

(cherry picked from commit df28afe9b2de9e480121c25f222fa487fed927ce)

9 months agoupdate-utmp: do not give up if the first attempt at connecting bus failed
Yu Watanabe [Wed, 18 Dec 2024 13:27:29 +0000 (22:27 +0900)] 
update-utmp: do not give up if the first attempt at connecting bus failed

Otherwise, the program exits with failure if the first attempt in run() failed:
```
Dec 18 20:27:37 systemd-update-utmp[254]: Bus n/a: changing state UNSET → OPENING
Dec 18 20:27:37 systemd-update-utmp[254]: sd-bus: starting bus by connecting to /run/systemd/private...
Dec 18 20:27:37 systemd-update-utmp[254]: Bus n/a: changing state OPENING → CLOSED
Dec 18 20:27:37 systemd-update-utmp[254]: Failed to get D-Bus connection: Connection refused
```

(cherry picked from commit 85d040dabd2cc67c89b7ed6157429b8f6f2240f4)

9 months agoudevadm-test: fix gid check
Yu Watanabe [Fri, 7 Feb 2025 02:07:37 +0000 (11:07 +0900)] 
udevadm-test: fix gid check

Fixes a bug introduced by 03b6879f4d45c49264708aef872fd05af30ddcf0.

Based on the upstream commit e66d4ea31ad3812fdd7a0f1cdcc3b941cedf542a.

9 months agohwdb: update to main@{2025-02-07}
Luca Boccassi [Fri, 7 Feb 2025 23:08:10 +0000 (23:08 +0000)] 
hwdb: update to main@{2025-02-07}

git restore -s origin/main hwdb.d/ test/hwdb.d

9 months agohwdb: Make remote controllable lights work out-of-the-box
Bastien Nocera [Thu, 12 Dec 2024 13:23:46 +0000 (14:23 +0100)] 
hwdb: Make remote controllable lights work out-of-the-box

Give access to USB/Bluetooth lights such as the Logitech Litra family of
devices.

The Logitech devices in particular are accessible through USB
and Bluetooth.

(cherry picked from commit 106f64cbd66b8aa76333c3f11177f53e79e2cd82)

9 months agomeson: fix suite of alignment check tests
Yu Watanabe [Fri, 7 Feb 2025 17:20:02 +0000 (02:20 +0900)] 
meson: fix suite of alignment check tests

Follow-up for 97318131fd06a5bc35454da81dcbbc84f16d9940.

By default, suite of each built test is determined by the directory of
the source file. Hence, before the mentioned commit, all tests in
src/boot/efi/ are in the 'efi' suite. The commit changed the directory
tree, but forgot to update the name of the test suite.

(cherry picked from commit 576e98a72c2f6b0145c63c3f3fec1b9194a60539)

9 months agomeson: allow to customize the access mode for tty/pts devices
Yu Watanabe [Mon, 16 Dec 2024 02:50:53 +0000 (11:50 +0900)] 
meson: allow to customize the access mode for tty/pts devices

Then, switch the default value to "0600", due to general security
concerns about terminals being written to by other users.

Closing #35599.

Backport note: the default is changed back to 0620 to keep backward
compatbility intact for the purpose of backporting. This lets
security-conscious users fix  the issue if they want to, without
affecting users that do not want changes in the stable branches.

(cherry picked from commit a4d18914751e687c9e44f22fe4e5f95b843a45c8)

9 months agotest-network: add test case for requesting routing policy rules by multiple interfaces
Yu Watanabe [Tue, 4 Feb 2025 00:45:45 +0000 (09:45 +0900)] 
test-network: add test case for requesting routing policy rules by multiple interfaces

For issue #36244.

(cherry picked from commit f7ae28fcec9513435f8258431b686fbaf846915b)

9 months agonetwork: allow to configure routing policy rule even if requesting interface is not...
Yu Watanabe [Tue, 4 Feb 2025 03:07:21 +0000 (12:07 +0900)] 
network: allow to configure routing policy rule even if requesting interface is not activated yet

In the kernel, all routing policy rules are not assigned to any interface,
and we can configure them even if the relevant interface is down state.

Fixes a regression caused by 4f8b153d903fd4a6e8d7d3e49113582d70d1525a (v257).
Fixes #36244.

(cherry picked from commit 5078e36632c68f4578cf7507ee14d9ada207983f)

9 months agotest-network: add test case for issue #35874
Yu Watanabe [Wed, 5 Feb 2025 00:40:31 +0000 (09:40 +0900)] 
test-network: add test case for issue #35874

(cherry picked from commit a10172b0355f3ff5c301010d81aea1f2fba986e7)

9 months agonetwork/routing-policy-rule: fix compare func
Yu Watanabe [Wed, 5 Feb 2025 00:14:51 +0000 (09:14 +0900)] 
network/routing-policy-rule: fix compare func

Previously, when comparing an existing and requested routing policy
rules, `all` flag was unset, thus the from and to addresses in the two
rules were not compared. Hence, a new request with from and/or to
addresses might be considered as it already exists even the addresses of
existing one were different from the newly requested one.

All existing rules have valid family, i.e. AF_INET or AF_INET6. And,
all requesting rules with from and/or to addresses also have a valid
family. Hence, even `all` flag is unset, the addresses can be and must
be compared in that case.

Fixes a regression caused by fc58350aa464cd2414b6fe9fec089412120c7d52 (v257).
Fixes #35874.

(cherry picked from commit bc45d9c9592d3fcd24894199be1902704f48d62c)

9 months agouserdb: reset errno before getpwent()
Lennart Poettering [Wed, 22 Jan 2025 15:44:12 +0000 (16:44 +0100)] 
userdb: reset errno before getpwent()

errno handling for NSS is always a bit weird since NSS modules generally
are not particularly careful with it. Hence let's initialize errno
explicitly before we invoke getpwent() so that we know it's in a
reasonable state afterwards on failure, or zero if not.

We do this in most places we use NSS, including in userdb when it comes
to getgrent(), just for getpwent() we don't so far. Address that.

(cherry picked from commit 83e3b96d0a3b665b7b7a291500fa354a7760a917)

9 months agouserdbctl: don't expect argument to --fuzzy
Lennart Poettering [Wed, 22 Jan 2025 10:55:24 +0000 (11:55 +0100)] 
userdbctl: don't expect argument to --fuzzy

The getopt() parser was completely wrong, it expected an argument where
wasn't expected or processes.

The test cases only passed by accident because they use the "user" verb
which is also the default verb. It would be accidently read as argument
for --fuzzy and ignored.

Fix that.

(cherry picked from commit 165275fe803d0d001a0991014da928e44ed25941)

9 months agomkosi: Work around regression in opensuse rpm 4.20 release
Daan De Meyer [Fri, 7 Feb 2025 10:37:34 +0000 (11:37 +0100)] 
mkosi: Work around regression in opensuse rpm 4.20 release

The rpm 4.20 release introduces the following downstream
change in /usr/lib/rpm/macros:

```
%buildroot              %{_builddir}/%{NAME}-%{VERSION}-build/BUILDROOT
```

This definition is broken as rpm internally does the following
since 4.20 to calculate the buildroot:

```
char *bn = rpmExpand("%{NAME}-%{VERSION}-build", NULL);
/* Tilde and caret in paths are evil, convert to underscores */
for (char *t = bn; *t; t++) {
    if (*t == '^' || *t == '~')
        *t = '_';
    }
```

This has broken our upstream opensuse CI builds in systemd as
we do the following to fetch the list of unpackaged files by the rpm build:

```
rpmbuild
...
--define "__check_files sh -c '$(rpm --define "_topdir /var/tmp" --eval %__check_files) | tee /tmp/unpackaged-files'"
...
```

which stopped working because the check files script tries
to look for unpackaged files in the "/var/tmp/BUILD/systemd-258~devel-build/BUILDROOT"
directory (%buildroot) whereas it should be looking in "/var/tmp/BUILD/systemd-258_devel-build/BUILDROOT".

Let's remove the %buildroot compat definition until the bug is
addressed in opensuse tumbleweed.

(cherry picked from commit facc03dc973cc9051c2bde16d7084296e862c0e0)

9 months agomkosi: Fix section for BuildSourcesEphemeral=
Daan De Meyer [Fri, 7 Feb 2025 11:04:15 +0000 (12:04 +0100)] 
mkosi: Fix section for BuildSourcesEphemeral=

Followup for f26ded4e31b433d3bb6ee4dc3e02e28f7a1d223f

(cherry picked from commit 398d435f3c14959041cc690d2e71b388c1b94ccd)

9 months agomkosi: Install strace in build image
Daan De Meyer [Fri, 7 Feb 2025 10:36:26 +0000 (11:36 +0100)] 
mkosi: Install strace in build image

Useful to debug regressions in rpm or other package managers.

(cherry picked from commit e421fb46d8621ecf5a6b527772b3f56a72ddf9ff)

9 months agocore/namespace: relabel bind mount source based on the target path
Michal Sekletar [Tue, 21 Jan 2025 14:31:14 +0000 (15:31 +0100)] 
core/namespace: relabel bind mount source based on the target path

Some bind mounts, e.g. /tmp bind mount when PrivateTmp=disconnected,
must be explicitly relabeled because now it would have incorrect SELinux
label. /tmp is expected to have well-known SELinux label, tmp_t. Now it
has label inherited from the source directory of the bind mount.

(cherry picked from commit a128273f7b5e50ce5929ccabda5c2810b7eedd2d)

9 months agomeson: also skip uid/gid check for nobody user/group when id command not found
Yu Watanabe [Fri, 7 Feb 2025 02:36:46 +0000 (11:36 +0900)] 
meson: also skip uid/gid check for nobody user/group when id command not found

Follow-up for 8b413ae4060b21ed4712fdad7eba195890740756.

(cherry picked from commit be4f4c4343f05f2b53deb326c241c6031c36c911)

9 months agomeson: Skip getent when it's not found
Vyacheslav Yurkov [Wed, 5 Feb 2025 07:14:20 +0000 (07:14 +0000)] 
meson: Skip getent when it's not found

(cherry picked from commit 8b413ae4060b21ed4712fdad7eba195890740756)

9 months agomkosi: extend util-linux-script config drop-in to F43
Luca Boccassi [Thu, 6 Feb 2025 14:59:28 +0000 (14:59 +0000)] 
mkosi: extend util-linux-script config drop-in to F43

Fixes packit test

TEST-74-AUX-UTILS.sh[1104]: + script -ec 'networkctl edit --runtime "$NETWORK_NAME"' /dev/null
TEST-74-AUX-UTILS.sh[1154]: .//usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.networkctl.sh: line 53: script: command not found

(cherry picked from commit 01b45354559b2fc651441b6b0025ae28daddd06e)

9 months agovmspawn: ignore failure from sshd-vsock@ unit
Martin Hundebøll [Thu, 6 Feb 2025 10:33:49 +0000 (11:33 +0100)] 
vmspawn: ignore failure from sshd-vsock@ unit

The "main" sshd@.service unit ignores the return code from per-session
instances, so do the same for the vsock variant.

(cherry picked from commit df8bd4c171bf88feef0302a0d0476e22e5594c82)

9 months agomkosi: Only make build sources ephemeral if NO_BUILD is not enabled
Daan De Meyer [Thu, 6 Feb 2025 13:53:02 +0000 (14:53 +0100)] 
mkosi: Only make build sources ephemeral if NO_BUILD is not enabled

If we're not building distribution packages from source, there's no
need to make the build sources ephemeral so don't enable the setting
if NO_BUILD is enabled.

(cherry picked from commit f26ded4e31b433d3bb6ee4dc3e02e28f7a1d223f)

9 months agodocs: Add an examples for command line access
Andreas Schneider [Wed, 5 Feb 2025 14:38:32 +0000 (15:38 +0100)] 
docs: Add an examples for command line access

It took me almost an hour to read through the source code to construct
this line.

(cherry picked from commit 20634844ddfc55eebbd6696919f043e3272881c2)

9 months agoresolved: fix DNSSEC `missing-key` error
Fabian Möller [Wed, 22 Jan 2025 12:33:12 +0000 (13:33 +0100)] 
resolved: fix DNSSEC `missing-key` error

Skip unsupport/invalid `DS` and `DNSKEY` combinations during verification.

Fixes: #12545
(cherry picked from commit cac3b43eee83829d68ebf7d4786ebc32e62fe813)

9 months agohomectl: fix typo in man page
Matthieu LAURENT [Wed, 5 Feb 2025 16:31:15 +0000 (17:31 +0100)] 
homectl: fix typo in man page

(cherry picked from commit df9c5c1c9c230605734aeace4cd3861ff3d6ee6d)

9 months agohomectl: fix typo in help text
Matthieu LAURENT [Wed, 5 Feb 2025 16:28:37 +0000 (17:28 +0100)] 
homectl: fix typo in help text

(cherry picked from commit e8e778e8abbe119754026929b3c9453404822c70)

9 months agorepart: Don't fail when we're unable to read file attributes
Daan De Meyer [Wed, 5 Feb 2025 11:42:39 +0000 (12:42 +0100)] 
repart: Don't fail when we're unable to read file attributes

We're getting EOVERFLOW when reading file attributes trying to get
mkosi running in a docker container (don't ask). I have a suspicion
this is coming from fuse-overlayfs. Anyway, since the file attributes
stuff is supposed to be purely optional, let's not fail when we can't
read file attributes for whatever reason.

(cherry picked from commit bc1291aa859783673450fc0c66c48a7242a8365b)

9 months agotest: Move external packages section down and reword a little
Daan De Meyer [Tue, 4 Feb 2025 19:46:11 +0000 (20:46 +0100)] 
test: Move external packages section down and reword a little

This is advanced level stuff that regular contributors don't care
about in the slightest, so move it further down. Also reword the
section a little while we're at it.

(cherry picked from commit f017a5521305987fdeadf85b975b8ed44a9950b6)

9 months agotest: Move NO_BUILD instructions to a separate section
Daan De Meyer [Tue, 4 Feb 2025 19:24:17 +0000 (20:24 +0100)] 
test: Move NO_BUILD instructions to a separate section

This isn't relevant for regular development, so let's move it to a
separate section.

(cherry picked from commit 728a88e54998d143287ffe89faaeb9512cdf24e1)

9 months agotest: Drop -Dremote=enabled instructions from readme
Daan De Meyer [Tue, 4 Feb 2025 19:21:36 +0000 (20:21 +0100)] 
test: Drop -Dremote=enabled instructions from readme

The test commands now use mkosi sandbox which always makes sure the
required dependencies for systemd-journal-remote are enabled so no
need to reconfigure meson explicitly anymore.

(cherry picked from commit 284a56ff60bc8ff90c7f0e0614b1c30edd875288)

9 months agomeson: add install tag for systemctl
Vyacheslav Yurkov [Sun, 2 Feb 2025 09:13:38 +0000 (10:13 +0100)] 
meson: add install tag for systemctl

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
(cherry picked from commit b1e5a7aa3f1e552c56d5adbeed6ff67d88d1e103)

9 months agosysupdate: Update example mode to 644 instead of 444
Daan De Meyer [Tue, 4 Feb 2025 10:42:42 +0000 (11:42 +0100)] 
sysupdate: Update example mode to 644 instead of 444

The UKI file has to be writable to be able to do boot counting in
the UEFI firmware which involves renaming the file by writing to
the file metadata which requires the file to be writable in the FAT
filesystem.

Fixes #36170

(cherry picked from commit 0e470e1cc32776f7b57f57640193d6dd0df97a5b)

9 months agoukify/measure: Revert changes to use SizeOfImage from Linux PE binary
Daan De Meyer [Tue, 4 Feb 2025 08:24:26 +0000 (09:24 +0100)] 
ukify/measure: Revert changes to use SizeOfImage from Linux PE binary

With 19812661f1f65ebe777d1626b5abf6475faababc, we make sure at runtime
in the stub itself that SizeOfImage from the Linux EFISTUB PE binary is
taken into account, so there's no need to take this into account in ukify
itself. By reverting the ukify change, we again ensure that Misc_VirtualSize
reflects the actual size of the Linux EFISTUB PE binary in the .linux section
which lots of tooling depends on. It also makes sure we don't measure a bunch
of extra zeroes in the stub which should fix systemd-pcrlock measurements as
well.

This effectively reverts 2188c759f97e40b97ebe3e94e82239f36b525b10 and
0005411352f9bda0d9887c37b9e75a2bce6c1133.

Fixes #35851

(cherry picked from commit 38801c91292fde004bec0974ed5602984701e03b)

9 months agohomectl: Fix empty checks
Daan De Meyer [Mon, 3 Feb 2025 15:17:00 +0000 (16:17 +0100)] 
homectl: Fix empty checks

(cherry picked from commit 4ba3530d67d88c708c36840fbaed9935ae81faa9)

9 months agobuild(deps): bump super-linter/super-linter from 7.1.0 to 7.2.1
dependabot[bot] [Sat, 1 Feb 2025 09:54:18 +0000 (09:54 +0000)] 
build(deps): bump super-linter/super-linter from 7.1.0 to 7.2.1

Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter) from 7.1.0 to 7.2.1.
- [Release notes](https://github.com/super-linter/super-linter/releases)
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/super-linter/super-linter/compare/b92721f792f381cedc002ecdbb9847a15ece5bb8...85f7611e0f7b53c8573cca84aa0ed4344f6f6a4d)

---
updated-dependencies:
- dependency-name: super-linter/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 6e513fa489b1b0e94fc9d7f35290d5f56dd0f306)

9 months agobuild(deps): bump softprops/action-gh-release from 2.1.0 to 2.2.1
dependabot[bot] [Sat, 1 Feb 2025 09:54:20 +0000 (09:54 +0000)] 
build(deps): bump softprops/action-gh-release from 2.1.0 to 2.2.1

Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.1.0 to 2.2.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/01570a1f39cb168c169c802c3bceb9e93fb10974...c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 30948201331e3c029c5557de23b57a37901c2eb4)

9 months agobuild(deps): bump coverallsapp/github-action from 2.3.4 to 2.3.6
dependabot[bot] [Sat, 1 Feb 2025 09:54:27 +0000 (09:54 +0000)] 
build(deps): bump coverallsapp/github-action from 2.3.4 to 2.3.6

Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.3.4 to 2.3.6.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](https://github.com/coverallsapp/github-action/compare/cfd0633edbd2411b532b808ba7a8b5e04f76d2c8...648a8eb78e6d50909eff900e4ec85cab4524a45b)

---
updated-dependencies:
- dependency-name: coverallsapp/github-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit f82660222063c09522440efa3fa8e02c97dab1d5)

9 months agofirstboot: fix crash when hostname question is skipped
Zbigniew Jędrzejewski-Szmek [Thu, 30 Jan 2025 14:25:38 +0000 (15:25 +0100)] 
firstboot: fix crash when hostname question is skipped

(cherry picked from commit b66a4c157e9754528eec16c235265b4ce94d31e8)

9 months agoFix tense in SD_MESSAGE_SHUTDOWN_STR
Andrew Sayers [Wed, 29 Jan 2025 11:03:00 +0000 (11:03 +0000)] 
Fix tense in SD_MESSAGE_SHUTDOWN_STR

This is printed by bus_manager_log_shutdown() in logind-dbus.c,
near the start of the shutdown process.

Clarify that events *will* happen, long after this message is sent.

(cherry picked from commit 6c45c5a57cac1dd0c35a879bf46d4a42e03e74e1)

9 months agope: do not warn about .initrd addons
Luca Boccassi [Thu, 30 Jan 2025 01:51:05 +0000 (01:51 +0000)] 
pe: do not warn about .initrd addons

We now support them, so stop warning about them.

(cherry picked from commit f6928e6b5d59fd6b0dc34d338be1cd427c1d97d5)

9 months agoFix inversion of timesyncd_usec/epoch_usec variables in clock-warp.c
Devilish Spirits [Wed, 29 Jan 2025 20:54:27 +0000 (21:54 +0100)] 
Fix inversion of timesyncd_usec/epoch_usec variables in clock-warp.c

In clock_apply_epoch() function, the /usr/lib/clock-epoch timestamp was set to timesyncd_usec instead of epoch_usec and vice-versa which produced a misleading log message about the clock source systemd used for early clock sanitization. This trivial commit fix the mistake.

(cherry picked from commit 164295eb6dcc0271d7de030809732c23eeccf9f0)

9 months agomeson: generate keyboard-keys-list from local input.h
Alex Xu (Hello71) [Tue, 28 Jan 2025 22:17:01 +0000 (17:17 -0500)] 
meson: generate keyboard-keys-list from local input.h

otherwise it will use the system input.h which will fail to build if
newer than the bundled version

Fixes: 0a73c8e7b8 ("linux: import input.h and friends")
(cherry picked from commit bc996fd1ba7bce7be4cbae0d0d5ba7c35e8c3f50)

9 months agoukify: Fix two typing issues
Daan De Meyer [Wed, 29 Jan 2025 13:43:06 +0000 (14:43 +0100)] 
ukify: Fix two typing issues

(cherry picked from commit 2d6ae4319ccecdde7a87d12cb439a892afdec943)

9 months agoman: Update nss-myhostname.xml to reflect files
AndreFerreiraMsc [Tue, 28 Jan 2025 13:11:58 +0000 (14:11 +0100)] 
man: Update nss-myhostname.xml to reflect files

(cherry picked from commit 3e1d7b6aae5f5b24610620db810a5730dcc9a6a6)

9 months agotest: support slow test-ukify on Debian/Ubuntu
Luca Boccassi [Sun, 26 Jan 2025 17:35:06 +0000 (17:35 +0000)] 
test: support slow test-ukify on Debian/Ubuntu

Kernels are installed in /boot/ so find them there too

(cherry picked from commit 25a253084a16dcc077592ff85d62f69fa940d1de)

9 months agotest: use local stub if available in test-ukify
Luca Boccassi [Sun, 26 Jan 2025 19:50:22 +0000 (19:50 +0000)] 
test: use local stub if available in test-ukify

It might not be available on a CI system in the system
path, so use the local one if it was built

(cherry picked from commit bcca98c6326b2766d6b769661b15e292c12cf8ac)

9 months agotest: install stub package for test-ukify unit test
Luca Boccassi [Sun, 26 Jan 2025 20:06:36 +0000 (20:06 +0000)] 
test: install stub package for test-ukify unit test

(cherry picked from commit 78ce88e2656aedee8b38b36edcf1e074b90ff53a)

9 months agotest: cleanup after testcase_12_resolvectl2
Nick Rosbrook [Wed, 23 Oct 2024 20:31:00 +0000 (16:31 -0400)] 
test: cleanup after testcase_12_resolvectl2

(cherry picked from commit 266cfdfc77a0eee6d4df60d9795f381ced8a1e65)

9 months agocore: add trigger to path unit debug log
Luca Boccassi [Mon, 27 Jan 2025 20:30:16 +0000 (20:30 +0000)] 
core: add trigger to path unit debug log

Useful for debugging, given it's already logging and the trigger
is known, add it

(cherry picked from commit 6566b4306a65bc7af6ade0cb6887217212925202)

9 months agokbd-model-map: add a georgian mapping
Adam Williamson [Fri, 10 Jan 2025 21:01:47 +0000 (13:01 -0800)] 
kbd-model-map: add a georgian mapping

https://github.com/legionus/kbd/pull/127 adds a Georgian mapping
to kbd. console-setup already has one. Let's support it here, so
it's used for Georgian installs on distros that use this table.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
(cherry picked from commit f89d4c5f108ffbd29d0cc963ed7202bb9b0f778a)

9 months agomkosi: add loongarch64 to Debian's list of EFI arches
Luca Boccassi [Sat, 25 Jan 2025 01:21:30 +0000 (01:21 +0000)] 
mkosi: add loongarch64 to Debian's list of EFI arches

(cherry picked from commit 5ff144515e8b4d8faeb77461b9a62acb0ff1c0a5)

10 months agomkosi: Add VCS_TAG to PassEnvironment=
Daan De Meyer [Mon, 27 Jan 2025 10:27:49 +0000 (11:27 +0100)] 
mkosi: Add VCS_TAG to PassEnvironment=

(cherry picked from commit 28f96afbbbc023ff9397ff8767d1faa1512abbc1)

10 months agomkosi: Bump minimum version to 25
Daan De Meyer [Mon, 27 Jan 2025 10:26:29 +0000 (11:26 +0100)] 
mkosi: Bump minimum version to 25

Let's require everyone to be on the now officially released mkosi 25.

(cherry picked from commit e9fb163857223da6ea020b0bfd12581e9ea707ae)

10 months agomkosi: Update to latest
Daan De Meyer [Mon, 27 Jan 2025 10:26:13 +0000 (11:26 +0100)] 
mkosi: Update to latest

(cherry picked from commit b10a0a4ad69541a2cbae9df643c67c3292930a25)

10 months agorandom-util: fix compilation error
Yu Watanabe [Wed, 15 Jan 2025 16:29:04 +0000 (01:29 +0900)] 
random-util: fix compilation error

Fixes the following error:
```
../src/basic/random-util.c: In function "fallback_random_bytes":
../src/basic/random-util.c:45:26: error: initializer-string for array of "char" is too long [-Werror=unterminated-string-initialization]
   45 |                 .label = "systemd fallback random bytes v1",
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

(cherry picked from commit e722fe74ca5e00d3c8a5f85342b75c40ace051f9)

10 months agosystemctl: fix memleak
Yu Watanabe [Sun, 26 Jan 2025 19:17:27 +0000 (04:17 +0900)] 
systemctl: fix memleak

Fixes a bug introduced by adb6cd9be2b7e9e614d2b5835c7b70cf8eacc852.

Fixes #36178.

(cherry picked from commit 08570f284140752b9f0aad4dbcdff32c090a3661)

10 months agotools: add loongarch64 to debug-sd-boot script
Luca Boccassi [Sat, 25 Jan 2025 01:20:47 +0000 (01:20 +0000)] 
tools: add loongarch64 to debug-sd-boot script

(cherry picked from commit 829f57003d50634f28349f1ec6460421532ef318)

10 months agoukify: add riscv32 to --efi-arch
Luca Boccassi [Sat, 25 Jan 2025 01:25:28 +0000 (01:25 +0000)] 
ukify: add riscv32 to --efi-arch

It is supported in the arch mapping at the top and in elf2efi, so add it here too

(cherry picked from commit d1429288ae4cf611ac3df6f604ddb4d6af480cf8)

10 months agoukify: add loongarch64 to --efi-arch
Luca Boccassi [Sat, 25 Jan 2025 01:19:53 +0000 (01:19 +0000)] 
ukify: add loongarch64 to --efi-arch

(cherry picked from commit abe0033556e2416a04bb23dc6d739c6d4dd37001)

10 months agoman: fix reference to non-existing ukify parameter
Luca Boccassi [Fri, 24 Jan 2025 23:37:33 +0000 (23:37 +0000)] 
man: fix reference to non-existing ukify parameter

The --extend parameter was removed by https://github.com/systemd/systemd/pull/34608
and a --join-profile was added instead, fix leftover reference in manpage

Follow-up for 3891d57c4f768cb648e1a85483216eadae0b101e

(cherry picked from commit fd39606c258789d63a345feb6b492f6d2944d9a6)

10 months agoresolved: stop mdns/llmnr if no interface request it after bus method
Yu Watanabe [Fri, 24 Jan 2025 19:48:00 +0000 (04:48 +0900)] 
resolved: stop mdns/llmnr if no interface request it after bus method

(cherry picked from commit 269da24c5a3713bea1f1650334e23ce09f6136b2)

10 months agoresolved: do not disable mdns/llmnr globally if it's enabled on any link
Yu Watanabe [Fri, 24 Jan 2025 19:48:00 +0000 (04:48 +0900)] 
resolved: do not disable mdns/llmnr globally if it's enabled on any link

Fixes a regression caused by 2976730a4d34749bfb7a88da341464f1834ab1c6.

Fixes #36078.
Fixes #36126.

Co-authored-by: Luca Boccassi <luca.boccassi@gmail.com>
(cherry picked from commit 962b757d9b62e42df2513577d717d730b619c80c)

10 months agomachine: revert type change of "leader" in io.systemd.Machine.Register method
Yu Watanabe [Fri, 24 Jan 2025 19:05:51 +0000 (04:05 +0900)] 
machine: revert type change of "leader" in io.systemd.Machine.Register method

The varlink method io.systemd.Machine.Register() is in v256, hence type
of "leader" cannot be changed.
Let's revert the change by 755cb018c9b3e93245afb86ec94223756ddd70e4, and
introduce another field "leaderProcessId", which takes detailed information
of the process.

Fixes a regression caused by 755cb018c9b3e93245afb86ec94223756ddd70e4.
Fixes #36155.

(cherry picked from commit 465865146657ad3b2a59f618e5e8a529b08561bd)

10 months agomount-util: make path_get_mount_info_at() also read utab
Yu Watanabe [Fri, 24 Jan 2025 17:35:21 +0000 (02:35 +0900)] 
mount-util: make path_get_mount_info_at() also read utab

As "_netdev" is only stored in utab.

Fixes a bug introduced by 5261c521e3a98932241f36e91cf6f7823c578aca.
Fixes #35949.

(cherry picked from commit 22f980dd0b04e65dbdc2fca9c653119459a2c52f)

10 months agocore/job: never consider reload jobs redundant
Mike Yuan [Wed, 22 Jan 2025 18:36:27 +0000 (19:36 +0100)] 
core/job: never consider reload jobs redundant

Follow-up for 656bbffc6c45bdd8d5c28a96ca948ba16c546547

The commit reworked job merging logic so that reload jobs
won't get merged. However, they might get dropped from
transaction due to being deemed redundant, i.e. way before
it even hits job_install(). Let's make sure reload jobs
are always kept during transaction construction stage, too.

(cherry picked from commit 7b940d8de91aeba6fa171eb42b690fa95641f29e)

10 months agovarlink: fix error name
Lennart Poettering [Tue, 21 Jan 2025 17:34:21 +0000 (18:34 +0100)] 
varlink: fix error name

The documentation and code agree on the same name, since always, but
when I put together the IDL I made a mistake and insert a "Not" that
wasn't supposed to be there.

Let's correct that.

(cherry picked from commit bd9553d6775a954704f0e37bf3b54b98212f4b0f)

10 months agoman: also fix documentation of start-limit-hit
Lennart Poettering [Tue, 14 Jan 2025 13:04:52 +0000 (14:04 +0100)] 
man: also fix documentation of start-limit-hit

(cherry picked from commit 390dffb862af5791a33abef08011f87818249975)

10 months agobus-wait-for-jobs: fix service result table
Lennart Poettering [Tue, 14 Jan 2025 12:56:58 +0000 (13:56 +0100)] 
bus-wait-for-jobs: fix service result table

We were missing one service result (oom-kill), and the ratelimit one is
called differently. Correct that so that we generate proper log messages
for these cases.

(cherry picked from commit a7620f5dd16f0386b8ddeadfcd4e89da4050beef)

10 months agostub: drop PE sections parsing cap
Luca Boccassi [Fri, 10 Jan 2025 21:02:55 +0000 (21:02 +0000)] 
stub: drop PE sections parsing cap

This was added originally as it was thought that Windows applied
the same cap. Nowadays the specs do not mention it, and it is
believed Windows no longer applies it either, so drop it in order
to allow an arbitrary number of DTBs to be included

Fixes https://github.com/systemd/systemd/issues/35943

(cherry picked from commit 8c5b359579b0f1029edafb0bd96b5ebfb271db76)

10 months agoprocess-util: do not unblock unrelated signals while forking
Lennart Poettering [Thu, 9 Jan 2025 10:15:49 +0000 (11:15 +0100)] 
process-util: do not unblock unrelated signals while forking

This makes sure when we are blocking signals in preparation for fork()
we'll not temporarily unblock any signals previously set, by mistake.

It's safe for us to block more, but not to unblock signals already
blocked. Fix that.

Fixes: #35470
(cherry picked from commit 78933625084b11c495c073fc7c34067315a1da50)

10 months agotest: add test cases for parsing SYSTEMD_WANTS=/SYSTEMD_USER_WANTS=
Yu Watanabe [Mon, 6 Jan 2025 10:16:23 +0000 (19:16 +0900)] 
test: add test cases for parsing SYSTEMD_WANTS=/SYSTEMD_USER_WANTS=

(cherry picked from commit 4c9da4dc91c6f875683a6c9fc00df19686f242cc)

10 months agocore/device: do not drop backslashes in SYSTEMD_WANTS=/SYSTEMD_USER_WANTS=
Yu Watanabe [Mon, 6 Jan 2025 08:26:52 +0000 (17:26 +0900)] 
core/device: do not drop backslashes in SYSTEMD_WANTS=/SYSTEMD_USER_WANTS=

Let consider the following udev rules:
===
PROGRAM="/usr/bin/systemd-escape foo-bar-baz", ENV{SYSTEMD_WANTS}+="test1@$result.service"
PROGRAM="/usr/bin/systemd-escape aaa-bbb-ccc", ENV{SYSTEMD_WANTS}+="test2@$result.service"
===
Then, a device expectedly gains a property:
===
SYSTEMD_WANTS=test1@foo\x2dbar\x2dbaz.service test2@aaa\x2dbbb\x2dccc.service
===
After the event being processed by udevd, PID1 processes the device, the
property previously was parsed with extract_first_word(EXTRACT_UNQUOTE),
then the device unit gained the following dependencies:
===
Wants=test1@foox2dbarx2dbaz.service test2@aaax2dbbbx2dccc.service
===
So both '%i' and '%I' for the template services did not match with the original
data, and it was hard to use systemd-escape in PROGRAM= udev rule token.

This makes the property parsed with extract_first_word(EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE),
hence the device unit now gains the following dependencies:
===
Wants=test1@foo\x2dbar\x2dbaz.service test2@aaa\x2dbbb\x2dccc.service
===
and '%I' for the template services match with the original data.

Fixes a bug caused by ceed8f0c8b9a46300eccd1afa2dd8d3c2cb6b47c (v233).

Fixes #16735.
Replaces #16737 and #35768.

(cherry picked from commit a467358b2a18b611e48e62ed89167a04e0f7634e)

10 months agoefivars: deal with uncommitted efi variables
wrvsrx [Sat, 7 Dec 2024 02:32:15 +0000 (10:32 +0800)] 
efivars: deal with uncommitted efi variables

Unfortunately kernel reports EOF if there's an inconsistency between efivarfs var list
and what's actually stored in firmware, c.f. #34304. A zero size env var is not allowed in
efi and hence the variable doesn't really exist in the backing store as long as it is zero
sized, and the kernel calls this "uncommitted". Hence we translate EOF back to ENOENT here,
as with kernel behavior before
https://github.com/torvalds/linux/commit/3fab70c165795431f00ddf9be8b84ddd07bd1f8f

If the kernel changes behaviour (to flush dentries on resume), we can drop
this at some point in the future. But note that the commit is 11
years old at this point so we'll need to deal with the current behaviour for
a long time.

Fix #34304.

(cherry picked from commit 6013dee98d6543ac290a2938c4ec8494e26531ab)

10 months agoboot: Improve log message
Daan De Meyer [Sat, 25 Jan 2025 19:42:54 +0000 (20:42 +0100)] 
boot: Improve log message

(cherry picked from commit ff83795469a20af02a9bf3285992128799b16302)

10 months agoHACKING: Drop run0 from mkosi boot invocation
Daan De Meyer [Fri, 24 Jan 2025 16:29:58 +0000 (17:29 +0100)] 
HACKING: Drop run0 from mkosi boot invocation

mkosi will itself use run0 or sudo when not running as root to invoke
systemd-nspawn, so no need to do it in HACKING.md.

(cherry picked from commit 1743f0370fd89d95a2fa89e8475f4b82a38f54c3)

10 months agodocs/HACKING: use 'run0' to indicate which commands require privileges
Zbigniew Jędrzejewski-Szmek [Mon, 9 Dec 2024 19:24:34 +0000 (20:24 +0100)] 
docs/HACKING: use 'run0' to indicate which commands require privileges

(cherry picked from commit 6ed73883c68304f6677ff342f457aad3c18ab6c6)

10 months agoHACKING: Move OBS section further down
Daan De Meyer [Fri, 24 Jan 2025 16:28:15 +0000 (17:28 +0100)] 
HACKING: Move OBS section further down

HACKING.md should first and foremost tell someone how to hack on
systemd, installing packages from OBS isn't the most likely section
a new contributor will be interested in, so let's move it further
down.

(cherry picked from commit 798b9fb7eb71ad127af49f5308f9e95de4e77fa8)

10 months agomkosi: Drop usage of _systemd_QUIET in arch build script
Daan De Meyer [Fri, 24 Jan 2025 09:54:51 +0000 (10:54 +0100)] 
mkosi: Drop usage of _systemd_QUIET in arch build script

We dropped the variable in the packaging specs for Arch to keep the
integration points as minimal as possible so let's stop using it in
the build script as well.

(cherry picked from commit 8dab59e610720c022f962311069c95fd8569f82a)

10 months agomkosi: Add back --preserve-env when running integrationt tests
Daan De Meyer [Thu, 23 Jan 2025 09:35:06 +0000 (10:35 +0100)] 
mkosi: Add back --preserve-env when running integrationt tests

The test wrapper script depends on various github actions environment
variables so let's make sure those are propagated.

(cherry picked from commit 6733b07d43f3524b66b5ab79a96cad192d2280fc)

10 months agomkosi: Update to latest
Daan De Meyer [Wed, 22 Jan 2025 14:58:13 +0000 (15:58 +0100)] 
mkosi: Update to latest

With the latest mkosi, mkosi takes care of making sure it is
available within mkosi sandbox so we get rid of all the --preserve-env=
options when we invoke mkosi sandbox with sudo as these are not
required anymore. It also doesn't matter anymore if mkosi is installed
in /usr on the host so we get rid of the documentation around that as
well.

(cherry picked from commit 94558e6fc70b53bfa36707afd7e90ff1737194cf)

10 months agomkosi: Run two more mkosi commands with sudo
Daan De Meyer [Wed, 22 Jan 2025 21:24:36 +0000 (22:24 +0100)] 
mkosi: Run two more mkosi commands with sudo

Running some mkosi commands as root and other not can lead to cache
invalidations with the latest version, so make sure we run everything
as root after we've built the tools tree.

(cherry picked from commit 007d255d870bee37db03da1875c0387598bdedde)

10 months agotest: Make sure we run lcov from the meson source directory
Daan De Meyer [Wed, 22 Jan 2025 13:55:45 +0000 (14:55 +0100)] 
test: Make sure we run lcov from the meson source directory

In ac75c5192797082c1965ab30be4711490f2937bc, we accidentally changed
the working directory that the tools executed in the wrapper script
are invoked in. This broke our invocations of lcov. Let's explicitly
run those in the meson source directory again to fix the coverage
workflow.

(cherry picked from commit d3d501e94930c3865f13c881a23980941cce079f)