Commit Graph
80423 Commits
Author SHA1 Message Date
Daan De Meyer 1852c92592 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.
2025-04-01 21:38:49 +02:00
Daan De Meyer ac6f490032 mkosi: Drop orphan_file workaround
mkosi now handles this workaround itself internally.
2025-04-01 21:38:49 +02:00
Daan De Meyer 75930315f6 mkosi: Update to latest 2025-04-01 21:38:46 +02:00
Yu Watanabe c5855d9640 notify-recv: several follow-ups for notify_socket_prepare()
Follow-ups for 2351bc991e.
Addresses post-merge review:
https://github.com/systemd/systemd/pull/36911#pullrequestreview-2732136658
2025-04-01 22:22:10 +09:00
Luca Boccassi 79bc7625f6 test: fix usage of --hostnqn= (#36927)
Fixes #36908.
2025-04-01 14:04:23 +01:00
Luca Boccassi a20c2d6589 test and manpages follow-ups (#36924) 2025-04-01 13:52:14 +01:00
Yu Watanabe c70a113a6c test: replace deprecated --hostid= with --hostnqn=
Fixes #36908.
2025-04-01 19:01:45 +09:00
Luca Boccassi b73a042ab0 man: add missing conditional
Follow-up for d95818f522

man: run 'update-man-rules' again
2025-04-01 10:59:27 +01:00
Luca Boccassi 4b85218629 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 6e003d18bb
2025-04-01 10:59:27 +01:00
Yu Watanabe 699c377d0d Revert "test: call nvme-cli with --hostnqn= instead of the deprecated --hostid="
This reverts commit b8942f4ae2.

As commented https://github.com/systemd/systemd/issues/36908#issuecomment-2768507373,
the usage of --hostnqn= is different from --hostid=.
2025-04-01 18:58:43 +09:00
Yu Watanabe cdd2dd2d58 udev-spawn: manage spawned processes by PidRef 2025-04-01 18:25:29 +09:00
Yu Watanabe b15c676b6e udev: trivial cleanups (#36916) 2025-04-01 18:24:34 +09:00
Yu Watanabe 5f8e8186e0 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.
2025-04-01 18:20:47 +09:00
Lennart Poettering 1e79a29233 man: run 'update-man-rules' again 2025-04-01 09:26:27 +02:00
Yu Watanabe 6941bf6b77 udev: update log messages 2025-04-01 15:55:52 +09:00
Yu Watanabe cff85857c7 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.
2025-04-01 15:55:52 +09:00
Luca Boccassi b8942f4ae2 test: call nvme-cli with --hostnqn= instead of the deprecated --hostid=
Fixes https://github.com/systemd/systemd/issues/36908
2025-04-01 11:36:58 +09:00
Yu Watanabe 451277707d validatefs: several follow-ups (#36910) 2025-04-01 05:35:21 +09:00
Yu Watanabe 759eab02da udev: trivial cleanups (#36912) 2025-04-01 05:34:32 +09:00
Yu Watanabe 4c42fc6aa8 sysupdated: use notify_socket_prepare()
This also make it use autobind notify socket.
2025-04-01 03:58:38 +09:00
Yu Watanabe 0ffddd23f4 sysupdate-transfer: use notify_socket_prepare() 2025-04-01 03:58:38 +09:00
Yu Watanabe 66936ba5fa sysupdate-transfer: fix potential memleak 2025-04-01 03:58:38 +09:00
Yu Watanabe 6228924d6e notify: use notify_socket_prepare() 2025-04-01 03:58:38 +09:00
Yu Watanabe adfd9fe14c import: use notify_socket_prepare()
This also make it use autobind notify socket.
2025-04-01 03:58:38 +09:00
Yu Watanabe 0f627f9b35 homed: use notify_socket_prepare()
This also make it use autobind notify socket.
2025-04-01 03:58:34 +09:00
Yu Watanabe 2f973db276 udev-manager: coding style cleanups 2025-04-01 03:34:41 +09:00
Yu Watanabe f594f32c3d udev-manager: use notify_start() and notify_on_cleanup()
No functional change. Just refactoring.
2025-04-01 03:34:41 +09:00
Yu Watanabe 2351bc991e notify-recv: introduce notify_socket_prepare() 2025-04-01 03:26:22 +09:00
Yu Watanabe a6344afbc1 ac-power: follow-up for recent change
Follow-ups for 72586a971b.

- 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
2025-04-01 02:55:28 +09:00
Yu Watanabe 9441880d83 socket-util: introduce socket_autobind() helper (#36893)
Prompted by https://github.com/systemd/systemd/pull/36858#discussion_r2017719305
and #36833.
2025-04-01 02:55:04 +09:00
Mike Yuan 0a7d86d53d units/systemd-validatefs@.service: FailureAction= is a [Unit] knob 2025-03-31 19:23:51 +02:00
Mike Yuan 28bae3dbe3 man/systemd-validatefs@.service: fix typo 2025-03-31 19:23:50 +02:00
Mike Yuan f361fad245 validatefs: use fgetxattr_malloc() where appropriate 2025-03-31 19:23:50 +02:00
Mike Yuan 8950f7651e 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.
2025-03-31 19:23:50 +02:00
Mike Yuan 7b8d6fc836 validatefs: insert empty line after short description in help() text
As per our usual coding style.
2025-03-31 19:23:50 +02:00
Mike Yuan 05587cece5 xattr-util: add missing assertions
Follow-up for ed024abac6
and 9fbe26cfa8

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.
2025-03-31 19:23:49 +02:00
Luca Boccassi ebc0514a65 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
2025-03-31 17:22:30 +01:00
Yu Watanabe 30252c0ca4 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
2025-04-01 01:14:33 +09:00
Mike Yuan 1eeb4f9f47 socket-util: introduce socket_autobind() helper
Prompted by https://github.com/systemd/systemd/pull/36858#discussion_r2017719305
and #36833
2025-03-31 18:11:37 +02:00
Yu Watanabe 7e0f0d702d Several updates for socket option (#36905) 2025-04-01 01:09:04 +09:00
Mike Yuan ddbbc98bd5 socket-util: drop SO_BINDTODEVICE fallback in socket_bind_to_ifindex()
Our baseline is v5.4 now.
2025-03-31 18:00:09 +02:00
Yu Watanabe c7464843ad tree-wide: extend the comment about the issue in __convert_scm_timestamps() 2025-03-31 23:22:38 +09:00
Yu Watanabe 566b8f4d46 core/manager: update comment 2025-03-31 23:22:38 +09:00
Yu Watanabe 385024b75d README: fix version of SO_BINDTOIFINDEX
Follow-up for 33746caf8f.
2025-03-31 23:22:38 +09:00
Yu Watanabe 4216018807 missing_socket: drop unnecessary definitions and update comments
- SO_PEERGROUPS is since kernel v4.13
  (28b5ba2aa0f55d80adb2624564ed2b170c19519e),
- SO_BINDTOIFINDEX is since kernel v5.1
  (f5dd3d0c9638a9d9a02b5964c4ad636f06cf7e2c).
2025-03-31 23:22:12 +09:00
Lennart Poettering 681e7c6759 update TODO 2025-03-31 15:14:56 +02:00
Lennart Poettering 6e003d18bb ci: add test for new validatefs work 2025-03-31 15:14:53 +02:00
Lennart Poettering 84b41ef082 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.)
2025-03-31 15:14:50 +02:00
Lennart Poettering 85afe4760b 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.
2025-03-31 15:14:45 +02:00
Lennart Poettering f872373a26 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.
2025-03-31 15:14:28 +02:00