systemd/.git
15 months agonetwork: mention that IPv4 ACD is enabled by default for 169.254.0.0/16
Yu Watanabe [Tue, 30 Jul 2024 22:21:09 +0000 (07:21 +0900)]
network: mention that IPv4 ACD is enabled by default for 169.254.0.0/16

Prompted by #33824.

(cherry picked from commit dd87ad8e193092f053ca702b303b25d2001bf96d)

15 months agonetwork: request non-NULL SSID when a wlan interface is configured as station
Yu Watanabe [Tue, 30 Jul 2024 21:49:32 +0000 (06:49 +0900)]
network: request non-NULL SSID when a wlan interface is configured as station

To avoid conflicts with user .network file for the wlan interface with Bond=.
See https://github.com/systemd/systemd/issues/19832#issuecomment-857661200.

(cherry picked from commit e2becab08506d8a085f4c18231c7f354db16df9f)

15 months agoefi: fix link to legacy EFI handover protocol
Luca Boccassi [Wed, 31 Jul 2024 00:46:58 +0000 (01:46 +0100)]
efi: fix link to legacy EFI handover protocol

(cherry picked from commit 4d6ab7e8440845301c90211beb22015e7232faa1)

15 months agostub: allocate and zero enough space in legacy x86 handover protocol
Luca Boccassi [Wed, 31 Jul 2024 00:45:06 +0000 (01:45 +0100)]
stub: allocate and zero enough space in legacy x86 handover protocol

A PE image's memory footprint might be larger than its file size due
to uninitialized memory sections. Normally all PE headers should be
parsed to check the actual required size, but the legacy EFI handover
protocol is only used for x86 Linux bzImages, so we know only the last
section will require extra memory. Use SizeOfImage from the PE header
and if it is larger than the file size, allocate and zero extra memory
before using it.

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

(cherry picked from commit 19812661f1f65ebe777d1626b5abf6475faababc)

15 months agonetwork: call link_handle_bound_by_list() before trying to reconfigure interface
Yu Watanabe [Tue, 30 Jul 2024 18:50:55 +0000 (03:50 +0900)]
network: call link_handle_bound_by_list() before trying to reconfigure interface

Otherwise, when an interface gained its carrier, the interface may not
have matching .network file yet, then link_reconfigure_impl() returns
zero, and link_handle_bound_by_list() is skipped.

Fixes #33837.

(cherry picked from commit 36b8ad085c6902631ad7054bffbda33d6d168823)

15 months agoRevert "network/ndisc: ignore most fields of RA header when lifetime is zero"
Ivan Shapovalov [Sun, 16 Jun 2024 08:46:34 +0000 (10:46 +0200)]
Revert "network/ndisc: ignore most fields of RA header when lifetime is zero"

This reverts commit ffef01acddcac27caaef02f7f28bff03d7799e5e.

Similar to 2d393b1b6d8 ("network: IPv6 Compliance: Router Advertisement
Processing, Reachable Time [v6LC.2.2.15]"),

Extract from: https://www.ietf.org/rfc/rfc4861.html#section-4.2, p.21,
first paragraph:

    The Router Lifetime applies only to
    the router's usefulness as a default router; it
    does not apply to information contained in other
    message fields or options.

So it does not make sense to prevent DHCPv6 when Router Lifetime is 0.

Fixes #33357.

(cherry picked from commit 7767896d127264f660e1e8a714e5cd760840921f)

15 months agoFix detection of TDX confidential VM on Azure platform
Daniel P. Berrangé [Tue, 30 Jul 2024 09:51:21 +0000 (10:51 +0100)]
Fix detection of TDX confidential VM on Azure platform

The original CVM detection logic for TDX assumes that the guest can see
the standard TDX CPUID leaf. This was true in Azure when this code was
originally written, however, current Azure now blocks that leaf in the
paravisor. Instead it is required to use the same Azure specific CPUID
leaf that is used for SEV-SNP detection, which reports the VM isolation
type.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 9d7be044cad1ae54e344daf8f2ec37da46faf0fd)

15 months agonetwork: do not bring down bound interfaces immediately
Yu Watanabe [Tue, 30 Jul 2024 18:04:04 +0000 (03:04 +0900)]
network: do not bring down bound interfaces immediately

Even if a timespan specified to IgnoreCarrierLoss= for an interface,
when the carrier of the interface lost, bound interfaces might be bring
down immediately.

Let's also postpone bringing down bound interfaces with the specified
timespan.

(cherry picked from commit e8eaed0240d642e70c567b08f3593e4cf45a255a)

