systemd/.git
17 months agocryptsetup: improve TPM2 blob display
Kamil Szczęk [Tue, 25 Jun 2024 15:44:53 +0000 (17:44 +0200)]
cryptsetup: improve TPM2 blob display

Just a tiny change to fix an eyesore in cryptsetup luksDump display :)

(cherry picked from commit 0828c6a2bf9aa40a6cf5fcb3d5650130c483ac8a)

17 months agoutil: make file_read() 64bit offset safe
Lennart Poettering [Wed, 26 Jun 2024 13:43:28 +0000 (15:43 +0200)]
util: make file_read() 64bit offset safe

File offsets in UEFI are 64bit on all archs, hence let's use that typo
too, and not create artificial confusion around types.

(cherry picked from commit 9573ab8f5a1e2dfdb3542aa647868ff73ced7dd2)

17 months agoman/capsule@.service: the capsule user is prefixed with "c-" rather than "p_"
Mike Yuan [Wed, 26 Jun 2024 14:47:48 +0000 (16:47 +0200)]
man/capsule@.service: the capsule user is prefixed with "c-" rather than "p_"

(cherry picked from commit 6343d2ea504661a009df25932fde0ccec15e38d1)

17 months agoman/capsule@.service.xml: fix typo
Carlo Teubner [Wed, 26 Jun 2024 14:39:53 +0000 (15:39 +0100)]
man/capsule@.service.xml: fix typo

(cherry picked from commit 6733d691bb96f926b380fe37aa371b9558b08384)

17 months agonspawn, vmspawn: honor the new window title switch
Mantas Mikulėnas [Mon, 17 Jun 2024 11:22:51 +0000 (14:22 +0300)]
nspawn, vmspawn: honor the new window title switch

(cherry picked from commit 0bdaa998272da778223ca1965a903c258fcbbfcd)

17 months agorun: add environment variable to prevent the setting of terminal title
Mantas Mikulėnas [Mon, 17 Jun 2024 09:41:56 +0000 (12:41 +0300)]
run: add environment variable to prevent the setting of terminal title

This goes together with the existing SYSTEMD_TINT_BACKGROUND.

Closes https://github.com/systemd/systemd/issues/33301

(cherry picked from commit 27a2513013d3b3c6140de47e04b3042c5b4487e5)

17 months agotest-execute: add a test case for issue #33299
Yu Watanabe [Sun, 23 Jun 2024 06:52:53 +0000 (15:52 +0900)]
test-execute: add a test case for issue #33299

(cherry picked from commit 956a9f00b444145ebc5ddc7c5cefb0a6c9c7ca8f)

17 months agocore: do not filter out write() if required in the very late stage
Yu Watanabe [Mon, 24 Jun 2024 20:10:04 +0000 (05:10 +0900)]
core: do not filter out write() if required in the very late stage

Before 12001b1bf067339db089d52e08fd0b4c6a9945df, write() is required for
if Type=exec. However, with the previous commit, now write() is also used
for sending handoff timestamp. Let's allow write() if necessary.

Fixes a regression caused by 12001b1bf067339db089d52e08fd0b4c6a9945df.
Fixes #33299.

(cherry picked from commit 84b79215ccc5abd6ee50ffd9df34dbbe2d29d625)

17 months agocore: use write() to send handoff timestamp
Yu Watanabe [Sun, 23 Jun 2024 06:15:30 +0000 (15:15 +0900)]
core: use write() to send handoff timestamp

Before 12001b1bf067339db089d52e08fd0b4c6a9945df, the timestamp is sent
with write(), but the commit made the timestamp sent by send(), and
causes regressin #33299.

Note the invocation will still fail if write() is filtered by seccomp.
But, that is an old issue since Type=exec is introduced
(5686391b006ee82d8a4559067ad9818e3e631247).

Partially fixes a regression caused by 12001b1bf067339db089d52e08fd0b4c6a9945df.
Partially fixes #33299.

(cherry picked from commit 5161422bb5b0cc47100163ea690252c90159b354)

17 months agoseccomp-util: split out seccomp_filter_set_add_by_name()
Yu Watanabe [Mon, 24 Jun 2024 20:08:17 +0000 (05:08 +0900)]
seccomp-util: split out seccomp_filter_set_add_by_name()

(cherry picked from commit b89a262eb57f18c2dbf6c1ee7427b6f6fd8203cf)

