]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agomkosi: Stop passing package environment variables to tools image 36931/head
Daan De Meyer [Tue, 1 Apr 2025 12:57:22 +0000 (14:57 +0200)] 
mkosi: Stop passing package environment variables to tools image

The tools image is not guaranteed to be the same distribution as the
target distribution and so might have different package environment
variables than the main image yet we currently unconditionally use the
same package environment variables for both of them.

Let's fix this by not passing the package environment variables to the
tools image and subimages anymore, and instead having the main, tools and
build images separately include a config file with the required environment
variables.

7 months agomkosi: Use mkosi.tools.conf for tools tree configuration
Daan De Meyer [Tue, 1 Apr 2025 11:25:47 +0000 (13:25 +0200)] 
mkosi: Use mkosi.tools.conf for tools tree configuration

This allows us to use the regular settings instead of having to bother
with ToolsTreeXXX variants. It'll also allow us to share configuration
between the regular images and the tools tree image, which we'll make
use of in the next commit.

7 months agomkosi: Drop number prefixes from configuration files
Daan De Meyer [Tue, 1 Apr 2025 11:23:02 +0000 (13:23 +0200)] 
mkosi: Drop number prefixes from configuration files

We already removed these in some places, let's migrate the others as
well. There's no ordering required at all between these configuration
files so let's not bother with any numbered prefixes.

7 months agomkosi: Drop orphan_file workaround
Daan De Meyer [Tue, 1 Apr 2025 11:22:29 +0000 (13:22 +0200)] 
mkosi: Drop orphan_file workaround

mkosi now handles this workaround itself internally.

7 months agomkosi: Update to latest
Daan De Meyer [Tue, 1 Apr 2025 11:22:09 +0000 (13:22 +0200)] 
mkosi: Update to latest

7 months agonotify-recv: several follow-ups for notify_socket_prepare()
Yu Watanabe [Tue, 1 Apr 2025 10:15:59 +0000 (19:15 +0900)] 
notify-recv: several follow-ups for notify_socket_prepare()

Follow-ups for 2351bc991e3a4f1fbdaa2d53900980b6703babbd.
Addresses post-merge review:
https://github.com/systemd/systemd/pull/36911#pullrequestreview-2732136658