15 months agodocument how TimeoutStartSec= affects notify-reload (#33653)
Arian van Putten [Tue, 30 Jul 2024 11:35:52 +0000 (13:35 +0200)]
document how TimeoutStartSec=  affects notify-reload (#33653)

* document how TimeoutStartSec=  affects notify-reload

(cherry picked from commit a55d1b29a4cc2edc8550c5f4e062f2194807dcd3)

15 months agonspawn: remove macvlan interfaces before network namespace died
Yu Watanabe [Tue, 30 Jul 2024 05:35:33 +0000 (14:35 +0900)]
nspawn: remove macvlan interfaces before network namespace died

This is similar to what we do for veth interfaces in remove_veth_links().

When a container rebooted, macvlan interfaces created by the previous
boot may still exist in the kernel, and that causes -EADDRINUSE after
reboot.

Hopefully fixes #680.

(cherry picked from commit 1bfa47418e9df03c2562a4c82dc319cf7c3b228c)

15 months agocgroup-util: Ignore kernel threads in cg_kill_items()
Daan De Meyer [Tue, 30 Jul 2024 09:53:32 +0000 (11:53 +0200)]
cgroup-util: Ignore kernel threads in cg_kill_items()

Similar to the implementation of cgroup.kill in the kernel, let's
skip kernel threads in cg_kill_items() as trying to kill kernel
threads as an unprivileged process will fail with EPERM and doesn't
do anything when running privileged.

(cherry picked from commit 0fbb569de1dcc06118dba006cf7a40caf6cd94d0)

15 months agokernel-install: Try some more initrd variants in 90-loaderentry.install
Daan De Meyer [Mon, 29 Jul 2024 13:41:51 +0000 (15:41 +0200)]
kernel-install: Try some more initrd variants in 90-loaderentry.install

On CentOS/Fedora, dracut is configured to write the initrd to
/boot/initramfs-$KERNEL_VERSION...img so let's check for that as well
if no initrds were supplied.

(cherry picked from commit b56920e36c5692c0dde701bfb48330653a9c62c9)

15 months agokernel-install: Only read cmdline from /proc/cmdline when not in container
Daan De Meyer [Mon, 29 Jul 2024 15:13:28 +0000 (17:13 +0200)]
kernel-install: Only read cmdline from /proc/cmdline when not in container

If we're running from within a container, we're very likely not going
to want to use the kernel command line from /proc/cmdline, so let's add
a check to see if we're running from a container to decide whether we'll
use the kernel command line from /proc/cmdline.

(cherry picked from commit 35c01ec59e0c2e6bd06cb18ca2ff612c6a7ea35d)

15 months agotest: Don't mount build sources into image when running non-interactively
Daan De Meyer [Mon, 29 Jul 2024 11:40:42 +0000 (13:40 +0200)]
test: Don't mount build sources into image when running non-interactively

(cherry picked from commit 578ee05155c0f6d8cc07f785fcc636037545c8da)

15 months agonetwork: Fixup Table when L3MasterDevice is set on routing policy rule
Nick Cao [Sun, 28 Jul 2024 14:07:19 +0000 (10:07 -0400)]
network: Fixup Table when L3MasterDevice is set on routing policy rule

(cherry picked from commit 615af2c77d996b2ba6e6d17d376f7a221c0e5822)

15 months agoman: network: move note about L3MasterDevice to the correct section
Nick Cao [Sun, 28 Jul 2024 17:50:30 +0000 (13:50 -0400)]
man: network: move note about L3MasterDevice to the correct section

(cherry picked from commit 034b7dfc08062cde9f63847f34b4d1c604a19a46)

15 months agoman: clarify systemd-path variable source
Vladimir Panteleev [Sat, 27 Jul 2024 11:49:20 +0000 (11:49 +0000)]
man: clarify systemd-path variable source

(cherry picked from commit 3f24fa57df552accc2a6f9ab4d36724ba7227eff)

15 months agoman: improve ManagerEnvironment documentation
Vladimir Panteleev [Sat, 27 Jul 2024 11:43:47 +0000 (11:43 +0000)]
man: improve ManagerEnvironment documentation

- Improve wording for explanation when these variables are inherited

- Clarify that these variables are not placed in the process environment block,
  so /proc/PID/environ cannot be used as a debugging tool

(cherry picked from commit 6c1e0823b04525716d9ee0031a2b6735d3f7dfa4)

15 months agokernel-install: remove depmod generated file modules.weakdep
Jose Ignacio Tornos Martinez [Fri, 26 Jul 2024 08:28:21 +0000 (10:28 +0200)]
kernel-install: remove depmod generated file modules.weakdep

The new file, modules.weakdep, generated by depmod to get the weak
dpendencies information can be present
(https://github.com/kmod-project/kmod/commit/05828b4a6e9327a63ef94df544a042b5e9ce4fe7),
so remove it like the other similar files.

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
(cherry picked from commit eef4cd51f94d837bd0e71512c831634a2902522d)

15 months agoresolved: Don't retry queries that indicate net error
Ronan Pigott [Thu, 25 Jul 2024 19:48:03 +0000 (12:48 -0700)]
resolved: Don't retry queries that indicate net error

This probably rarely helped anyway, but it also in some cases interferes
with auxiliary dnssec queries where the authoritative nameserver does
not support EDNS0/DNSSEC.

Fixes: ac6844460ca1 ("resolved: support RFC 8914 EDE error codes")
(cherry picked from commit cd2ce31adbfa5fb4f08267a13ace3a72e7597a2f)

15 months agotest: Fail cgroup delegation test when user cannot be created
Michal Koutný [Fri, 26 Jul 2024 08:44:10 +0000 (10:44 +0200)]
test: Fail cgroup delegation test when user cannot be created

It means: a) user cannot be created, something's wrong in the
test environment -> fail the test; b) user already exists, we shall not
continue and delete (foreign) user.

(cherry picked from commit 3e6e3e6d40db0a9e9741ef4942218193fca7b28e)

15 months agoresize-fs: Put minimal ext4 size in the same ballpark as the other filesystems
Daan De Meyer [Thu, 25 Jul 2024 11:22:42 +0000 (13:22 +0200)]
resize-fs: Put minimal ext4 size in the same ballpark as the other filesystems

TEST-46-HOMED fails on ext4 because the filesystem is deemed to small
for activation by cryptsetup. Let's bump the minimal filesystem size for
ext4 a bit to be in the same ballpark as ext4 and btrfs to avoid weird
errors due to impossibly small filesystems.

Also use U64_MB while we're touching this.

(cherry picked from commit ae07feb401ff70b122650ac01041021703d4b8ad)

15 months agotest: Reorganize testcase of cgroup delegation
Michal Koutný [Thu, 31 Mar 2022 16:25:36 +0000 (18:25 +0200)]
test: Reorganize testcase of cgroup delegation

There are multiple subtests, just move them around into functions
(leveraging the testcase_* convention) to make space for new related
subtests.

(cherry picked from commit 4f0541dc595277a62431c46d59dc258005160650)

15 months agoTEST-54-CREDS: Specify SMBIOS creds via corresponding mkosi option
Daan De Meyer [Thu, 25 Jul 2024 11:08:48 +0000 (13:08 +0200)]
TEST-54-CREDS: Specify SMBIOS creds via corresponding mkosi option

This allows mkosi to combine fstab.extra with its own fstab.extra so
that it doesn't override the one we pass for the test.

(cherry picked from commit ebe17e3f9e6f6b7a85677fc10439936b41d196e3)

15 months agosd-event: change error code -EINVAL -> -EIO
Yu Watanabe [Sun, 4 Aug 2024 02:29:03 +0000 (11:29 +0900)]
sd-event: change error code -EINVAL -> -EIO

EINVAL should be used when a function is called with an invalid
argument. Here, the signal is not a function argument.

Follow-up for 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9.

(cherry picked from commit ab9af70edb23f2a66e93e2e16f87cd98873885b7)

15 months agosd-event: do not assert on invalid signal
David Tardon [Thu, 25 Jul 2024 08:06:34 +0000 (10:06 +0200)]
sd-event: do not assert on invalid signal

The signalfd_siginfo struct is received from outside via a FD, hence
assert() is not appropriate way to check it. Just do a normal runtime
check.

(cherry picked from commit 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9)

15 months agologind-dbus: check auth. for all inhibitor operations
David Tardon [Thu, 25 Jul 2024 07:47:56 +0000 (09:47 +0200)]
logind-dbus: check auth. for all inhibitor operations

Fixes #33834

(cherry picked from commit 639719e01065c3a2f557d70e4d8088c2ec71c7c6)

15 months agodocs/CONTROL_GROUP_INTERFACE.md: document accounting information available via D-Bus
Jeffrey Bosboom [Thu, 25 Jul 2024 01:14:24 +0000 (18:14 -0700)]
docs/CONTROL_GROUP_INTERFACE.md: document accounting information available via D-Bus

(cherry picked from commit f7fa6326820bbb75a2a7112072a7771944ad8ce3)

15 months agobasic/log: do not treat all negative errnos as synthetic
Mike Yuan [Wed, 24 Jul 2024 14:28:48 +0000 (16:28 +0200)]
basic/log: do not treat all negative errnos as synthetic

Currently, IS_SYNTHETIC_ERRNO() evaluates to true for all negative errnos,
because of the two's-complement negative value representation.
Subsequently, ERRNO= is not logged for most of our own code.
Let's fix this, by formatting all synthetic errnos as positive.
Then, treat all negative values as non-synthetic.

While at it, mark the evaluation order explicitly, and remove
unneeded comment.

Fixes #33800

(cherry picked from commit 268f58076f7e0258dce75f521d08199092279853)

15 months agotest: fix D-Bus policy override for TEST-73-LOCALE
Luca Boccassi [Thu, 25 Jul 2024 09:43:48 +0000 (10:43 +0100)]
test: fix D-Bus policy override for TEST-73-LOCALE

We don't need to allow non-root, and the policy needs to specify destination
and interface too, to narrow it down

Follow-up for 7b5c38a91def6cf236605010a0a93a1cd4c137e9

(cherry picked from commit a4c436c9d8ae20baf9d1d08d43e64e6355bcce83)

15 months agotest-fs-util: Modernize openat_report_new() test
Daan De Meyer [Wed, 24 Jul 2024 08:50:38 +0000 (10:50 +0200)]
test-fs-util: Modernize openat_report_new() test

(cherry picked from commit b91ad562280ec4f37ba970f1f167d2d626da2692)

15 months agotest-id128: Use new assertion macros
Daan De Meyer [Wed, 24 Jul 2024 07:56:25 +0000 (09:56 +0200)]
test-id128: Use new assertion macros

(cherry picked from commit 372e96a5a10630eb2e02111672221428e0be3fb8)

15 months agotest: Add ASSERT_EQ_ID128() and ASSERT_NE_ID128()
Daan De Meyer [Wed, 24 Jul 2024 07:56:01 +0000 (09:56 +0200)]
test: Add ASSERT_EQ_ID128() and ASSERT_NE_ID128()

(cherry picked from commit 60a4505da4cfb57653fac79a79745e32ab0bc311)

15 months agotest: Add ASSERT_FAIL()
Daan De Meyer [Wed, 24 Jul 2024 07:55:21 +0000 (09:55 +0200)]
test: Add ASSERT_FAIL()

(cherry picked from commit 8eb06fd162c8828739f8619437351d98d7105ec9)

15 months agomkosi: Update to latest
Daan De Meyer [Wed, 24 Jul 2024 11:27:46 +0000 (13:27 +0200)]
mkosi: Update to latest

Includes the required fix to make mkosi copy NOCOW disk images properly.

(cherry picked from commit 3d6c6f9b9e957735a801b8d1587508dea9599795)

16 months agoman/systemd-detect-virt: fix row spanning for VM header
Daniel P. Berrangé [Fri, 2 Aug 2024 12:07:13 +0000 (13:07 +0100)]
man/systemd-detect-virt: fix row spanning for VM header

This fixes

  commit 9b0688f491674b53ef7a52bdf561a430c53673d6
  Author: Yu Watanabe <watanabe.yu+github@gmail.com>
  Date:   Tue Jan 9 10:52:49 2024 +0900

    virt: add Google Compute Engine support

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 9ffdfc67c6aedcb66c2b18c2c61bc32e585e6d6e)