17 months agoFix typo in CAP_BPF description (#33464)
Eugeny Shcheglov [Mon, 24 Jun 2024 18:23:50 +0000 (21:23 +0300)]
Fix typo in CAP_BPF description (#33464)

description_good and description_bad are mixed up. Disabling CAP_BPF results in the inability to load BPF, not the other way around.

(cherry picked from commit 1750e30d237e6d9cdebc6b546d0a26342828dbd1)

17 months agotest-network: check if static routes not overridden by NDisc routes
Yu Watanabe [Sun, 23 Jun 2024 05:37:01 +0000 (14:37 +0900)]
test-network: check if static routes not overridden by NDisc routes

(cherry picked from commit 62fb079a3b4a6553d87d06a3004d21b4e322a4e5)

17 months agonetwork/ndisc: do not remove static routes when received RA with zero lifetime
Yu Watanabe [Mon, 24 Jun 2024 07:20:27 +0000 (16:20 +0900)]
network/ndisc: do not remove static routes when received RA with zero lifetime

Similar to the previous commit, but for preventing from removing static
routes on receiving RA with zero lifetime.

Fixes a regresson caused by 479d3e1994a2e4ff7070dc2a0cb1615af7120b0c.
Fixes #33346.

(cherry picked from commit fd436c8d67e75eebd0ef9499f699524e4cbe2a92)

17 months agonetwork/ndisc: do not override conflicting static routes
Yu Watanabe [Sun, 23 Jun 2024 05:36:08 +0000 (14:36 +0900)]
network/ndisc: do not override conflicting static routes

We have already ignored conflicting address configurations requested by
NDisc protocol. See ndisc_request_address().
Let's follow the same rule for routes. That is, if there are conflicting
static routes configured or requested, do not override them by NDisc.

Also, swap the order of checking existing route and existing request.

Fixes a regression caused by 972f1d17ab461a51142a142609dd3ec50bae8440.
Prompted by #33346.

(cherry picked from commit 7af3e8cd0034a6eb2e614b052c94c6d0b4556e98)

17 months agocore/exec-invoke: reopen OpenFile= fds with O_NOCTTY
Mike Yuan [Mon, 24 Jun 2024 16:26:15 +0000 (18:26 +0200)]
core/exec-invoke: reopen OpenFile= fds with O_NOCTTY

(cherry picked from commit b9c5d812d5132ea1d6a7146be80d41ae2ccb288e)

17 months agocore: verify WorkingDirectory= is outside of API VFS only under mount namespacing
Mike Yuan [Sun, 23 Jun 2024 16:12:33 +0000 (18:12 +0200)]
core: verify WorkingDirectory= is outside of API VFS only under mount namespacing

The purpose of the check is to prevent leaking API VFS fds
from host into a mount namespace/container. When mountns
is not used at all, the check is pointless and causes
inconvenience. E.g. file managers might need to be spawned
under those directories, and they surely won't run in mountns.

Suggested in https://github.com/systemd/systemd/pull/33454#issuecomment-2186351467
Fixes #33361

(cherry picked from commit 276bd392ecdd6febaeac82e7d6f46a035826f98d)

17 months agoterminal-util: use colon as separator for specifying color
Yu Watanabe [Mon, 24 Jun 2024 08:55:17 +0000 (17:55 +0900)]
terminal-util: use colon as separator for specifying color

Then, terminal will safely ignore unsupported features, like colored
underline.

Fixes a regression caused by 891abc9cf1d3d7afd7b740b4077551dcfb5f8e16.
Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074073.
Fixes #33449.

(cherry picked from commit 6eabe9f2ff48c1b6924724d5afe64e7b661ccdbf)

17 months agoman: fix double is typo in systemd-tmpfiles
Diego Viola [Sat, 22 Jun 2024 02:46:32 +0000 (23:46 -0300)]
man: fix double is typo in systemd-tmpfiles

Signed-off-by: Diego Viola <diego.viola@gmail.com>
(cherry picked from commit a78394a49a3bc8eedb9fc2df10c41765bd823c8e)

17 months agotest: skip test-cgroup-id on ENOSYS from cg_cgroupid_open
Nick Rosbrook [Thu, 20 Jun 2024 15:27:03 +0000 (11:27 -0400)]
test: skip test-cgroup-id on ENOSYS from cg_cgroupid_open

Most container managers will block open_by_handle_at with seccomp to
mitigate a container escape attack. LXD in particular returns ENOSYS
rather than e.g. EPERM like nspawn. Skip this test if we get ENOSYS
from open_by_handle_at via cg_cgroupid_open.

(cherry picked from commit 82f57401d933596746c32a955773bc70be53b0ac)

17 months agomeson: bpf: propagate 'sysroot' for cross compilation
Johannes Schneider [Thu, 20 Jun 2024 10:32:18 +0000 (12:32 +0200)]
meson: bpf: propagate 'sysroot' for cross compilation

During cross-compilation of systemd, the compiler used to build the bpf's needs
to be pointed at the correct include searchpath. Which can be done by passing
the corresponding directory in through the cflags; for example in yocto/bitbake
this would work: CFLAGS += "--sysroot=${STAGING_DIR_TARGET}"

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
(cherry picked from commit b608bf5620765de20851eca55cbd6c42ce1af450)

17 months agokernel-install: correct the place where it works in man and help text
Antonio Alvarez Feijoo [Wed, 19 Jun 2024 12:41:55 +0000 (14:41 +0200)]
kernel-install: correct the place where it works in man and help text

(cherry picked from commit 111f9889927d75b82264fcaf59b99b879a4a8a26)

17 months agoman/systemd.exec: list inaccessible files for ProtectKernelTunables
Maximilian Wilhelm [Wed, 19 Jun 2024 11:41:39 +0000 (13:41 +0200)]
man/systemd.exec: list inaccessible files for ProtectKernelTunables

(cherry picked from commit 163bb43ceaa1e5bdcda27c4417339b3af9cf28af)

17 months agoUse consistent spelling of systemd.condition_first_boot argument
pyfisch [Tue, 18 Jun 2024 20:22:15 +0000 (22:22 +0200)]
Use consistent spelling of systemd.condition_first_boot argument

(cherry picked from commit 051d462b42fe6c27824046c15cd3c84fa5afe05b)

17 months agologin/user-runtime-dir: free ignored sd_bus_error, avoid triggering assertion
Mike Yuan [Tue, 18 Jun 2024 14:32:14 +0000 (16:32 +0200)]
login/user-runtime-dir: free ignored sd_bus_error, avoid triggering assertion

Fixes #33388

(cherry picked from commit 909ba6907032caee1157a3e3afd53640798ea817)

17 months agologin/user-runtime-dir: use STRLEN where appropriate
Mike Yuan [Tue, 18 Jun 2024 14:31:12 +0000 (16:31 +0200)]
login/user-runtime-dir: use STRLEN where appropriate

Also, add missing trailing / to paths used in STRLEN/sizeof.

(cherry picked from commit 0b8a714b2bb69cba68daec4f742c1b85bbafbdb1)

17 months agopretty-print: take console glyph width into account when drawing progress bar
Lennart Poettering [Fri, 24 May 2024 11:56:10 +0000 (13:56 +0200)]
pretty-print: take console glyph width into account when drawing progress bar

So far this used string length, not character width. Fix that.

(cherry picked from commit 1ad4e37da164041605d18c28ee1868cf942f7857)

17 months agomkosi: add support for TEST_SAVE_JOURNAL to integration test wrapper
Luca Boccassi [Mon, 24 Jun 2024 14:20:11 +0000 (15:20 +0100)]
mkosi: add support for TEST_SAVE_JOURNAL to integration test wrapper

Same variable and values as supported by the shell suite

(cherry picked from commit 59d4970a552cbc30d7977bdc9eca756b41260875)

17 months agosemaphore: pin packaging to ci/v256/stable branch
Luca Boccassi [Thu, 4 Jul 2024 22:32:43 +0000 (23:32 +0100)]
semaphore: pin packaging to ci/v256/stable branch

The packaging in debian/master is no longer compatible with v256-stable
so switch it

17 months agotest: skip TEST-69-SHUTDOWN on Debian
Luca Boccassi [Thu, 4 Jul 2024 00:01:08 +0000 (01:01 +0100)]
test: skip TEST-69-SHUTDOWN on Debian

There is a regression in the login package, skip the test until
it is fixed. https://bugs.debian.org/1075733

(cherry picked from commit 92d9d5ca70b0a8b3aea12f24e9cd0f770c31a94c)

17 months agomeson: Bump version to 256.2~devel
Daan De Meyer [Thu, 4 Jul 2024 09:01:44 +0000 (11:01 +0200)]
meson: Bump version to 256.2~devel

We need this so the packages built in CI are considered more recent
than the stable releases shipped by distributions.

17 months agomeson: Fix various versions
Daan De Meyer [Thu, 4 Jul 2024 12:44:21 +0000 (14:44 +0200)]
meson: Fix various versions

Follow up for 8b3b01c4b7e0fde39b4be354990ee68f5e612c52

We switch to PROJECT_VERSION instead of PROJECT_VERSION_FULL where
we report our version and which is likely being parsed to avoid
breaking compat. If we didn't, the output would change from systemd
255 to systemd 255.1 which could break various tools.

(cherry picked from commit 6a4fcf8cefceba151e11f85e784c8962b6fc383b)

17 months agosrc/boot/efi/meson.build: ensure VERSION_TAG exists in case of cross build
Chen Qi [Thu, 4 Jul 2024 06:18:41 +0000 (23:18 -0700)]
src/boot/efi/meson.build: ensure VERSION_TAG exists in case of cross build

The GIT_VERSION is changed to use VERSION_TAG, but in case of cross build
for src/boot/efi, it's not set, causing build error because the compiler cannot
know it's a macro thus treating it as some variable and error out.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
(cherry picked from commit 646ed5af0013accacac1f4ac048371bebec52f60)

17 months agomkosi: Build a disk image by default again
Daan De Meyer [Thu, 4 Jul 2024 10:13:31 +0000 (12:13 +0200)]
mkosi: Build a disk image by default again

Now that we have a way to rebuild and reinstall systemd without
having to rebuild the image, let's default to building a disk image
again.

(cherry picked from commit 96110261ee7716bf19a6920a4206365614ad3857)

17 months agomeson: Deal with potential stable versions
Daan De Meyer [Thu, 4 Jul 2024 09:12:35 +0000 (11:12 +0200)]
meson: Deal with potential stable versions

The meson.version file might contain e.g. 256.2~devel in a stable
branch so let's make sure we deal with that.

(cherry picked from commit 8b3b01c4b7e0fde39b4be354990ee68f5e612c52)

17 months agomkosi: bump to latest commit
Luca Boccassi [Wed, 26 Jun 2024 14:21:14 +0000 (15:21 +0100)]
mkosi: bump to latest commit

(cherry picked from commit ea6376d17f4475d470925adfe7bf1bac577e96b2)

17 months agomkosi: Switch back to btrfs
Daan De Meyer [Thu, 27 Jun 2024 10:08:51 +0000 (12:08 +0200)]
mkosi: Switch back to btrfs

Now that we're running on Noble instead of Jammy btrfs has the temp_fsid
feature which means we can mount the same image multiple times so let's
switch back to btrfs instead of ext4 as the filesystem as btrfs properly
records timestamps when building filesystems from a root directory unlike
ext4.

(cherry picked from commit 93440db8b5eae1244aaf5fecfa68050a8b26f3e3)

17 months agomkosi: Install btrfs-progs on CentOS as well
Daan De Meyer [Thu, 27 Jun 2024 13:45:44 +0000 (15:45 +0200)]
mkosi: Install btrfs-progs on CentOS as well

(cherry picked from commit 48e7d0e91e1c9d86c660a67a8ca29aa79deee33d)

17 months agomkosi: Enable hyperscale-packages-experimental for CentOS
Daan De Meyer [Thu, 27 Jun 2024 10:49:59 +0000 (12:49 +0200)]
mkosi: Enable hyperscale-packages-experimental for CentOS

This gets us a kernel with btrfs support.

(cherry picked from commit 6f1f13ca9f8db424c613332ec4739e53b2db6fdf)

17 months agomkosi: Drop leftover systemd-coredump-debuginfo package for opensuse
Daan De Meyer [Thu, 27 Jun 2024 08:14:32 +0000 (10:14 +0200)]
mkosi: Drop leftover systemd-coredump-debuginfo package for opensuse

The package was merged into the main systemd package in
https://src.opensuse.org/rpm/systemd/commit/23bfa9d83b6e24a5395a704b816a351f3dc5b5316e580cacedd1b5d9e068c117.

(cherry picked from commit 21942c008e6540f2ff905a2c6de35475037e734b)

17 months agomkosi: Drop s390x console patch from opensuse spec
Daan De Meyer [Thu, 27 Jun 2024 07:49:40 +0000 (09:49 +0200)]
mkosi: Drop s390x console patch from opensuse spec

This patch does not apply anymore on upstream, so let's remove it
from the spec before building until the spec is fixed.

(cherry picked from commit f92a005cd13ee1df95f3ea16e421f7757fb0f424)

17 months agomkosi: use new standalone-shutdown package for debian's exitrd
Luca Boccassi [Wed, 26 Jun 2024 14:21:33 +0000 (15:21 +0100)]
mkosi: use new standalone-shutdown package for debian's exitrd

(cherry picked from commit efd5314c5036cc41f3dde0e2ef33c3cbd4314e3f)

17 months agomkosi: update debian commit reference
Daan De Meyer [Tue, 25 Jun 2024 14:18:02 +0000 (16:18 +0200)]
mkosi: update debian commit reference

3b4368d4b8 d/not-installed: fix shutdown.standalone path
2de05155e8 Update changelog for 256.1-2 release
cd98bcef06 autopkgtest: add dependency on libcryptsetup-dev in unit-tests suite
e220ce22f1 Bump breaks/replaces to conflicts for DEP17

(cherry picked from commit 0d40269e5a71d56734eeb30e41fc74c3c0bea7d4)

17 months agomkosi: bump Debian Salsa commit to latest
Luca Boccassi [Sun, 23 Jun 2024 09:20:27 +0000 (10:20 +0100)]
mkosi: bump Debian Salsa commit to latest

(cherry picked from commit 8a91a43197b63e84f6a7439585204a36c70040ba)

17 months agomkosi: install new split-out systemd packages
Luca Boccassi [Sun, 23 Jun 2024 09:10:26 +0000 (10:10 +0100)]
mkosi: install new split-out systemd packages

repart and cryptsetup tools were moved out of the main package
to reduce dependencies.

(cherry picked from commit 621a7fe0647eca4ced4914c1c9beb569678b304b)

17 months agomkosi: update arch commit reference
Daan De Meyer [Wed, 3 Jul 2024 06:23:29 +0000 (08:23 +0200)]
mkosi: update arch commit reference

d74b24c7c6 meson options: vcs-tag=false
7424fedef0 upgpkg: 256.1-1: new upstream release
6016864c99 upgpkg: 256-3: rebuild to fix man pages...
6f6d48b221 upgpkg: 256-2: update shells
b9ce44e766 drop systemd-stable repository, build from main one
baf4803252 upgpkg: 256-1: new upstream release
1d75e7ddaa add an install hint on NEWS
6f17a23127 Ups, inverted...
d76029f7cc update meson options
6e7929dd98 upgpkg: 256rc4-1: new upstream pre-release - testing only!
7b70e7b0e7 upgpkg: 256rc3-2: fast-forward to current git main, non-official testing
a438b879e2 upgpkg: 256rc3-1: new upstream pre-release, non-official testing
ff30a600c9 upgpkg: 256rc2-1: new upstream pre-release, non-official testing

(cherry picked from commit cd98453908a9a2e2c7c0dc3064599c8b2184431a)

17 months agomkosi: switch opensuse to devel branch
Luca Boccassi [Wed, 26 Jun 2024 14:52:23 +0000 (15:52 +0100)]
mkosi: switch opensuse to devel branch

The factory branch seems to have been reset to 9 years ago, switch
to devel

(cherry picked from commit 582718d959c66e3e7108310662ec8ae587ae6862)

17 months agomkosi: update fedora commit reference
Daan De Meyer [Wed, 3 Jul 2024 06:21:31 +0000 (08:21 +0200)]
mkosi: update fedora commit reference

f9fe17dbde Use vmlinux.h from kernel-devel
9cbad936a6 Pull in openssl-devel-engine
8ae009f929 Only add Requires on python3-zstd on Fedora
750e910c7c Drop BuildRequires on python3-zstd

(cherry picked from commit 6bd14bf4b3ec85101ba6ce75a4292d61066a5e68)

17 months agomkosi: update fedora commit reference
Daan De Meyer [Tue, 25 Jun 2024 14:34:28 +0000 (16:34 +0200)]
mkosi: update fedora commit reference

8153d9b0f9 Revert "Remove tmpfiles snippet for /home and /srv"
a76669ee22 Remove tmpfiles snippet for /home and /srv
b3e1d52cb4 Soft-disable tmpfiles --purge until a good use case comes up
4a29ab3f3b Version 256.1
ebf352d292 disable auto-features when bootstrapping
1ae0516ae7 Version 256
b32641170e Restore patch to drop varlink method call
421f0041b3 Version 256~rc4
65d9b49791 Fix typo
c56891fb68 Drop sysusers.d/basic.conf
69472997b9 Renumber sources and make order more consistent

(cherry picked from commit b6a9ad2c62fef8da07d4feb2c0190b4176b2b7b9)

17 months agomkosi: Install zypper in opensuse images
Daan De Meyer [Wed, 3 Jul 2024 20:48:37 +0000 (22:48 +0200)]
mkosi: Install zypper in opensuse images

(cherry picked from commit 18c98a839fc589d80eb256428f9eb091bb028171)

17 months agomkosi: Fix sync script git command
Daan De Meyer [Wed, 3 Jul 2024 20:18:07 +0000 (22:18 +0200)]
mkosi: Fix sync script git command

Let's make sure we actually operate on the packaging git repo.

(cherry picked from commit d1bbeeea4cd9317ad5915c99641aa9d82c4bc37d)

17 months agomkosi: Clean up old packages from the build directory
Daan De Meyer [Wed, 3 Jul 2024 18:20:31 +0000 (20:20 +0200)]
mkosi: Clean up old packages from the build directory

(cherry picked from commit 2f6046f66b61e4f12a53d6d93dcd59f25971ccf6)

17 months agomkosi: remove conflicting deb packages from builddir
Luca Boccassi [Wed, 3 Jul 2024 18:15:03 +0000 (19:15 +0100)]
mkosi: remove conflicting deb packages from builddir

These are not actually needed or installed, so delete them from the
build directory, so that inside an image one can do:

apt install --reinstall /work/build/*.deb

Follow-up for 690a85b1d4e794af62bca6d1ea530ffc530ee58c

(cherry picked from commit ce513c6c6cfbb52dd4736f8074b61d2dfdb2417d)

17 months agomkosi: Copy packages to the build directory as well
Daan De Meyer [Wed, 3 Jul 2024 12:28:21 +0000 (14:28 +0200)]
mkosi: Copy packages to the build directory as well

With the latest mkosi, mkosi -t none can be used to rerun the build
script without messing with a previously built image. This allows
one to run "mkosi -t disk -f qemu" in one terminal to build and boot
an image in qemu and then run "mkosi -t none" in another terminal to
rebuild the packages. If one then has "RuntimeBuildSources=yes" set
in their mkosi configuration, the build directory is mounted into the
virtual machine, which means that one can then run "dnf upgrade
/work/build/*.rpm" from within the VM to install the new packages.

This allows for quickly iterating on changes without having to rebuild
the image all the time.

We'll probably want to document this at some point, but let's start
with making it possible by copying the built packages to the build directory.

(cherry picked from commit 690a85b1d4e794af62bca6d1ea530ffc530ee58c)

17 months agomkosi: Make sure we don't hide errors from git merge-base
Daan De Meyer [Wed, 3 Jul 2024 11:19:34 +0000 (13:19 +0200)]
mkosi: Make sure we don't hide errors from git merge-base

Currently if git merge-base fails we'll hide the error and exit with
exit status 0. Let's make we only exit early if git merge-base exits
with 1 which indicates the current commit is not on the target branch.
Any other error is considered fatal.

(cherry picked from commit 2fe6ad5a64bca187712708d41269091c91500a35)

17 months agomkosi: Install perf
Daan De Meyer [Tue, 2 Jul 2024 13:46:09 +0000 (15:46 +0200)]
mkosi: Install perf

It's already installed on ubuntu via linux-tools-common.

(cherry picked from commit cca8c15599b888fc757d7e17a8a8949bca522447)

17 months agomkosi: Install pciutils
Daan De Meyer [Fri, 28 Jun 2024 11:41:12 +0000 (13:41 +0200)]
mkosi: Install pciutils

(cherry picked from commit 3cdc8da5ad4beb9bdb06e9c6ca3544da410454ce)

17 months agomkosi: move variable to the right scope
Zbigniew Jędrzejewski-Szmek [Thu, 6 Jun 2024 11:23:17 +0000 (13:23 +0200)]
mkosi: move variable to the right scope

(cherry picked from commit 3690971cd0d11749e82bc1cb69d5a1e80284ab46)

17 months agomkosi: Don't touch the packaging checkout if work is being done
Daan De Meyer [Tue, 2 Jul 2024 20:27:01 +0000 (22:27 +0200)]
mkosi: Don't touch the packaging checkout if work is being done

If work is being done in a separate branch, don't touch the packaging
checkout.

(cherry picked from commit 88e92306431bd5928ab4e5c18310e36de9ffa3f6)

17 months agovmspawn: define QEMU_MACHINE_TYPE for loongarch64
Robin Lee [Mon, 24 Jun 2024 05:48:32 +0000 (13:48 +0800)]
vmspawn: define QEMU_MACHINE_TYPE for loongarch64

Use ["virt"](https://www.qemu.org/docs/master/system/loongarch/virt.html) as a commonly used generic platform on loongarch64.

(cherry picked from commit 6efab8c343f0881ad9e1800facb0d08594b025ee)

17 months agovmspawn: define QEMU_MACHINE_TYPE for riscv
Xeonacid [Wed, 19 Jun 2024 09:56:57 +0000 (17:56 +0800)]
vmspawn: define QEMU_MACHINE_TYPE for riscv

Use ["virt"](https://www.qemu.org/docs/master/system/target-riscv.html#board-specific-documentation) as a commonly used generic platform on riscv.

(cherry picked from commit 5f7136a3690cd118eeef3c84dfbd9f5d0df556d6)

17 months agodocs: fix dead link to GNOME documentation
Luca Boccassi [Thu, 27 Jun 2024 16:59:01 +0000 (17:59 +0100)]
docs: fix dead link to GNOME documentation

(cherry picked from commit b22ee1010d4ba2e0049b162483c0f185c367d0bb)

17 months agologs-show: do not use _SOURCE_MONOTONIC_TIMESTAMP field v256.1
Yu Watanabe [Tue, 18 Jun 2024 08:55:31 +0000 (17:55 +0900)]
logs-show: do not use _SOURCE_MONOTONIC_TIMESTAMP field

The timestamp is not in CLOCK_MONOTONIC, but CLOCK_BOOTTIME,
while header monotonic timestamp is in CLOCK_MONOTONIC. Hence, we cannot
adjust timestamp by comparing with header monotonic timestamp and
_SOURCE_MONOTONIC_TIMESTAMP field.

Fixes a regression caused by affde1d7e79a634ee6053dbd4a57b3b51b74c170.
Fixes #33293.

(cherry picked from commit 144498e7e6efe2d90981cb14e3ed462a70a955c6)

17 months agorepart: fix memory leak
Antonio Alvarez Feijoo [Tue, 18 Jun 2024 12:07:50 +0000 (14:07 +0200)]
repart: fix memory leak

(cherry picked from commit a81f5ffd40081441dafc678fe83d185436dde35a)

17 months agomkosi: restrict noble-backports to noble builds
Luca Boccassi [Tue, 18 Jun 2024 12:35:32 +0000 (13:35 +0100)]
mkosi: restrict noble-backports to noble builds

Follow-up for c01cb8cbff8512b65b7903b55f78c8d12661b8d7

(cherry picked from commit f97b243edfcae211aade6ceb2fd89ae9d9209fac)

17 months agotmpfiles: move --purge to command section in --help text where it belongs
Lennart Poettering [Tue, 18 Jun 2024 07:56:15 +0000 (09:56 +0200)]
tmpfiles: move --purge to command section in --help text where it belongs

Also, make contrast between --remove and --purge clearer: one deletes
files marked for deletion, the other deletes files marked for creation.

(cherry picked from commit 69d76823ce6e9c307184946ed55b207eb728e625)

17 months agotmpfiles: insist on at least one configuration file being specified on --purge
Lennart Poettering [Tue, 18 Jun 2024 07:55:20 +0000 (09:55 +0200)]
tmpfiles: insist on at least one configuration file being specified on --purge

Also, extend the man page explanation substantially, matching more
closely what --create says.

Fixes: #33349
(cherry picked from commit 41064a3c97c9a53c97bbe8a1de799a82c4374a2d)

17 months agotmpfiles: honour --dry-run when removing directories
Lennart Poettering [Tue, 18 Jun 2024 07:54:33 +0000 (09:54 +0200)]
tmpfiles: honour --dry-run when removing directories

(cherry picked from commit edeceb80a91e8400e8c22f08a41045a2ba270fe6)

17 months agoinstall: allow removing symlinks even for units that are gone
Luca Boccassi [Fri, 7 Jun 2024 20:39:45 +0000 (21:39 +0100)]
install: allow removing symlinks even for units that are gone

If a symlink is leftover, still allow cleaning it up via 'disable'. This
happens when a unit is stopped and removed, but not disabled, and a reload
has already happened. At that point, cleaning up the old symlinks becomes
impossible through the APIs, and needs to be done manually. Always allow
cleaning up symlinks, if they exist, by only erroring out if there is an
OOM.

Follow-up for f31f10a6207efc9ae9e0b1f73975b5b610914017

(cherry picked from commit 5163c9b1e56293b1bb2803420613c5b374570892)

17 months agoNEWS: fix typo
Carlo Teubner [Tue, 18 Jun 2024 08:41:59 +0000 (09:41 +0100)]
NEWS: fix typo

(cherry picked from commit f6d517f8478bdd83b7d149b242a47d7686235c7e)

17 months agomkosi: bump to latest
Luca Boccassi [Mon, 17 Jun 2024 14:40:10 +0000 (15:40 +0100)]
mkosi: bump to latest

(cherry picked from commit 3001339dc5b3faf8f8edee4c07b14a4abdf3d66f)

17 months agoCI: disable secure boot in mkosi GHA runs
Luca Boccassi [Mon, 17 Jun 2024 16:40:28 +0000 (17:40 +0100)]
CI: disable secure boot in mkosi GHA runs

Booting a guest with secure boot is broken in Azure due to a hypervisor
bug. Disable it for now. Given there's no option, need to edit
the configuration on the fly.

(cherry picked from commit bdd0b45bfd7190bb8eb50c71ff6f50a80d6e6e52)

17 months agotest-network: mention that the captive portal option is supported since v2.20
Yu Watanabe [Mon, 17 Jun 2024 15:09:03 +0000 (00:09 +0900)]
test-network: mention that the captive portal option is supported since v2.20

The current latest release is v2.19, hence the test is typically skipped now.

(cherry picked from commit 4f6d8ab0767e534553bfa130f39dbb07ebb804a4)

17 months agocore/service: fix accept-socket deserialization
Mike Yuan [Mon, 17 Jun 2024 05:47:20 +0000 (07:47 +0200)]
core/service: fix accept-socket deserialization

Follow-up for 45b1017488cef2a5bacdf82028ce900a311c9a1c

(cherry picked from commit 9f5d8c3da4f505346bd1edfae907a2abcdbdc578)

17 months agotest: use 'auto' instead of 'uefi' for automated fallback
Luca Boccassi [Mon, 17 Jun 2024 14:37:43 +0000 (15:37 +0100)]
test: use 'auto' instead of 'uefi' for automated fallback

mkosi will prefer UEFI if the architecture supports it, but fallback
to 'linux' if it doesn't.

(cherry picked from commit 80468db8fa21ffd07dc2f28c656eeaf8f0292367)

17 months agotest: support TEST_NO_QEMU in mkosi integration wrapper
Luca Boccassi [Mon, 17 Jun 2024 13:09:40 +0000 (14:09 +0100)]
test: support TEST_NO_QEMU in mkosi integration wrapper

Same as the old integration test suite, allow skipping tests that
require qemu.
ppc64el's vsock support doesn't appear to work, so we'll skip it,
as it is already done in the legacy framework.

(cherry picked from commit 464d182b3e470e4163ca376145539a537a6e43a2)

17 months agotest: support TEST_NO_KVM
Luca Boccassi [Sun, 16 Jun 2024 18:15:24 +0000 (19:15 +0100)]
test: support TEST_NO_KVM

The shell integration suite allows to manually deselect KVM, so
suppor the same env var for the same purpose in python.

(cherry picked from commit 7d2701e7d1d0a7194026dd371071df6e63f59a82)

17 months agotest: drop obsolete comment
Luca Boccassi [Sun, 16 Jun 2024 18:21:32 +0000 (19:21 +0100)]
test: drop obsolete comment

We want to keep various logic here instead of mkosi, so drop the
temporary comment

(cherry picked from commit 626518ecd5e7b0c0c708ba53d7eb62934506ed54)

17 months agotest: drop unneeded firmware: uefi setting
Luca Boccassi [Sun, 16 Jun 2024 15:08:57 +0000 (16:08 +0100)]
test: drop unneeded firmware: uefi setting

These tests no longer need this, as they are running in nspawn, drop it

(cherry picked from commit f44fc531c95e37c83203375c411189009a01b482)

17 months agotest: check the skip condition before installing additional files
Luca Boccassi [Sun, 16 Jun 2024 12:41:50 +0000 (13:41 +0100)]
test: check the skip condition before installing additional files

(cherry picked from commit e1daedb4be6d8180790e0b303872fb1c87ddc7fc)

17 months agomkosi: install EFI packages only on EFI architectures
Luca Boccassi [Sun, 16 Jun 2024 19:42:12 +0000 (20:42 +0100)]
mkosi: install EFI packages only on EFI architectures

sbsigntool, systemd-boot and systemd-boot-efi do not  exist on other
architectures

(cherry picked from commit 47fe3f29b4ba1b44ae71a7e67c579c4883731dd4)

17 months agomkosi: use ports.ubuntu.com for non-x86 backports
Luca Boccassi [Sun, 16 Jun 2024 14:28:56 +0000 (15:28 +0100)]
mkosi: use ports.ubuntu.com for non-x86 backports

Follow-up for 46368556afee7a1f3a1685609942438ef2d9d6c1

(cherry picked from commit c01cb8cbff8512b65b7903b55f78c8d12661b8d7)

17 months agomkosi: enable unprivileged user ns for integration tests
Luca Boccassi [Sun, 16 Jun 2024 10:16:21 +0000 (11:16 +0100)]
mkosi: enable unprivileged user ns for integration tests

Ubuntu disables them by default in Noble, ship a sysctl to turn them back on
so that tests can use them

(cherry picked from commit 4cfcde024f34b3e5f682364d4e0c6185ef07d467)

17 months agoman,units: drop "temporary" from description of systemd-tmpfiles
Mike Yuan [Sat, 15 Jun 2024 15:27:33 +0000 (17:27 +0200)]
man,units: drop "temporary" from description of systemd-tmpfiles

Historically, systemd-tmpfiles was designed to manager temporary
files, but nowadays it has become a generic tool for managing
all kinds of files. To avoid user confusion, let's remove "temporary"
from the tool's description.

As discussed in #33349

(cherry picked from commit b5c8cc0a3b8e4e2fea0539d6420a76b524ea5735)

17 months agoman: add a bit of a warning to systemd-tmpfiles --purge
Nick Rosbrook [Fri, 14 Jun 2024 21:31:22 +0000 (17:31 -0400)]
man: add a bit of a warning to systemd-tmpfiles --purge

Mention that by default, /home is managed by tmpfiles.d/home.conf, and
recommend that users run systemd-tmpfiles --dry-run --purge first to
see exactly what will be removed.

(cherry picked from commit 9ebcac3b5125a8b0b11f371731ea167cd4684adc)

17 months agofundamental: declare flex array updated for gcc15 and clang 19
Cristian Rodríguez [Thu, 13 Jun 2024 15:59:28 +0000 (11:59 -0400)]
fundamental: declare flex array updated for gcc15 and clang 19

Silly workaround that:
- allowed flexible arrays in unions
- allowed flexible arrays in otherwise empty structs

Is no longer needed since https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=adb1c8a0f167c3a1f7593d75f5a10eb07a5d741a
(GCC15) or clang 19 https://github.com/llvm/llvm-project/commit/14ba782a87e16e9e15460a51f50e67e2744c26d9

(cherry picked from commit 3c2f2146f50c75662987541719bedc4aee9df939)

17 months agoanalyze: show pcrs also in sha384 bank
Lennart Poettering [Tue, 4 Jun 2024 09:02:34 +0000 (11:02 +0200)]
analyze: show pcrs also in sha384 bank

SHA384 is pretty much the bank we actually *want* to use, since it's
faster to calculate than SHA256, hence at the very least, start
considering.

(cherry picked from commit acaca5ab250a51be6ba07768bee80bf0f7b462fa)

17 months agoCODING_STYLE: document "reterr_" return parameters
Lennart Poettering [Wed, 12 Jun 2024 16:31:56 +0000 (18:31 +0200)]
CODING_STYLE: document "reterr_" return parameters

In some recent PRs (e.g. #32628) I started to systematically name return
parameters that shall only be initialized on failure (because they carry
additional error meta information, such as the line/column number of
parse failures or so). Let's make this official in the coding style.

(cherry picked from commit 7811864b08393eda5ff92145ea2776180d9b28ee)

17 months agoshell-completion: only offer devices for completion
David Tardon [Wed, 12 Jun 2024 12:35:34 +0000 (14:35 +0200)]
shell-completion: only offer devices for completion

This skips directories and other stuff like /dev/core, /dev/initctl or
/dev/log.

(cherry picked from commit bde35f4a91663ebb854330f582baeef0f9adcbfb)

17 months agoNEWS: note that new stable releases will be in the main repo
Luca Boccassi [Tue, 11 Jun 2024 22:09:30 +0000 (23:09 +0100)]
NEWS: note that new stable releases will be in the main repo

(cherry picked from commit 40d637bace4041f081088673cb230669c1e34faf)

17 months agorepart: Use CRYPT_ACTIVATE_PRIVATE
Daan De Meyer [Mon, 3 Jun 2024 10:35:29 +0000 (12:35 +0200)]
repart: Use CRYPT_ACTIVATE_PRIVATE

Let's skip udev device scanning when activating a LUKS volume in
systemd-repart as we don't depend on any udev symlinks and don't
expect anything except repart to access the volume.

Suggested by https://github.com/systemd/systemd/issues/33129#issuecomment-2143390941.

(cherry picked from commit 726fc7ae696510b04c24810f691d34f5d20529d6)

17 months agotest: dump a simple summary at the end of TEST-02-UNITTEST
Frantisek Sumsal [Wed, 12 Jun 2024 10:09:25 +0000 (12:09 +0200)]
test: dump a simple summary at the end of TEST-02-UNITTEST

Let's dump a list of skipped tests and logs from failed tests at the end
of TEST-02-UNITTEST to make debugging fails in CI slightly less painful.

(cherry picked from commit 2ac0e52f29eb5f0040882fc46bcfa369893577f3)

17 months agorepart: Use crypt_reencrypt_run() if available
Daan De Meyer [Sun, 2 Jun 2024 14:24:52 +0000 (16:24 +0200)]
repart: Use crypt_reencrypt_run() if available

crypt_reencrypt() is deprecated, so let's look for and prefer
crypt_reencrypt_run() if it is available.

(cherry picked from commit b99b2941276a74878a23470b36c75b0c21dbdd4a)

17 months agoresolved: permit dnssec rrtype questions when we aren't validating
Ronan Pigott [Fri, 8 Mar 2024 20:40:08 +0000 (13:40 -0700)]
resolved: permit dnssec rrtype questions when we aren't validating

This check introduced in 91adc4db33f6 is intended to spare us from
encountering broken resolver behavior we don't want to deal with.
However if we aren't validating we more than likely don't know the state
of the upstream resolver's support for dnssec. Let's let clients try
these queries if they want.

This brings the behavior of sd-resolved in-line with previouly stated
change in the meaning of DNSSEC=no, which now means "don't validate"
rather than "don't validate, because the upstream resolver is declared to
be dnssec-unaware".

Fixes: 9c47b334445a ("resolved: enable DNS proxy mode if client wants DNSSEC")
(cherry picked from commit 364c948707afa097f6ad177b61c2b51a86c0089a)

17 months agotpm2-setup: Don't fail if we can't access the TPM due to authorization failure
Daan De Meyer [Fri, 17 May 2024 14:20:11 +0000 (16:20 +0200)]
tpm2-setup: Don't fail if we can't access the TPM due to authorization failure

The TPM might be password/pin protected for various reasons even if
there is no SRK yet. Let's handle those cases gracefully instead of
failing the unit as it is enabled by default.

(cherry picked from commit d6518003f8ebbfb6f85dbf227736ae05b0961199)

17 months agostrbuf: use GREEDY_REALLOC to grow the buffer
q66 [Thu, 6 Jun 2024 11:45:48 +0000 (13:45 +0200)]
strbuf: use GREEDY_REALLOC to grow the buffer

This allows us to reserve a bunch of capacity ahead of time,
improving the performance of hwdb significantly thanks to not
having to reallocate so many times.

Before:
```
$ sudo time valgrind --leak-check=full ./systemd-hwdb update
==113297== Memcheck, a memory error detector
==113297== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==113297== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==113297== Command: ./systemd-hwdb update
==113297==
==113297==
==113297== HEAP SUMMARY:
==113297==     in use at exit: 0 bytes in 0 blocks
==113297==   total heap usage: 1,412,640 allocs, 1,412,640 frees, 117,920,009,195 bytes allocated
==113297==
==113297== All heap blocks were freed -- no leaks are possible
==113297==
==113297== For lists of detected and suppressed errors, rerun with: -s
==113297== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
132.44user 21.15system 2:35.61elapsed 98%CPU (0avgtext+0avgdata 228560maxresident)k
0inputs+25296outputs (0major+6886930minor)pagefaults 0swaps
```

After:
```
$ sudo time valgrind --leak-check=full ./systemd-hwdb update
==112572== Memcheck, a memory error detector
==112572== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==112572== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==112572== Command: ./systemd-hwdb update
==112572==
==112572==
==112572== HEAP SUMMARY:
==112572==     in use at exit: 0 bytes in 0 blocks
==112572==   total heap usage: 1,320,113 allocs, 1,320,113 frees, 70,614,501 bytes allocated
==112572==
==112572== All heap blocks were freed -- no leaks are possible
==112572==
==112572== For lists of detected and suppressed errors, rerun with: -s
==112572== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
21.94user 0.19system 0:22.23elapsed 99%CPU (0avgtext+0avgdata 229876maxresident)k
0inputs+25264outputs (0major+57275minor)pagefaults 0swaps
```

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
(cherry picked from commit 621b10fe2c3203c537996e84c7c89b0ff994ad93)

17 months agorules: Limit the number of device units generated for serial ttys
Daan De Meyer [Mon, 10 Jun 2024 10:59:58 +0000 (12:59 +0200)]
rules: Limit the number of device units generated for serial ttys

As per the suggestion in https://github.com/systemd/systemd/issues/33242.

This reduces the number of /dev/ttySXX device units generated in
mkosi from 32 to 4.

(cherry picked from commit dc38f9addd04c34d1fd743efc407bdebb3573d05)

17 months agosd-dhcp-server: clear buffer before receive
Yu Watanabe [Tue, 11 Jun 2024 15:48:56 +0000 (00:48 +0900)]
sd-dhcp-server: clear buffer before receive

I do not think this is necessary, but all other places in
libsystemd-network we clear buffer before receive. Without this,
Coverity warns about use-of-uninitialized-values.
Let's silence Coverity.

Closes CID#1469721.

(cherry picked from commit 40f9fa0af4c3094d93e833e62f7e301cd453da62)

17 months agohostnamed: don't allow hostnamed to exit on idle if varlink connections are still...
Lennart Poettering [Wed, 8 May 2024 08:38:11 +0000 (10:38 +0200)]
hostnamed: don't allow hostnamed to exit on idle if varlink connections are still ongoing

And while we are at it, ongoing PK authorizations are also a reason to
block exit on idle.

(cherry picked from commit ac908152b3b43a49f793d225c075423422cd3e33)

17 months agoman/systemd: reorder content a bit
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2024 09:28:21 +0000 (11:28 +0200)]
man/systemd: reorder content a bit

Section "Description" didn't actually say what systemd does. And we had a giant
"Concepts" section that actually described units types and other details about
them. So let's move the basic description of functionality to "Description" and
rename the following section to "Units".

The link to the Original Design Document is moved to "See Also", it is of
historical interest mostly at this point.

The only actual change is that when talking about API filesystems, /dev is also
mentioned. (I think /sys+/proc+/dev are the canonical set and should be always
listed on one breath.)

(cherry picked from commit f11aaf7dfb295de429b1567282b19caaba036bba)

17 months agoCreate CNAME
Luca Boccassi [Tue, 11 Jun 2024 22:04:12 +0000 (23:04 +0100)]
Create CNAME