7 months agotest: fix usage of --hostnqn= (#36927)
Luca Boccassi [Tue, 1 Apr 2025 13:04:23 +0000 (14:04 +0100)] 
test: fix usage of --hostnqn= (#36927)

Fixes #36908.

7 months agotest and manpages follow-ups (#36924)
Luca Boccassi [Tue, 1 Apr 2025 12:52:14 +0000 (13:52 +0100)] 
test and manpages follow-ups (#36924)

7 months agotest: replace deprecated --hostid= with --hostnqn= 36927/head
Yu Watanabe [Tue, 1 Apr 2025 10:00:50 +0000 (19:00 +0900)] 
test: replace deprecated --hostid= with --hostnqn=

Fixes #36908.

7 months agoman: add missing conditional 36924/head
Luca Boccassi [Tue, 1 Apr 2025 09:40:45 +0000 (10:40 +0100)] 
man: add missing conditional

Follow-up for d95818f5221d9b9b19648cffa0cb2407f023b27e

man: run 'update-man-rules' again

7 months agotest: use 'exit 0' instead of 'return' in test scripts
Luca Boccassi [Tue, 1 Apr 2025 08:55:52 +0000 (09:55 +0100)] 
test: use 'exit 0' instead of 'return' in test scripts

14385s [   66.896852] TEST-87-AUX-UTILS-VM.sh[3744]: + test -x /usr/lib/systemd/systemd-validatefs
14385s [   66.898544] TEST-87-AUX-UTILS-VM.sh[3744]: + echo 'no systemd-validatefs'
14385s [   66.899115] TEST-87-AUX-UTILS-VM.sh[3744]: no systemd-validatefs
14385s [   66.899699] TEST-87-AUX-UTILS-VM.sh[3744]: + return
14385s [   66.900189] TEST-87-AUX-UTILS-VM.sh[3744]: .//usr/lib/systemd/tests/testdata/units/TEST-87-AUX-UTILS-VM.validatefs.sh: line 13: return: can only `return' from a function or sourced script

Follow-up for 6e003d18bbf5e9f55c08b25d80b138b3a98d5f26

7 months agoRevert "test: call nvme-cli with --hostnqn= instead of the deprecated --hostid="
Yu Watanabe [Tue, 1 Apr 2025 09:58:43 +0000 (18:58 +0900)] 
Revert "test: call nvme-cli with --hostnqn= instead of the deprecated --hostid="

This reverts commit b8942f4ae2d121603544b8527a7faf7fc458562c.

As commented https://github.com/systemd/systemd/issues/36908#issuecomment-2768507373,
the usage of --hostnqn= is different from --hostid=.

7 months agoudev-spawn: manage spawned processes by PidRef
Yu Watanabe [Tue, 1 Apr 2025 06:54:24 +0000 (15:54 +0900)] 
udev-spawn: manage spawned processes by PidRef

7 months agoudev: trivial cleanups (#36916)
Yu Watanabe [Tue, 1 Apr 2025 09:24:34 +0000 (18:24 +0900)] 
udev: trivial cleanups (#36916)

7 months agointroduce notify_socket_prepare() and use it where applicable (#36911)
Yu Watanabe [Tue, 1 Apr 2025 09:20:47 +0000 (18:20 +0900)] 
introduce notify_socket_prepare() and use it where applicable (#36911)

This introduces notify_socket_prepare(), which creates an autobind
notify socket and IO event source for the socket. Then, use it where we
send notification messages from worker processes to their manager
process.

7 months agoman: run 'update-man-rules' again
Lennart Poettering [Tue, 1 Apr 2025 07:26:10 +0000 (09:26 +0200)] 
man: run 'update-man-rules' again

7 months agoudev: update log messages 36916/head
Yu Watanabe [Tue, 1 Apr 2025 06:39:37 +0000 (15:39 +0900)] 
udev: update log messages

7 months agoudev: disable timer event source for cleaning up idle workers when no worker exists
Yu Watanabe [Tue, 1 Apr 2025 06:36:45 +0000 (15:36 +0900)] 
udev: disable timer event source for cleaning up idle workers when no worker exists

No functional change, as the timer event does nothing when there are no
workers.

8 months agotest: call nvme-cli with --hostnqn= instead of the deprecated --hostid=
Luca Boccassi [Mon, 31 Mar 2025 22:05:04 +0000 (23:05 +0100)] 
test: call nvme-cli with --hostnqn= instead of the deprecated --hostid=

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

8 months agovalidatefs: several follow-ups (#36910)
Yu Watanabe [Mon, 31 Mar 2025 20:35:21 +0000 (05:35 +0900)] 
validatefs: several follow-ups (#36910)

8 months agoudev: trivial cleanups (#36912)
Yu Watanabe [Mon, 31 Mar 2025 20:34:32 +0000 (05:34 +0900)] 
udev: trivial cleanups (#36912)

8 months agosysupdated: use notify_socket_prepare() 36911/head
Yu Watanabe [Mon, 31 Mar 2025 17:16:42 +0000 (02:16 +0900)] 
sysupdated: use notify_socket_prepare()

This also make it use autobind notify socket.

8 months agosysupdate-transfer: use notify_socket_prepare()
Yu Watanabe [Mon, 31 Mar 2025 17:11:06 +0000 (02:11 +0900)] 
sysupdate-transfer: use notify_socket_prepare()

8 months agosysupdate-transfer: fix potential memleak
Yu Watanabe [Mon, 31 Mar 2025 17:07:54 +0000 (02:07 +0900)] 
sysupdate-transfer: fix potential memleak

8 months agonotify: use notify_socket_prepare()
Yu Watanabe [Mon, 31 Mar 2025 16:56:17 +0000 (01:56 +0900)] 
notify: use notify_socket_prepare()

8 months agoimport: use notify_socket_prepare()
Yu Watanabe [Mon, 31 Mar 2025 16:41:19 +0000 (01:41 +0900)] 
import: use notify_socket_prepare()

This also make it use autobind notify socket.

8 months agohomed: use notify_socket_prepare()
Yu Watanabe [Mon, 31 Mar 2025 16:32:03 +0000 (01:32 +0900)] 
homed: use notify_socket_prepare()

This also make it use autobind notify socket.

8 months agoudev-manager: coding style cleanups 36912/head
Yu Watanabe [Wed, 19 Mar 2025 03:38:57 +0000 (12:38 +0900)] 
udev-manager: coding style cleanups

8 months agoudev-manager: use notify_start() and notify_on_cleanup()
Yu Watanabe [Mon, 24 Mar 2025 11:01:48 +0000 (20:01 +0900)] 
udev-manager: use notify_start() and notify_on_cleanup()

No functional change. Just refactoring.

8 months agonotify-recv: introduce notify_socket_prepare()
Yu Watanabe [Thu, 27 Mar 2025 02:10:15 +0000 (11:10 +0900)] 
notify-recv: introduce notify_socket_prepare()

8 months agoac-power: follow-up for recent change
Yu Watanabe [Mon, 31 Mar 2025 10:52:39 +0000 (19:52 +0900)] 
ac-power: follow-up for recent change

Follow-ups for 72586a971b5ee26b6681fc34ba43c0081dbd94da.

- drop 'Options' sections,
- drop underlining for link,
- fix indentation.

Prompted by https://github.com/systemd/systemd/pull/36850#discussion_r2020594171
> the underline stuff we only use for long --help texts that have sections,
> for the section headers. systemctl --help does that for example. This one
> here is not that long, hence doesn't really need section headers, and
> hence no underlining. The clickable links don't need to be explicitly
> underlined, the terminal emulators that supper hyperlinks will underline
> them on their own (for example gnome-terminal uses a dotted line).

Addresses https://github.com/systemd/systemd/pull/36873#discussion_r2017578611

8 months agosocket-util: introduce socket_autobind() helper (#36893)
Yu Watanabe [Mon, 31 Mar 2025 17:55:04 +0000 (02:55 +0900)] 
socket-util: introduce socket_autobind() helper (#36893)

Prompted by https://github.com/systemd/systemd/pull/36858#discussion_r2017719305
and #36833.

8 months agounits/systemd-validatefs@.service: FailureAction= is a [Unit] knob 36910/head
Mike Yuan [Mon, 31 Mar 2025 16:39:42 +0000 (18:39 +0200)] 
units/systemd-validatefs@.service: FailureAction= is a [Unit] knob

8 months agoman/systemd-validatefs@.service: fix typo
Mike Yuan [Mon, 31 Mar 2025 17:04:49 +0000 (19:04 +0200)] 
man/systemd-validatefs@.service: fix typo

8 months agovalidatefs: use fgetxattr_malloc() where appropriate
Mike Yuan [Mon, 31 Mar 2025 17:20:54 +0000 (19:20 +0200)] 
validatefs: use fgetxattr_malloc() where appropriate

8 months agovalidatefs: do not use EXIT_* in run()
Mike Yuan [Mon, 31 Mar 2025 16:43:34 +0000 (18:43 +0200)] 
validatefs: do not use EXIT_* in run()

The plain DEFINE_MAIN_FUNCTION is used, i.e. all >= 0 retvals
are treated as success. No need for EXIT_* annotations.

8 months agovalidatefs: insert empty line after short description in help() text
Mike Yuan [Mon, 31 Mar 2025 16:33:56 +0000 (18:33 +0200)] 
validatefs: insert empty line after short description in help() text

As per our usual coding style.

8 months agoxattr-util: add missing assertions
Mike Yuan [Mon, 31 Mar 2025 16:20:22 +0000 (18:20 +0200)] 
xattr-util: add missing assertions

Follow-up for ed024abac6e4acad5a77943721e7622bb1b10b71
and 9fbe26cfa8fadb58e048aa6a57ad0dacf5de03fc

Also, let's not get too tangled up in the style of defining variables
in between. The functions are short enough, and vars involved are still
effectively at the beginning... Put differently, the separation from
'int r' is too deliberate and brings no actual value in my eyes.

8 months agotest: pass verbose option to nvme-cli
Luca Boccassi [Mon, 31 Mar 2025 14:44:11 +0000 (15:44 +0100)] 
test: pass verbose option to nvme-cli

When the test fails due to nvme-cli/kernel issues it's hard to report it
upstream as there's not enough details, add verbose flags

8 months agointroduce systemd-validatefs@.service that ensures file systems can only be used...
Yu Watanabe [Mon, 31 Mar 2025 16:14:33 +0000 (01:14 +0900)] 
introduce systemd-validatefs@.service that ensures file systems can only be used in the way they were intended (#36714)

If we have multiple trusted fs (i.e. luks or dm-verity) we generate via
repart at boot, we must make sure they cannot be "misappropriated", i.e.
used for a different mount they were intended for.

Hence, let's introduce "mount constraint" data (encoded in xattrs on the
root inode of the fs) that tells us where a file system has to be
mounted, and what the gpt partition metadata has to be for the fs to be
valid.

Inspired by this thread:
https://lists.freedesktop.org/archives/systemd-devel/2025-March/051244.html

8 months agosocket-util: introduce socket_autobind() helper 36893/head
Mike Yuan [Sat, 29 Mar 2025 20:33:58 +0000 (21:33 +0100)] 
socket-util: introduce socket_autobind() helper

Prompted by https://github.com/systemd/systemd/pull/36858#discussion_r2017719305
and #36833

8 months agoSeveral updates for socket option (#36905)
Yu Watanabe [Mon, 31 Mar 2025 16:09:04 +0000 (01:09 +0900)] 
Several updates for socket option (#36905)

8 months agosocket-util: drop SO_BINDTODEVICE fallback in socket_bind_to_ifindex()
Mike Yuan [Sat, 29 Mar 2025 20:29:26 +0000 (21:29 +0100)] 
socket-util: drop SO_BINDTODEVICE fallback in socket_bind_to_ifindex()

Our baseline is v5.4 now.

8 months agotree-wide: extend the comment about the issue in __convert_scm_timestamps() 36905/head
Yu Watanabe [Mon, 31 Mar 2025 14:19:52 +0000 (23:19 +0900)] 
tree-wide: extend the comment about the issue in __convert_scm_timestamps()

8 months agocore/manager: update comment
Yu Watanabe [Mon, 31 Mar 2025 14:02:49 +0000 (23:02 +0900)] 
core/manager: update comment

8 months agoREADME: fix version of SO_BINDTOIFINDEX
Yu Watanabe [Mon, 31 Mar 2025 13:52:40 +0000 (22:52 +0900)] 
README: fix version of SO_BINDTOIFINDEX

Follow-up for 33746caf8fe51fe4e89fd7f2f459f06c34fbd175.

8 months agomissing_socket: drop unnecessary definitions and update comments
Yu Watanabe [Mon, 31 Mar 2025 13:49:37 +0000 (22:49 +0900)] 
missing_socket: drop unnecessary definitions and update comments

- SO_PEERGROUPS is since kernel v4.13
  (28b5ba2aa0f55d80adb2624564ed2b170c19519e),
- SO_BINDTOIFINDEX is since kernel v5.1
  (f5dd3d0c9638a9d9a02b5964c4ad636f06cf7e2c).

8 months agoupdate TODO 36714/head
Lennart Poettering [Wed, 12 Mar 2025 12:34:35 +0000 (13:34 +0100)] 
update TODO

8 months agoci: add test for new validatefs work
Lennart Poettering [Thu, 13 Mar 2025 15:58:59 +0000 (16:58 +0100)] 
ci: add test for new validatefs work

8 months agoci: add -no-xattrs to unsquashfs cmdline
Lennart Poettering [Wed, 19 Mar 2025 08:19:24 +0000 (09:19 +0100)] 
ci: add -no-xattrs to unsquashfs cmdline

If the target dir is tmpfs and we run on old kernels we cannot extract
xattrs and the extracting will fail if there are any. hence add
-no-xattrs to the two remaining unsquashfs invocations that don't have
it.

(Also all other invocations across our test tree spell "-dest" instead
of "-d", hence do so here too.)

8 months agorepart: automatically generate validatefs xattrs
Lennart Poettering [Wed, 12 Mar 2025 08:50:20 +0000 (09:50 +0100)] 
repart: automatically generate validatefs xattrs

Let's automatically generate validatefs xattrs by default, that encode
the intended use of partitions.

This defaults to on, since the structure of repart definition files
tells us enough on use for this to be safe. There's an option however,
to turn this off.

8 months agogenerators: hook in validatefs on gpt-auto and fstab generator mounts
Lennart Poettering [Wed, 12 Mar 2025 08:49:52 +0000 (09:49 +0100)] 
generators: hook in validatefs on gpt-auto and fstab generator mounts

Let's turn on validatefs automatically for all auto-discovered
partitions.

Let's add an x-systemd.validatefs option to optionally turn this on for
fstab listed file systems.

8 months agovalidatefs: add new tool that enforces mount constraints
Lennart Poettering [Wed, 12 Mar 2025 07:37:05 +0000 (08:37 +0100)] 
validatefs: add new tool that enforces mount constraints

This new tool looks for a three xattr on the root inode of a file system
that encode mount constraints of the file system. The tool is supposed
to be hooke into the mount logic and is supposed to protect against
misappropriating trusted file systems in unintended ways.

Consider the following scenario: we boot up on first boot and create a
tpm-locked pair of /var/ and /srv/ partitions via systemd-repart. An
attacker then offline modifies the partition table, exchanging the
metadata of the /var/ and /srv/ partition. So far we'd happily accept
that, honour the modified metadata and boot up. This could be used to
revert changes to /var/ or similar. And all that even though both
partitions are encrypted and locked to TPM!

With this new mechanism we can encode in the protected contents of the
file systems the ways it can be used: the partition type uuid, the
partition label and the intended mount point can be stored in xattrs,
and we can check them automatically on mount, and take action on
mismatch. (action would typically be immediate reboot).

8 months agoxattr-util: add trivial xsetxattr_strv() wrapper
Lennart Poettering [Mon, 31 Mar 2025 12:55:36 +0000 (14:55 +0200)] 
xattr-util: add trivial xsetxattr_strv() wrapper

8 months agoxattr-util: add trivial getxattr_at_strv() helper
Lennart Poettering [Mon, 31 Mar 2025 12:47:22 +0000 (14:47 +0200)] 
xattr-util: add trivial getxattr_at_strv() helper

8 months agoREADME: note min kernerl version for SO_BINDTOIFINDEX
Luca Boccassi [Mon, 31 Mar 2025 13:06:54 +0000 (14:06 +0100)] 
README: note min kernerl version for SO_BINDTOIFINDEX

Prompted by https://github.com/systemd/systemd/pull/36893

8 months agowatchdog: fix typo
Yu Watanabe [Mon, 31 Mar 2025 12:26:57 +0000 (21:26 +0900)] 
watchdog: fix typo

Follow-up for ab596e4cde5d4b55be5182a8d5554e3e97366131.

8 months agoLog message improvements (#35237)
Yu Watanabe [Mon, 31 Mar 2025 12:23:23 +0000 (21:23 +0900)] 
Log message improvements (#35237)

Various improvements to log messages. Inspired by
https://bugzilla.redhat.com/show_bug.cgi?id=2327296.

8 months agohomed: move things over to quotactl_fd() (#36902)
Yu Watanabe [Mon, 31 Mar 2025 12:15:03 +0000 (21:15 +0900)] 
homed: move things over to quotactl_fd() (#36902)

Let's use quotactl_fd() wherever we can, it's 2025. quotactl() is such a
mess after all.

8 months agopcrextend: whenever we fail to extend PCRs, reboot immediately
Lennart Poettering [Tue, 11 Mar 2025 16:28:47 +0000 (17:28 +0100)] 
pcrextend: whenever we fail to extend PCRs, reboot immediately

PCR extensions are supposed to be useful for "destroying" the ability to
access TPM bound secrets. Hence, if for some reason we fail to extend a
PCR, it's safer to just reboot, instead of going on without the
extension, leaving secrets potentially accessible which should not be
accessible.

Note that the services exit gracefully if no TPM is found, hence this
should not be triggered on TPM-less systems. However, this enforces that
if there is a TPM that is accessible to Linux and that works properly,
the PCR measurement must complete too.

Inspired by this thread:

https://lists.freedesktop.org/archives/systemd-devel/2025-March/051244.html

8 months agosocket-proxy: add syntax highlighting to help output
Busayo Dada [Mon, 24 Mar 2025 21:19:41 +0000 (22:19 +0100)] 
socket-proxy: add syntax highlighting to help output

8 months agohomed: don't log error we don't have 36902/head
Lennart Poettering [Mon, 31 Mar 2025 09:51:38 +0000 (11:51 +0200)] 
homed: don't log error we don't have

8 months agohomed: always use quotactl_fd() if its available
Lennart Poettering [Mon, 31 Mar 2025 09:47:17 +0000 (11:47 +0200)] 
homed: always use quotactl_fd() if its available

Let's always prefer quotactl_fd() when it's available and use quotactl()
only as as a fallback on old kernels.

This way we can operate on the fds we typically already have open, or if
needed we can open a new one, and use for multiple fs operation.

In the long run we should really focus on operating exclusively by fd
instead of by path, by device nor or otherwise. This gets us a step
closer to that.

8 months agotest: skip networkd tests if networkd/resolved are disabled at build time
Luca Boccassi [Sat, 29 Mar 2025 17:56:04 +0000 (17:56 +0000)] 
test: skip networkd tests if networkd/resolved are disabled at build time

8 months agotest: skip TEST-75-RESOLVED if resolved is disabled at build time
Luca Boccassi [Sat, 29 Mar 2025 17:55:45 +0000 (17:55 +0000)] 
test: skip TEST-75-RESOLVED if resolved is disabled at build time

8 months agosd-bus/bus-common-errors: add missing error map entries
Mike Yuan [Fri, 21 Mar 2025 00:59:03 +0000 (01:59 +0100)] 
sd-bus/bus-common-errors: add missing error map entries

8 months agomeson: add feature flag for nspawn build (#36876)
Luca Boccassi [Fri, 28 Mar 2025 13:55:19 +0000 (13:55 +0000)] 
meson: add feature flag for nspawn build (#36876)

Other tools have it, nspawn doesn't, add one

8 months agomkosi: Use build image prepare scripts for tools tree as well (#36861)
Luca Boccassi [Fri, 28 Mar 2025 13:31:28 +0000 (13:31 +0000)] 
mkosi: Use build image prepare scripts for tools tree as well (#36861)

Instead of listing dependencies manually for the default tools tree,
let's reuse the prepare scripts from the build image. To make this work,
the sync script has to be configured for the tools tree as well so that
it's invoked both when building the tools tree and for the regular
image,
otherwise, when doing the first build in a fresh checkout, the sync
script
won't have executed yet as sync scripts for the regular images are
executed
after building the default tools tree.

8 months agotest: Drop --no-rebuild from meson test invocations
Daan De Meyer [Fri, 28 Mar 2025 11:35:54 +0000 (12:35 +0100)] 
test: Drop --no-rebuild from meson test invocations

With meson 1.7.0, meson won't rebuild the world anymore when running
meson test so since meson 1.7.0 is in tumbleweed, debian testing, fedora
rawhide and Arch Linux, drop --no-rebuild from the docs since all the default
tools trees built by mkosi in the systemd repo will have meson 1.7.0 or newer
installed.

We keep --no-rebuild in CI because in CI we run with the same tools tree
distribution as the target distribution we're building and in those it's not
guaranteed for meson 1.7.0 to be available yet.

The advantage of dropping --no-rebuild is that meson will now reconfigure itself
if needed, which is required if we change or move around meson files, as otherwise
meson tends to explode spectacularly in hard to debug ways.

https://mesonbuild.com/Release-notes-for-1-7-0.html#test-targets-no-longer-built-by-default

8 months agomkosi: Use build image prepare scripts for tools tree as well 36861/head
Daan De Meyer [Tue, 25 Mar 2025 20:02:24 +0000 (21:02 +0100)] 
mkosi: Use build image prepare scripts for tools tree as well

Instead of listing dependencies manually for the default tools tree,
let's reuse the prepare scripts from the build image. To make this work,
the sync script has to be configured for the tools tree as well so that
it's invoked both when building the tools tree and for the regular image,
otherwise, when doing the first build in a fresh checkout, the sync script
won't have executed yet as sync scripts for the regular images are executed
after building the default tools tree.

8 months agotest: Use /dev/shm for TEST_JOURNAL_USE_TMP if /tmp isn't tmpfs
Daan De Meyer [Thu, 27 Mar 2025 15:10:03 +0000 (16:10 +0100)] 
test: Use /dev/shm for TEST_JOURNAL_USE_TMP if /tmp isn't tmpfs

If /dev/shm is a tmpfs and /tmp isn't, use /dev/shm instead.

8 months agotest: Mark tests as skipped if requirements were not satisfied
Daan De Meyer [Thu, 27 Mar 2025 14:53:28 +0000 (15:53 +0100)] 
test: Mark tests as skipped if requirements were not satisfied

Instead of not creating the test at all, let's always create test but
simply mark them as skipped as this is more observable than simply not
creating the test at all.

8 months agoTEST-06-SELINUX: Only enable if meson was invoked as root
Daan De Meyer [Thu, 27 Mar 2025 14:49:06 +0000 (15:49 +0100)] 
TEST-06-SELINUX: Only enable if meson was invoked as root

This test only works if the image was built as root. Since that's
impossible to check as meson generally runs before we build the image,
let's use whether meson is run as root as a proxy.

8 months agotest: Boot integration test VMs without an initrd if possible
Daan De Meyer [Thu, 27 Mar 2025 13:24:28 +0000 (14:24 +0100)] 
test: Boot integration test VMs without an initrd if possible

If we don't need an initrd, let's not waste time in one. We have to
gate this by distributions that have the necessary kernel modules to
make this work as builtin modules, hopefully we can expand the list in
the future.

8 months agomkosi: Bump minimum version to 25~devel
Daan De Meyer [Fri, 28 Mar 2025 10:40:20 +0000 (11:40 +0100)] 
mkosi: Bump minimum version to 25~devel

8 months agotest: always install test-resolve subdir 36876/head
Luca Boccassi [Fri, 28 Mar 2025 03:12:12 +0000 (03:12 +0000)] 
test: always install test-resolve subdir

Content is also used by unit tests, not just resolved tests,
so they are needed even when resolved is disabled, as unit
tests are still built and run

8 months agomeson: add feature flag for nspawn build
Luca Boccassi [Thu, 27 Mar 2025 23:51:17 +0000 (23:51 +0000)] 
meson: add feature flag for nspawn build

Other tools have it, nspawn doesn't, add one

8 months agomkosi: Mark /etc /var as updated in a finalize script
Daan De Meyer [Thu, 27 Mar 2025 13:31:55 +0000 (14:31 +0100)] 
mkosi: Mark /etc /var as updated in a finalize script

Let's make sure we don't run ldconfig.service and other services
again on first boot.

8 months agomkosi: Disable various extra things in the default preset
Daan De Meyer [Thu, 27 Mar 2025 12:18:45 +0000 (13:18 +0100)] 
mkosi: Disable various extra things in the default preset

8 months agomkosi: Remove debian/ubuntu pinning
Daan De Meyer [Tue, 25 Mar 2025 19:41:24 +0000 (20:41 +0100)] 
mkosi: Remove debian/ubuntu pinning

mkosi does this natively now.

8 months agomkosi: Update to latest
Daan De Meyer [Tue, 25 Mar 2025 20:28:06 +0000 (21:28 +0100)] 
mkosi: Update to latest

8 months agotest/README.md: mention `mkosi genkey`
Allison Karlitskaya [Fri, 28 Mar 2025 07:53:46 +0000 (08:53 +0100)] 
test/README.md: mention `mkosi genkey`

This is a required first step before testing and it's not specifically
mentioned in the doc.  This tripped me up for a while, so let's save the
trouble for the next person.

8 months agomkosi: update fedora commit reference (#36875)
Luca Boccassi [Fri, 28 Mar 2025 02:06:06 +0000 (02:06 +0000)] 
mkosi: update fedora commit reference (#36875)

617952132d Run integration testsuite standalone if available

8 months agomkosi: update fedora commit reference 36875/head
Daan De Meyer [Thu, 27 Mar 2025 20:49:47 +0000 (21:49 +0100)] 
mkosi: update fedora commit reference

617952132d Run integration testsuite standalone if available

8 months agotest: Fix symlink location of standalone tests
Daan De Meyer [Thu, 27 Mar 2025 21:48:42 +0000 (22:48 +0100)] 
test: Fix symlink location of standalone tests

This was accidentally moved to the wrong folder so fix up the location
so it's located in the standalone/ folder as expected.

8 months agotest: Make it possible to run the integration tests standalone (#36868)
Daan De Meyer [Thu, 27 Mar 2025 20:38:00 +0000 (21:38 +0100)] 
test: Make it possible to run the integration tests standalone (#36868)

Currently, to run the integration tests, it's still necessary to
install various other build tools besides meson: A compiler, gperf,
libcap, ... which we want to avoid in CI systems where we receive
prebuilt systemd packages and only want to test them. Examples are
Debian's autopkgtest CI and Fedora CI. Let's make it possible for
these systems to run the integration tests without having to install
any other build dependency besides meson by extracting the logic
required to run the integration tests with meson into a separate
subdirectory and adding a standalone top-level meson.build file which
can be used to configure a meson tree with as its only purpose running
the integration tests.

Practically, we do the following:
- all the integration test directories and integration-test-wrapper.py
  are moved from test/ to test/integration-tests/.
- All the installation logic is kept out of test/integration-tests/ or
  any of its subdirectories and moved into test/meson.build instead.
- We add test/integration-tests/standalone/meson.build to run the
  integration tests standalone. This meson file includes
  test/integration-tests via a cute symlink hack to trick meson into
  including a parent directory with subdir().
- Documentation is included on how to use the new standalone mode.

8 months agotest: Make it possible to run the integration tests standalone 36868/head
Daan De Meyer [Wed, 26 Mar 2025 13:30:20 +0000 (14:30 +0100)] 
test: Make it possible to run the integration tests standalone

Currently, to run the integration tests, it's still necessary to
install various other build tools besides meson: A compiler, gperf,
libcap, ... which we want to avoid in CI systems where we receive
prebuilt systemd packages and only want to test them. Examples are
Debian's autopkgtest CI and Fedora CI. Let's make it possible for
these systems to run the integration tests without having to install
any other build dependency besides meson by extracting the logic
required to run the integration tests with meson into a separate
subdirectory and adding a standalone top-level meson.build file which
can be used to configure a meson tree with as its only purpose running
the integration tests.

Practically, we do the following:
- all the integration test directories and integration-test-wrapper.py
  are moved from test/ to test/integration-test/.
- All the installation logic is kept out of test/integration-test/ or
  any of its subdirectories and moved into test/meson.build instead.
- We add test/integration-test/standalone/meson.build to run the
  integration tests standalone. This meson file includes
  test/integration-test via a cute symlink hack to trick meson into
  including a parent directory with subdir().
- Documentation is included on how to use the new standalone mode.
- TEST-64-UDEV-STORAGE and TEST-85-NETWORK are changed to generate separate
  units for each testcase to make them behave more like the other integration
  tests.

8 months agogpt-auto-generator: improve log message 35237/head
Zbigniew Jędrzejewski-Szmek [Tue, 19 Nov 2024 16:06:48 +0000 (17:06 +0100)] 
gpt-auto-generator: improve log message

We said "exiting", but then the program continues to do other operations
and log additional messages.

8 months agoshared/exec-util: fix logging of the args of an executed program
Zbigniew Jędrzejewski-Szmek [Tue, 19 Nov 2024 15:56:17 +0000 (16:56 +0100)] 
shared/exec-util: fix logging of the args of an executed program

The debug logs has lots of "About to execute /some/path (null)". This
occurs when the args array is empty. Instead, only print "(null)" if
we failed with oom.

Having strv_skip() return NULL makes this pleasant to write without repeating
strv_isempty() a few times.

8 months agotest-execve: minor simplification
Zbigniew Jędrzejewski-Szmek [Tue, 19 Nov 2024 15:51:39 +0000 (16:51 +0100)] 
test-execve: minor simplification

8 months agovarious: handle the positive condition after strv_skip() first
Zbigniew Jędrzejewski-Szmek [Tue, 19 Nov 2024 15:51:27 +0000 (16:51 +0100)] 
various: handle the positive condition after strv_skip() first

8 months agobusctl: use RET_GATHER
Zbigniew Jędrzejewski-Szmek [Tue, 19 Nov 2024 15:27:50 +0000 (16:27 +0100)] 
busctl: use RET_GATHER

8 months agobusctl: use STRV_FOREACH in the usual fashion
Zbigniew Jędrzejewski-Szmek [Tue, 19 Nov 2024 15:26:03 +0000 (16:26 +0100)] 
busctl: use STRV_FOREACH in the usual fashion

Also put positive branch first, do not use 'i' as a char** variable name.

8 months agoanalyze: use STRV_FOREACH in consistent fashion
Zbigniew Jędrzejewski-Szmek [Tue, 19 Nov 2024 14:48:31 +0000 (15:48 +0100)] 
analyze: use STRV_FOREACH in consistent fashion

Also put positive condition first.

8 months agobasic/strv: return NULL from strv_skip
Zbigniew Jędrzejewski-Szmek [Tue, 19 Nov 2024 14:41:22 +0000 (15:41 +0100)] 
basic/strv: return NULL from strv_skip

strv_skip was written to carefully return the original array, but this turns
out to be an unnecessary complication. After the previous patch, no caller
cares about the distinction between NULL and { NULL }, but various callers need
to wrap the process the returned value with strv_isempty(), sometimes more than
once. Let's always return NULL for an empty result to allow callers to be
simplified.

8 months agoac-power: update the help output to use the ansi-color functions
ZIHCO [Wed, 26 Mar 2025 19:50:15 +0000 (20:50 +0100)] 
ac-power: update the help output to use the ansi-color functions

8 months agocore: drop manager_get_unit_by_pid() and friends (#36872)
Yu Watanabe [Wed, 26 Mar 2025 21:10:53 +0000 (06:10 +0900)] 
core: drop manager_get_unit_by_pid() and friends (#36872)

Except for one place, they are only used by test-watch-pid. Let's also
use manager_get_unit_by_pidref() and friends in the test, and drop the
_pid() variants.

8 months agocore/cgroup: Properly handle aborting a pending freeze operation
msizanoen [Tue, 18 Mar 2025 05:47:21 +0000 (12:47 +0700)] 
core/cgroup: Properly handle aborting a pending freeze operation

We must thaw the cgroup even if cgroup.events/frozen=0 if a freeze
operation is in flight as it means the cgroup is already partially
frozen.

8 months agocoredump: make sure pid1/journal coredumps are not lost when Storage=journal is selec...
Yu Watanabe [Wed, 26 Mar 2025 19:27:01 +0000 (04:27 +0900)] 
coredump: make sure pid1/journal coredumps are not lost when Storage=journal is selected (#36870)

It confused the hell of me, that if pid1 crashes in an mkosi system run
from the build tree there's no coredump kept. Because mkosi configures
journal storage for coredumps, but that's not going to work for pid1 or
journald. Hence use external storage for these two even if everything
else is stored in the journal.

8 months agocore: drop unused wrappers of manager_get_unit_by_pidref() and friends 36872/head
Yu Watanabe [Wed, 26 Mar 2025 19:15:43 +0000 (04:15 +0900)] 
core: drop unused wrappers of manager_get_unit_by_pidref() and friends