16 months agomeson: Bump version to 256.4 v256.4
Luca Boccassi [Wed, 24 Jul 2024 12:49:39 +0000 (13:49 +0100)]
meson: Bump version to 256.4

16 months agomkosi: update debian commit reference
Luca Boccassi [Wed, 24 Jul 2024 09:13:44 +0000 (10:13 +0100)]
mkosi: update debian commit reference

c004a150e7 Configure default DNS servers for upstream CI builds
a27b1516c9 autopkgtest: set Release= in mkosi.local.conf to distinguish testing vs unstable
dddce818b2 autopkgtest: add allow-stderr to timedated test
2a7b111506 Install valrinkctl zsh completion file
862497a139 d/t/control: add Depends: lib{systemd,udev}-dev for upstream
cb78791b85 d/t/upstream: ensure correct ubuntu codename is used
fe7445b94d d/t/boot-and-services: fix a couple python sytax warnings
2a875917cc d/t/boot-and-services: skip test_tmp_cleanup if tmp.mount is overridden
6fe81acbc9 Install zsh completion for run0

16 months agohwdb: update to main@{2024-07-24}
Luca Boccassi [Wed, 24 Jul 2024 09:06:42 +0000 (10:06 +0100)]
hwdb: update to main@{2024-07-24}

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

16 months agoadd udev rules for trezor hw wallet devices
vdovhanych [Mon, 22 Jul 2024 20:57:25 +0000 (22:57 +0200)]
add udev rules for trezor hw wallet devices

(cherry picked from commit 2cf425ec573b8f67025c5e74cd267015129e7349)

16 months agocore: reliably check if varlink socket has been deserialized
Mike Yuan [Tue, 23 Jul 2024 15:55:12 +0000 (17:55 +0200)]
core: reliably check if varlink socket has been deserialized

Follow-up for 6906c028e83b77b35eaaf87b27d0fe5c6e1984b7

The mentioned commit uses access() to check if varlink socket
already exists in the filesystem, but that isn't sufficient.

> Varlink sockets are not serialized until v252, so upgrading from
> v251 or older means we will not listen anymore on the varlink sockets.
>
> See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074789
> for more details as this was found when updating from Debian Bullseye to a new version.

After this commit, the set up of varlink_server is effectively
split into two steps. manager_varlink_init_system(), which is
called after deserialization, would no longer skip listening
even if Manager.varlink_server is in place, but actually
check if we're listening on desired sockets.
Then, manager_deserialize() can be switched back to using
manager_setup_varlink_server().

Alternative to #33817

Co-authored-by: Luca Boccassi <bluca@debian.org>
(cherry picked from commit d4e5c66ed469c822ca5346c7a445ec1446b1d17f)

16 months agomkosi: Bump device timeout even more
Daan De Meyer [Tue, 23 Jul 2024 12:16:23 +0000 (14:16 +0200)]
mkosi: Bump device timeout even more

I still manage to hit it in some cases so let's bump again.

(cherry picked from commit fffbfb4ed1b949a853773e0445197c2aba4e5f91)

16 months agoman/systemd-repart: extend description and reword some sentences
Zbigniew Jędrzejewski-Szmek [Sun, 14 Jul 2024 12:25:59 +0000 (14:25 +0200)]
man/systemd-repart: extend description and reword some sentences

The page was written when systemd-repart was primarily intended to be used on a
running system. But nowadays it's more often used to create images, so extend
that part of the description.

While at it, fix some whitespace issues and trim some overly complicated sentences.

(cherry picked from commit d202ea57549248c4246c8f453a2ff88a4c2a7e1e)

16 months agoDocument that MemorySwapMax supports % configuration
Steve Traylen [Wed, 3 Jul 2024 12:19:08 +0000 (14:19 +0200)]
Document that MemorySwapMax supports % configuration

Certainly on systemd 252 at least a configuration of
```
MemorySwapMax=40%
```
is supported but this was missing from the man page.
Only MemoryMax was documented as supporting a %.

(cherry picked from commit 8af38e5b0475f514141d314088dcf9fffd7edc37)

16 months agoMake vcs-tag do something useful for non-developer mode as well
Daan De Meyer [Fri, 19 Jul 2024 11:05:11 +0000 (13:05 +0200)]
Make vcs-tag do something useful for non-developer mode as well

When building packages of arbitrary commits of systemd-stable,
distributors might want to include a git sha of the exact commit
they're on. Let's extend vcs-tag a little to make this possible.

If we're on a commit matching a tag, don't generate a git sha at all.
If we're not on a commit matching a tag, generate a vcs tag as usually.
However, if we're not in developer mode, don't append a '^' if the tree
is dirty to accomodate package builds applying various patches to the
tree which shouldn't be considered as "dirty" edits.

(cherry picked from commit 944faf65986f36d7ed3a4ba5cb4cc763011f0f77)

16 months agotools/fetch-distro: switch to the target branch
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jul 2024 14:11:43 +0000 (16:11 +0200)]
tools/fetch-distro: switch to the target branch

We switch opensuse from "factory" to "devel". I had an old checkout that was
using the stale branch.

(cherry picked from commit 1c85d56349da7943967377e45da595e32887e0a2)

16 months agotools/fetch-distro: only fetch the configured branch
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jul 2024 14:10:49 +0000 (16:10 +0200)]
tools/fetch-distro: only fetch the configured branch

We don't need the other branches. This mostly cuts down on the
noise in output. But add '-v' to show what we're fetching.

(cherry picked from commit 8e84e154457b0d55e823f670c377233b0211d2b7)

16 months agotools/update-distro-hash: rename, fetch the repository if appropriate
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jul 2024 14:01:03 +0000 (16:01 +0200)]
tools/update-distro-hash: rename, fetch the repository if appropriate

Let's rename the tool to tools/fetch-distro. It's useful to be able to fetch
the distro directly. But when that functionality is added, the old name is
confusing.

Now --update/-u must be specified to update the commits.

--reference-if-able is used to speed up the clone of debian.
It saves about 75% of the download.

(cherry picked from commit 82c459f910c3036b22c9f41472b622ef4bfdab1d)

16 months agoMerge pull request #33803 from bluca/v256-stable v256.3
Daan De Meyer [Mon, 22 Jul 2024 15:10:11 +0000 (17:10 +0200)]
Merge pull request #33803 from bluca/v256-stable

v256 batch

16 months agomkosi: update arch commit reference
Daan De Meyer [Mon, 22 Jul 2024 08:28:57 +0000 (10:28 +0200)]
mkosi: update arch commit reference

1d577a6268 refresh the keys
12383ba712 make libarchive a regular optional dependency...
f51d5e04bf ignore rc releases in nvchecker
0b096a2baa add nvchecker
5f0ced863c upgpkg: 256.2-1: new upstream release

(cherry picked from commit 4ecd6c3552aff72a40924560d7dfe2557b6e7c8e)

16 months agomkosi: update fedora commit reference
Daan De Meyer [Mon, 22 Jul 2024 08:28:50 +0000 (10:28 +0200)]
mkosi: update fedora commit reference

00babccdea Simplify BFQ scheduler enablement
ef8ddb130b Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
5b4a5461d6 Fix changelog
a8c5c736f6 Only apply shorter shutdown timer changes on Fedora
*   f4e284cd7a Merge #150 `Deal with systemd-timesyncd backport in EPEL`
|\
| * 9378a0733a Deal with systemd-timesyncd backport in EPEL
* | 12d1f05029 Don't claim /sbin/installkernel if building for CentOS Stream 9
|/
79828f2753 spec: use "positive" conditions in conditionals
c5d3af1638 Add build dependency on rsync on CentOS Stream 9
8d080fb5cb Backport udma buffer access patch
6084453807 Add support for building from a specific branch
cb9d631ca0 Update PR patch metadata
3889da947e In standalone subpackages, suggest coreutils-single
b7800e3e66 Drop versions from Conflicts for standalone packages

(cherry picked from commit 1d8f16df903a5567e2359bac3b8ca0caf937d333)

16 months agomkosi: Use the Fedora Rawhide spec for CentOS
Daan De Meyer [Mon, 22 Jul 2024 08:25:46 +0000 (10:25 +0200)]
mkosi: Use the Fedora Rawhide spec for CentOS

These are now practically identical, with the only differences between
the two having no effect on the rpm builds we do with mkosi, so let's
cut out the middle man and just use the Fedora Rawhide spec for CentOS
as well.

(cherry picked from commit ebbae3d6328725767e23afef8692596e03f9d3d1)

16 months agomkosi: Switch back to PKG_SUBDIR instead of symlinks
Daan De Meyer [Mon, 22 Jul 2024 08:22:48 +0000 (10:22 +0200)]
mkosi: Switch back to PKG_SUBDIR instead of symlinks

Previously I thought it would make sense to allow running the build
scripts from within the VM/container to rebuild the packages. Instead
we ended up making it possible to rerun mkosi outside of the container/VM
to rebuild the packages, so let's switch back to $PKG_SUBDIR to tell the
build scripts where to look for the packaging sources.

(cherry picked from commit 762b23e86a8bd45879335af96006573a99884a71)

16 months agozsh/_networkctl: remove duplicated argument for completion (#31926)
Collin L [Mon, 22 Jul 2024 09:36:47 +0000 (17:36 +0800)]
zsh/_networkctl: remove duplicated argument for completion (#31926)

It is unnecessary, which will mess the completion.

(cherry picked from commit 733518b41350ce781c7e41a4c866eafb9e549e1f)

16 months agoimport-creds: when we hit ENOENT on SMBIOS 11 do not even debug log
Lennart Poettering [Thu, 11 Jul 2024 12:32:09 +0000 (14:32 +0200)]
import-creds: when we hit ENOENT on SMBIOS 11 do not even debug log

We'll *always* hit ENEOENT when iterating through SMBIOS type #11
fields, on the last one. it's very confusing to debug log about that,
let's just not do it.

(cherry picked from commit 5202ee42d5da0ae3a6655d2bc959a19d8c347e9d)

16 months agocore/unit: ignore dropins for masked units completely when checking need_reload
Mike Yuan [Mon, 8 Jul 2024 15:12:20 +0000 (17:12 +0200)]
core/unit: ignore dropins for masked units completely when checking need_reload

Follow-up for 19a44dfe4525ab01caf593a9c2beada4b412910d

If a drop-in is set from upper level, e.g. global unit_type.d/,
even if a unit is masked, its dropin_paths would still be partially
populated. However, unit_need_daemon_reload() would always
compare u->dropin_paths with empty strv in case of masked units,
resulting in it always returning true. Instead, let's ignore
dropins entirely here.

Fixes #33672

(cherry picked from commit 11b3775f514f521f353741ff6ac4d66cf0e928e8)

16 months agotest: add a reproducer for #33672
David Tardon [Fri, 12 Jul 2024 12:38:08 +0000 (14:38 +0200)]
test: add a reproducer for #33672

(cherry picked from commit 8b6de9e6381b39f59c936d2b0c6ce47f1b70a19e)

16 months agoshared: log error when execve fail
Mauri de Souza Meneguzzo [Tue, 25 Jun 2024 02:47:15 +0000 (23:47 -0300)]
shared: log error when execve fail

If there is an error with the execv call in fork_agent the
program exits without any meaningful log message. Log the
command and errno so the user gets more information about
the failure.

Fixes: #33418

Signed-off-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
(cherry picked from commit a408d4453145621902b9a3ef78a552f83b09bd8d)

16 months agotest-execute: ExecStop= and friends should not get credentials
Mike Yuan [Tue, 30 Apr 2024 13:55:05 +0000 (21:55 +0800)]
test-execute: ExecStop= and friends should not get credentials

See #32583

(cherry picked from commit 60b218e36e96236e6ba386686f130fe34d3e1c2a)

16 months agotest: override blocking localed policy in TEST-73-LOCALE
Luca Boccassi [Sat, 20 Jul 2024 10:34:51 +0000 (11:34 +0100)]
test: override blocking localed policy in TEST-73-LOCALE

On Debian and derivatives writing calls to localed are blocked as other
tools are used to change settings, override that policy for the tests

(cherry picked from commit 7b5c38a91def6cf236605010a0a93a1cd4c137e9)

16 months agomeson: fix missing failure if bpf-framework was enabled
Dominique Martinet [Sat, 20 Jul 2024 11:38:37 +0000 (20:38 +0900)]
meson: fix missing failure if bpf-framework was enabled

If building with clang and clang does not support bpf, then enabling
-Dbpf-framework=enabled would silently drop the feature (even printing
bpf-framework: enabled in the meson build recap, and no message anywhere
that'd hint at the failure!)

This is unexpected, so add check to fail hard in this case.

All other code paths (gcc, missing bpftool) properly check for the
option, but it is not as easy for a custom command so check explicitly

(cherry picked from commit 8da20e3fe2a544979922cea457de3031aa74d64c)

16 months agozsh: add varlinkctl completions
Ronan Pigott [Fri, 19 Jul 2024 08:20:15 +0000 (01:20 -0700)]
zsh: add varlinkctl completions

(cherry picked from commit af63b4b769bfb86ff7848af980268901e9c0b47d)

16 months agodocs: Document how to do stable releases
Daan De Meyer [Fri, 19 Jul 2024 12:00:04 +0000 (14:00 +0200)]
docs: Document how to do stable releases

(cherry picked from commit 518ea76ecdf4855a2db2c0d31ee45f4db48e3242)

16 months agoman: Mention Type=oneshot timeout directive
Lucas Werkmeister [Tue, 16 Jul 2024 16:15:32 +0000 (18:15 +0200)]
man: Mention Type=oneshot timeout directive

Make the warning for oneshot services (where RuntimeMaxSec= has no
effect) more actionable by pointing to the directive people can use
instead to effectively limit their runtime.

(cherry picked from commit 8c4aa0f1c6a78b35712fa6a7acf6d755d0c0bd86)

16 months agol10n: fix credits for the French translation
Léane GRASSER [Thu, 18 Jul 2024 13:15:16 +0000 (15:15 +0200)]
l10n: fix credits for the French translation

(cherry picked from commit 0d8b38415c4b192c1a4e608da8dc16c7340e31ba)

16 months agosd-device: remove debug log message when dirs are missing
Lennart Poettering [Wed, 17 Jul 2024 13:56:59 +0000 (15:56 +0200)]
sd-device: remove debug log message when dirs are missing

This is a common case, and nothing noteworthy at all. For example, if we
establish an enumerator for listing all devices tagged by some tag, then
the per-tag dir is not going to exist if there are currently no devices
tagged that way, but that's a really common case, and doesn't really
deserve any mention, not even at debug level.

(cherry picked from commit a68c97a54527cacaeeac0c117493639fc455ef5e)

16 months agoid128: refuse --app-specific= if we're listing GPT types
Mike Yuan [Tue, 16 Jul 2024 19:10:46 +0000 (21:10 +0200)]
id128: refuse --app-specific= if we're listing GPT types

Prompted by #33737

The intention of b37e8184a5a376749fbf68674ed6d7a4fc9901aa
is to expose sd_id128_get_app_specific() on command line.
But combining that with GPT type list makes little sense.

(cherry picked from commit fa96c55b7b0d19a7f72908ee7d3f8a1ef630be96)

16 months agogpt: add more architecture aliases
Luca Boccassi [Tue, 16 Jul 2024 16:46:54 +0000 (17:46 +0100)]
gpt: add more architecture aliases

Same as the other aliases. Allows chaining commands like:

$ systemd-id128 show -P root-$(dpkg-architecture --query DEB_HOST_ARCH)
4f68bce3e8cd4db196e7fbcaf984b709

(cherry picked from commit f0b151ce864371da06a4d4a63a2a8b5282817b7e)

16 months agokernel-install: Remove existing loader entries and UKIs
Jörg Behrmann [Fri, 12 Jul 2024 08:43:54 +0000 (10:43 +0200)]
kernel-install: Remove existing loader entries and UKIs

When boot counting is enabled, adding a new loader entry or UKI can conflict
with an existing one that has booted successfully and therefore has its boot
counter removed. systemd-bless-boot will fail to bless the new successful boot,
since a file without a boot counter already exists. Since kernel-install will
clobber existing files without boot counting, we should therefore remove files
without a boot count as well, when we add a file with one.

Fixes: #33504
(cherry picked from commit 99d4575e541fa1fb00dc80f7aad572f3a66db461)

16 months agobootspec: correct log level for fatal errors
Lennart Poettering [Fri, 5 Jul 2024 08:13:35 +0000 (10:13 +0200)]
bootspec: correct log level for fatal errors

(cherry picked from commit 7b7f4c26089ab7c34c854a2713f35ccd262cc15a)

16 months agobootspec: implement sorting by tries left/done, to match what sd-boot does
Lennart Poettering [Fri, 5 Jul 2024 07:52:58 +0000 (09:52 +0200)]
bootspec: implement sorting by tries left/done, to match what sd-boot does

(cherry picked from commit 35451a32043504013eed5725c8be46b36ccdf71a)

16 months agoboot: compare filename suffixes without case
Lennart Poettering [Thu, 4 Jul 2024 15:07:59 +0000 (17:07 +0200)]
boot: compare filename suffixes without case

This is VFAT world after all.

(cherry picked from commit 764faf60400bafb1764b728aafe0dcf4cbf07364)

16 months agoman: some fixes
Lennart Poettering [Fri, 5 Jul 2024 16:52:07 +0000 (18:52 +0200)]
man: some fixes

Addons are called addons, say so. And some other fixes.

(cherry picked from commit 40d9c16d1ee98c16af5804bab256b62c37feac3b)

16 months agoman: fix typo in unit options section
Kuntal Majumder [Tue, 9 Jul 2024 17:11:52 +0000 (19:11 +0200)]
man: fix typo in unit options section

Fixes #32918

(cherry picked from commit f9572d2b89341dfb224aa2c7222a316e59627bc9)

16 months agofsck: do not pull down mount units on soft-reboot
Luca Boccassi [Mon, 8 Jul 2024 15:23:06 +0000 (16:23 +0100)]
fsck: do not pull down mount units on soft-reboot

Otherwise they will pull down the disk too, which we don't want on soft-reboot

(cherry picked from commit bbb0b72849ebbeeb8e252d9aeed94521df4f0ae8)

16 months agoman: fix typo in the alias symlink name
ZHANG Yuntian [Fri, 5 Jul 2024 09:04:44 +0000 (17:04 +0800)]
man: fix typo in the alias symlink name

Symlink created by Alias will use the value as the file name.

(cherry picked from commit 3f0e7fd4fd1d20e3f4be18f485c76d25ce10f41b)

16 months agovmspawn: define default machines for mips targets
Henry Chen [Fri, 5 Jul 2024 03:19:35 +0000 (11:19 +0800)]
vmspawn: define default machines for mips targets

All mips variants of qemu-system default to malta.

Signed-off-by: Henry Chen <henry.chen@oss.cipunited.com>
Signed-off-by: Henry Chen <chenx97@aosc.io>
(cherry picked from commit 3bff57b7651caab41021dbcdf658c1a92c8fdf52)

16 months agopath: drop IN_ATTRIB from parent directory watches
Ronan Pigott [Mon, 1 Jul 2024 21:07:28 +0000 (14:07 -0700)]
path: drop IN_ATTRIB from parent directory watches

When watching a given pathspec, systemd unconditionally installs
IN_ATTRIB watches to track the link count of the resolved file. This
way, we are notified if the watched path disappears, even if the
resolved file inode is not removed.

Similarly, systemd installs inotify watches on each parent directory, to
be notified when the specified path appears. However, for these watches
IN_ATTRIB is an unnecessary addition to the mask. In inotify, IN_ATTRIB
on a directory is emitted whenever the attributes of any child changes,
which, for many paths, has the potential to cause a high number of
spurious wakeups in systemd. Let's remove IN_ATTRIB from the mask when
installing watches on the parent directories of the specified path.

(cherry picked from commit 8bf8c7d83dcffffa55b5f534fb98db6b01315dc1)

16 months agoRemove extra period at the end of systemd-bsod's unit description. (#33632)
fwfy [Sat, 6 Jul 2024 09:17:20 +0000 (05:17 -0400)]
Remove extra period at the end of systemd-bsod's unit description. (#33632)

* Remove extra period at end of unit description.

Having an extra period at the end of this unit description makes log entries pertaining to it appear weirdly, as it seems the default expectation is that there is not to be a period at the end of a unit description.

e.g.: `systemd[1]: Started Displays emergency message in full screen..`

(cherry picked from commit 496b4fa0e974d7a1b10b8af966da445a28f512c5)

16 months agotest: Set priority for TEST-73-LOCALE
Daan De Meyer [Fri, 5 Jul 2024 20:31:55 +0000 (22:31 +0200)]
test: Set priority for TEST-73-LOCALE

I don't know why yet, but TEST-73-LOCALE can take more than 10
minutes. Until we figure out why, let's give it a higher priority
so it doesn't bottleneck the test run.

(cherry picked from commit 14963ea90d72300d3e27b5776d1aa45594b10a94)

16 months agoTEST-06-SELINUX: Disable RuntimeBuildSources=
Daan De Meyer [Fri, 5 Jul 2024 17:20:42 +0000 (19:20 +0200)]
TEST-06-SELINUX: Disable RuntimeBuildSources=

Otherwise fixfiles will try to relabel it which could potentially
lead to disaster. We also change the recommendation in HACKING.md
to set the default so that TEST-06-SELINUX can override it.

(cherry picked from commit 575f954b5d0e03d41fe08ce2a7d85b868e89b904)

16 months agotest: Add missing --no-rebuild to doc
Daan De Meyer [Fri, 5 Jul 2024 14:06:34 +0000 (16:06 +0200)]
test: Add missing --no-rebuild to doc

Otherwise meson will try to rebuild all targets.

(cherry picked from commit b5eaa52d4958f24aba21a4a34e585156079d4abb)

16 months agomeson: Bump version to 256.3
Daan De Meyer [Fri, 19 Jul 2024 13:58:04 +0000 (15:58 +0200)]
meson: Bump version to 256.3

16 months agocore/cgroup: check root cgroup earlier for unit_get_memory_accounting
Mike Yuan [Thu, 13 Jun 2024 09:00:26 +0000 (11:00 +0200)]
core/cgroup: check root cgroup earlier for unit_get_memory_accounting

(cherry picked from commit d3d035395eeced715c9609aeb8bfac7157dd0aa9)

16 months agocore/cgroup: make unit_has_host_root_cgroup take const Unit*
Mike Yuan [Sat, 15 Jun 2024 11:15:08 +0000 (13:15 +0200)]
core/cgroup: make unit_has_host_root_cgroup take const Unit*

(cherry picked from commit 4442aef08e0fe8ba381b580455f7eb281c5a28a1)

16 months agocore: unify reset_accounting handling
Mike Yuan [Sat, 1 Jun 2024 23:50:09 +0000 (07:50 +0800)]
core: unify reset_accounting handling

Since the introduction of CGroupRuntime, there's no need
to call *_reset_accounting in unit_new(), hence make those
static. While at it, refrain from hardcoding default values
in cgroup_runtime_new(), but call the corresponding funcs.

This also corrects the default value of io_accounting_base.

Fixes #33482

(cherry picked from commit bc347edfe075f36bada0e1e7aefd62b10fcad4a7)

16 months agocore: do not drop CGroupRuntime when unit stops, but only on GC
Mike Yuan [Wed, 5 Jun 2024 18:06:46 +0000 (20:06 +0200)]
core: do not drop CGroupRuntime when unit stops, but only on GC

Fixes #33149
Replaces #33145

(cherry picked from commit 4918f14adabba71913cf3abb8b5d50a8ca0fe844)

16 months agocore/cgroup: use > 0 comparison rather than == 1
Mike Yuan [Sat, 1 Jun 2024 22:37:08 +0000 (06:37 +0800)]
core/cgroup: use > 0 comparison rather than == 1

(cherry picked from commit 8153be97c46dec725fdfaa3358d518ce350bb2ec)

16 months agocore/cgroup: actually make use of the cached accounting values
Mike Yuan [Thu, 13 Jun 2024 09:01:03 +0000 (11:01 +0200)]
core/cgroup: actually make use of the cached accounting values

If cgroup is already gone, i.e. CGRuntime.cgroup_path is NULL,
do not return -ENODATA prematurely, but check for cached values
first.

For #33149

(cherry picked from commit 3849d1f56b7ff9db94656ca84156eb9fe1574ecb)

16 months agotest-install-root: introduce test case for #33411
Mike Yuan [Wed, 19 Jun 2024 19:28:05 +0000 (21:28 +0200)]
test-install-root: introduce test case for #33411

(cherry picked from commit 9fb5a8ca24e677e10f8c2b8973b5e2a11676bda0)

16 months agoshared/install: correctly report changes in install_info_symlink_alias()
Mike Yuan [Wed, 19 Jun 2024 16:45:14 +0000 (18:45 +0200)]
shared/install: correctly report changes in install_info_symlink_alias()

Follow-up for b2751cf0394d36c24590b5f7b33e9f864b57ba0d

Also make the conditions consistent for install_info_symlink_wants().

Fixes #33411

(cherry picked from commit 4441cf330b3847d6c553fb230e8e4c86aa75ebb9)

16 months agoshared/install: propagate all errors in install_info_apply()
Mike Yuan [Wed, 19 Jun 2024 16:59:15 +0000 (18:59 +0200)]
shared/install: propagate all errors in install_info_apply()

Currently, install_info_apply() only updates r if it's 0,
meaning that if one of the earlier install_info_symlink_alias/wants()
calls returns > 0, errors generated by later calls will be discarded.
Fix that.

(cherry picked from commit a159aa07e1548367d2fde80cb0d45b869c591864)

16 months agoshared/install: drop unneeded initialization
Mike Yuan [Wed, 19 Jun 2024 16:44:26 +0000 (18:44 +0200)]
shared/install: drop unneeded initialization

(cherry picked from commit dd6b325a05c4caccd1a17dd4147f48a916eee386)

16 months agosystemctl: do not try to acquire triggering units for template units
Mike Yuan [Sun, 30 Jun 2024 11:12:45 +0000 (13:12 +0200)]
systemctl: do not try to acquire triggering units for template units

(cherry picked from commit 09d6038d833468ba7c24c658597387ef699ca4fd)

16 months agosystemctl: skip triggering unit warning if unit vanished
Mike Yuan [Thu, 29 Feb 2024 15:45:54 +0000 (23:45 +0800)]
systemctl: skip triggering unit warning if unit vanished

(cherry picked from commit 701bd9d08ac1d16f74e2b453ca0826e85b1c8491)

16 months agoman/systemctl: --no-reload is honored by mask/unmask/preset too
Mike Yuan [Fri, 28 Jun 2024 13:56:44 +0000 (15:56 +0200)]
man/systemctl: --no-reload is honored by mask/unmask/preset too

(cherry picked from commit 399646faac8ca91a46287e40280f56055c9e0fe8)

16 months agologind-dbus: set gc_mode to USER_GC_BY_PIN when disable linger
Tom Yan [Mon, 8 Jul 2024 14:10:43 +0000 (22:10 +0800)]
logind-dbus: set gc_mode to USER_GC_BY_PIN when disable linger

The mode switch from any to pin is currently done in create_session().
However, if no (pinning) session is created before (or after) linger
is disabled, the user will not be gc'd after that. Therefore, also
perform the mode switch when linger is being disabled.

(cherry picked from commit 1df981a74ae19513b40167c6b320c30bd166ac34)

16 months agologind-user: take gc_mode into account when reporting user state
Mike Yuan [Sat, 6 Jul 2024 17:05:57 +0000 (19:05 +0200)]
logind-user: take gc_mode into account when reporting user state

Prompted by #33650

Previously, if a user manually starts user@.service (which is
something we support), we'd track it as 'manager' session.
However, since user_get_state() ignores all non-pinning sessions,
if lingering is not enabled, the user state would always be
reported as 'closing', which is spurious.

Let's instead take gc_mode into consideration, and ignore
non-pinning sessions only if USER_GC_BY_PIN.

(cherry picked from commit 56f4ab290643547853276fb72b4e6960586c3e7c)

16 months agotest_ukify: do not use files from /boot
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2024 12:43:32 +0000 (14:43 +0200)]
test_ukify: do not use files from /boot

They might not be readable to the unprivileged user running the tests
and it shouldn't really matter what is used. OTOH, we need a real kernel
because we look at the header.

(cherry picked from commit 987f4bce938e790622a4b4b89d37daa7adfdc141)

16 months agotest_ukify: use sha384 in the signing tests
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2024 12:48:37 +0000 (14:48 +0200)]
test_ukify: use sha384 in the signing tests

On Fedora, with crypto policy TEST-FEDORA41, sha1 is not allowed:

$ SYSTEMD_LOG_LEVEL=debug build/systemd-measure sign
  --linux=/lib/modules/6.9.7-200.fc40.x86_64/vmlinuz
  --osrel=/tmp/tmp.osrelbl2sr77f
  --cmdline=/tmp/tmp.cmdlineouc7hqtj
  --uname=/tmp/tmp.unamecbjgesty
  --pcrpkey=/tmp/tmpufiadu8l
  --initrd=/boot/3a9d668b4db749398a4a5e78a03bffa5/6.9.7-200.fc40.x86_64/initrd
  --sbat=/tmp/tmp.sbataz9arpy0
  --private-key=/tmp/tmppyf0gx6w
  --public-key=/tmp/tmpufiadu8l
  --bank=sha1
Measuring boot phases: enter-initrd, enter-initrd:leave-initrd, enter-initrd:leave-initrd:sysinit, enter-initrd:leave-initrd:sysinit:ready
Loaded 'libtss2-esys.so.0' via dlopen()
Loaded 'libtss2-rc.so.0' via dlopen()
Loaded 'libtss2-mu.so.0' via dlopen()
PolicyPCR calculated digest: cec1a2ccb188ddd171a2be7bfa6b31cb9148776647354eb1069e0f891ed2dbe7
Failed to initialize signature context: error:03000098:digital envelope routines::invalid digest
Failed to sign PCR policy: Input/output error

(cherry picked from commit 87204601df305c270ffa05430081bc5b76dede04)