]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agoudev: several trivial cleanups (#37059)
Luca Boccassi [Wed, 9 Apr 2025 09:32:42 +0000 (10:32 +0100)] 
udev: several trivial cleanups (#37059)

7 months agotest: drop unnecessary comparison and use correct assertion macros
Yu Watanabe [Wed, 9 Apr 2025 04:31:42 +0000 (13:31 +0900)] 
test: drop unnecessary comparison and use correct assertion macros

Follow-up for 8951706784c0534f821600fda2fb1e89f875f823.
Fixes CID#1608873 and CID#1608874.

7 months agopo: Translated using Weblate (Chinese (Traditional) (zh_TW))
hsu zangmen [Wed, 9 Apr 2025 02:53:35 +0000 (02:53 +0000)] 
po: Translated using Weblate (Chinese (Traditional) (zh_TW))

Currently translated at 100.0% (257 of 257 strings)

Co-authored-by: hsu zangmen <chzang55@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_TW/
Translation: systemd/main

7 months agoudev-manager: move functions to place related functions closer together 37059/head
Yu Watanabe [Tue, 8 Apr 2025 21:34:41 +0000 (06:34 +0900)] 
udev-manager: move functions to place related functions closer together

No functional change, just refactoring.

7 months agoudev: merge manager_init() into manager_main()
Yu Watanabe [Tue, 8 Apr 2025 20:44:36 +0000 (05:44 +0900)] 
udev: merge manager_init() into manager_main()

It is not necessary to read cgroup path and passed fds earlier,
especially when legacy --daemon option is specified.

7 months agoudev-config: restore log level set by systemd.log_level on reload
Yu Watanabe [Mon, 7 Apr 2025 21:26:12 +0000 (06:26 +0900)] 
udev-config: restore log level set by systemd.log_level on reload

If previously log level was specified in udev.conf but not now,
then let's make 'udevadm control --reload' sets the log level
specified by systemd.log_level.

7 months agoshell-completion/udevadm: support dissect_image builtin
Yu Watanabe [Tue, 8 Apr 2025 23:54:16 +0000 (08:54 +0900)] 
shell-completion/udevadm: support dissect_image builtin

Follow-up for a8b2302bc12364662ec0576f0ef28345e079679f.

7 months agotest: Improve coverage in test-memfd-util and use ASSERT_OK() macro and friends
Busayo Dada [Wed, 26 Mar 2025 14:04:05 +0000 (15:04 +0100)] 
test: Improve coverage in test-memfd-util and use ASSERT_OK() macro and friends

7 months agoudev-watch: add inotify watch by manager process (#37023)
Yu Watanabe [Tue, 8 Apr 2025 21:43:24 +0000 (06:43 +0900)] 
udev-watch: add inotify watch by manager process (#37023)

This solves potential race in simultaneous addition of inotify watches
and removal of target device(s).

7 months agoudev: adjust event source priorities 37023/head
Yu Watanabe [Thu, 27 Mar 2025 04:52:53 +0000 (13:52 +0900)] 
udev: adjust event source priorities

7 months agoudev-watch: add inotify watch by manager process
Yu Watanabe [Thu, 27 Mar 2025 03:57:30 +0000 (12:57 +0900)] 
udev-watch: add inotify watch by manager process

Previously, inotify watch on a device node was added/removed by a
worker process processing the relevant uevent. However, that could not
avoid races. For example,
1. A device node X is removed by the kernel (e.g. unplug USB memory), and
   the kernel removes the inotify watch for the device node and produces
   IN_IGNORED event and 'remove' uevent for the device.
2. Before udevd processes the 'remove' uevent of the device, a worker
   process may try to add an inotify watch on another device node Y.
   As the inotify watch on X has been already removed, the worker may
   acquire the same watch handle that was previously assigned to X.
3. Since the 'remove' uevent for X is not processed yet, the symlink
   named with the watch handle still exists and points to X. So, the
   worker process for Y cannot add the symlink...

To avoid such races, let's sequentially add/remove inotify watch by the
manager process.

Note, this potentially reduces performance on boot when there exists
huge amount of disks and/or partitions.

7 months agomkosi: Set mitigations=off
Daan De Meyer [Tue, 8 Apr 2025 16:56:39 +0000 (18:56 +0200)] 
mkosi: Set mitigations=off

Might as well disable mitigations for these VMs. Who knows, maybe it'll
speed something up.

7 months agobasic/namespace-util: obtain uid and gid before unsharing user namespace
Michal Sekletar [Fri, 7 Feb 2025 19:18:49 +0000 (20:18 +0100)] 
basic/namespace-util: obtain uid and gid before unsharing user namespace

Getting user and group after unsharing user namespace is too late
because without any mapping, i.e. just after unshare(), we are mapped to
nobody.

7 months agomkosi: Make MinimumVersion= a git commit
Daan De Meyer [Tue, 8 Apr 2025 11:02:54 +0000 (13:02 +0200)] 
mkosi: Make MinimumVersion= a git commit

With the latest mkosi it's possible for MinimumVersion= to be a git
commit so let's start making use of that. This will make mkosi fail
if it's executed within the systemd repository and the checked out
commit is too old.

Putting the mkosi commit sha in mkosi/mkosi.conf also allows retrieving
it without having the full source tree available.

We also make a bunch of improvements to the fetch-mkosi.py script.

7 months agotest: Install files required to run integration tests standalone
Daan De Meyer [Tue, 8 Apr 2025 09:00:20 +0000 (11:00 +0200)] 
test: Install files required to run integration tests standalone

Let's make it possible to run the integration tests without requiring
the sources by installing the mkosi and integration-tests directories.

7 months agoTEST-04-JOURNAL: include util.sh before calling cgroupfs_supports_user_xattrs() ...
Luca Boccassi [Tue, 8 Apr 2025 08:52:13 +0000 (09:52 +0100)] 
TEST-04-JOURNAL: include util.sh before calling cgroupfs_supports_user_xattrs() (#37039)

Fixes a bug introduced by 46322f27427ab10ef4fca4d189f8eed27d1b5eaf
(v256).
Fixes #36991.

7 months agoTEST-17-UDEV: several follow-ups (#37042)
Yu Watanabe [Tue, 8 Apr 2025 07:43:03 +0000 (16:43 +0900)] 
TEST-17-UDEV: several follow-ups (#37042)

7 months agoudev: fix potential stuck on exit (#37022)
Luca Boccassi [Mon, 7 Apr 2025 22:54:23 +0000 (23:54 +0100)] 
udev: fix potential stuck on exit (#37022)

If an event is requeued after termination is requested, previously
systemd-udevd never called sd_event_exit() and stuck.

7 months agofstab-generator: fix options in systemd.mount-extra= arg
Jules Lamur [Mon, 7 Apr 2025 16:49:26 +0000 (18:49 +0200)] 
fstab-generator: fix options in systemd.mount-extra= arg

Fixes a bug introduced by 55365b0a233ae3024411fd0815ad930e20f6a3d6 (v254).

The arguments `(rd.)systemd.mount-extra` take a value that looks like
`WHAT:WHERE[:FSTYPE[:OPTIONS]]`. The `OPTIONS` were parsed into a nulstr
where a comma-separated c-string was expected. This leads to a bug where
only the first option was taken into account by the generator.

For example, if you passed `systemd.mount-extra=/x:/y:baz:ro,defaults`
to the kernel, `systemd-fstab-generator` would translate that into a
nulstr: `ro\0defaults\0`.
Since methods processing options in the generator expected a
comma-separated c-string, they would only see the first option, `ro` in
this case.

7 months agotest: switch to new config keyword for bind9 >= 9.21
Luca Boccassi [Mon, 7 Apr 2025 19:55:41 +0000 (20:55 +0100)] 
test: switch to new config keyword for bind9 >= 9.21

bind9 9.21 removed the deprecated 'managed-keys', swap it with
'trust-anchors' if the version is 9.21 or newer

[   20.654086] TEST-75-RESOLVED.sh[1217]: + delv -a /etc/bind.keys @ns1.unsigned.test signed.test
[   20.654425] TEST-75-RESOLVED.sh[1218]: + tee /tmp/tmp.D4LNomAKqY
[   20.672599] TEST-75-RESOLVED.sh[1218]: ;; /etc/bind.keys:1: option 'managed-keys' no longer exists

7 months agoTEST-04-JOURNAL: sync journal in test script, and find journal with invocation ID 37039/head
Yu Watanabe [Mon, 7 Apr 2025 21:56:40 +0000 (06:56 +0900)] 
TEST-04-JOURNAL: sync journal in test script, and find journal with invocation ID

Hopefully improve the stability of the test.

7 months agoTEST-04-JOURNAL: include util.sh before calling cgroupfs_supports_user_xattrs()
Yu Watanabe [Mon, 7 Apr 2025 17:49:07 +0000 (02:49 +0900)] 
TEST-04-JOURNAL: include util.sh before calling cgroupfs_supports_user_xattrs()

Fixes a bug introduced by 46322f27427ab10ef4fca4d189f8eed27d1b5eaf (v256).
Fixes #36991.

7 months agoTEST-17-UDEV: fd may be >= 10 37042/head
Yu Watanabe [Mon, 7 Apr 2025 20:46:20 +0000 (05:46 +0900)] 
TEST-17-UDEV: fd may be >= 10

Follow-up for db5d89309a6df2b505c52d70bf5a638190777027.

7 months agoTEST-17-UDEV: update rules filename
Yu Watanabe [Mon, 7 Apr 2025 09:19:34 +0000 (18:19 +0900)] 
TEST-17-UDEV: update rules filename

Follow-up for 40959dcc028a6884fbea00c11d89217a77716d4d.

7 months agonspawn-oci: replace use of deprecated cgroup v1 properties with v2 ones (#37038)
Yu Watanabe [Mon, 7 Apr 2025 20:28:11 +0000 (05:28 +0900)] 
nspawn-oci: replace use of deprecated cgroup v1 properties with v2 ones (#37038)

7 months agobase-filesystem: avoid creating /lib64 symlink on existing rootfs
Luca Boccassi [Mon, 7 Apr 2025 13:50:39 +0000 (14:50 +0100)] 
base-filesystem: avoid creating /lib64 symlink on existing rootfs

While all distributions agree on where the basic rootfs symlinks
(/bin /sbin /lib) should point to, not all of them agree on the
target of /lib64. Debian and derivatives, expect something different
than Fedora et al. This is mostly due to the different way multiarch
vs multilib are designed.

This can lead to the situation where running systemd-nspawn on Fedora
to boot a Debian container creates an incompatible symlink in the guest
persistent, pre-created and pre-populated root filesystem, causing
issues due to these incompatibilities.

While it would be great if Debian and derivatives had the same
expectations as the rest of the world, this is baked in many places
and not likely to ever be fixable, as the multiarch vs multilib
behaviours are now very entrenched, and changing it would break
compatibilities left and right.

The core purpose of base-filesystem was to allow bringing up a system
with an empty/ephemeral/etc rootfs (and a /usr/ image on top). So as
a workaround, create /lib64 only if we detect that we have created
/bin /lib and /sbin, as that's a sure sign we are booting into an
empty rootfs that needs to be populated.
Conversely, if the filesystem _already_ has /bin /sbin and /lib,
it means it is not ephemeral and it is pre-prepared and persistent,
so it's a good idea to avoid second-guessing the image builder tool
or the package manager and override what it does, and just let them
carry on with the system however they configured it.

Reworked and reworded, original author: Helmut Grohne <helmut@subdivi.de>

7 months agoman: mention "overlay" as a possible option for systemd.volatile
Vitaly Kuznetsov [Mon, 7 Apr 2025 15:45:54 +0000 (17:45 +0200)] 
man: mention "overlay" as a possible option for systemd.volatile

systemd.volatile=overlay is described in the text below, however, it
is missing in the enclosed list of possible options in the beginning.

7 months agonspawn/oci: replace use of deprecated BlockIOWeight/BlockIODeviceWeight with IOWeight... 37038/head
Yu Watanabe [Mon, 7 Apr 2025 16:50:50 +0000 (01:50 +0900)] 
nspawn/oci: replace use of deprecated BlockIOWeight/BlockIODeviceWeight with IOWeight/IODeviceWeight

7 months agonspawn/oci: replace use of deprecated CPUShares with CPUWeight
Yu Watanabe [Mon, 7 Apr 2025 16:29:15 +0000 (01:29 +0900)] 
nspawn/oci: replace use of deprecated CPUShares with CPUWeight

7 months agonspawn/oci: also set CPUQuotaPeriodUSec DBus property
Yu Watanabe [Mon, 7 Apr 2025 16:28:17 +0000 (01:28 +0900)] 
nspawn/oci: also set CPUQuotaPeriodUSec DBus property

7 months agotest-notify-recv: fix message string
Yu Watanabe [Mon, 7 Apr 2025 14:47:33 +0000 (23:47 +0900)] 
test-notify-recv: fix message string

Follow-up for 2351bc991e3a4f1fbdaa2d53900980b6703babbd.
Addresses https://github.com/systemd/systemd/pull/37016#discussion_r2031363409.

7 months agoudev: drop unnecessary discardment of queued events 37022/head
Yu Watanabe [Sat, 5 Apr 2025 17:06:12 +0000 (02:06 +0900)] 
udev: drop unnecessary discardment of queued events

With the previous commit, now on_post_exit() checks only events
currently being processed. Hence, it is not necessary to discard
queued events in manager_exit().

Also, as already SIGTERM is sent to all workers, kill workers timer
is not necessary anymore after manager_exit(), hence disable it.

This mostly does not change any behavior. Just refactoring and
preparation for later change.

7 months agoudev: do not wait for event queue being empty on exit
Yu Watanabe [Sat, 5 Apr 2025 17:04:06 +0000 (02:04 +0900)] 
udev: do not wait for event queue being empty on exit

When the manager process is requested to terminate, if a worker process
try to lock a block device and failed, then the worker returns a
TRY_AGAIN notification and the event is requeued. Hence, the event queue
may have pending events even after manager_exit() is called. In such
situation, sd_event_exit() will never called, and udevd will stuck.

This makes, after termination is requested, it only checks whether there
are any events currently being processed.

7 months agoudev: unconditionally send signals to workers
Yu Watanabe [Sat, 5 Apr 2025 16:49:30 +0000 (01:49 +0900)] 
udev: unconditionally send signals to workers

It is not necessary to wait for a worker processing an event before
sending SIGTERM. Workers will handle SIGTERM after they finish events
that they are currently processing. Let's send SIGTERM whenever it
necessary.

7 months agoudev: split out two functions from on_post()
Yu Watanabe [Sat, 5 Apr 2025 16:01:41 +0000 (01:01 +0900)] 
udev: split out two functions from on_post()

No functional change, just refactoring and preparation for later change.

7 months agomkosi: Update to latest
Daan De Meyer [Mon, 7 Apr 2025 08:22:57 +0000 (10:22 +0200)] 
mkosi: Update to latest

7 months agounits: update comment
Yu Watanabe [Mon, 7 Apr 2025 08:33:44 +0000 (17:33 +0900)] 
units: update comment

Follow-up for f89985ca494b79b2beed47e1f10d46ef2d59ce3e.

7 months agodocs/NETWORK_ONLINE: fix typo
Yu Watanabe [Mon, 7 Apr 2025 08:01:57 +0000 (17:01 +0900)] 
docs/NETWORK_ONLINE: fix typo

Follow-up for 45b1321653ba0e508f20eaf2c31772e5b206c0d8.

7 months agodocs/ARCHITECTURE: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:59:41 +0000 (16:59 +0900)] 
docs/ARCHITECTURE: fix typo

Follow-up for e1c52cb27159ac7200ce6246bbd1a38b2d2e4e4a.

7 months agoman/tmpfile: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:58:21 +0000 (16:58 +0900)] 
man/tmpfile: fix typo

Follow-up for 007b77ac6c01cb306ff890fbf655e10949118f83.

7 months agoman/gpt-auto: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:57:08 +0000 (16:57 +0900)] 
man/gpt-auto: fix typo

Follow-up for c481605d0d9ef119eb392074aa58fd8af040ad25.

7 months agoman/nss-resolve: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:55:47 +0000 (16:55 +0900)] 
man/nss-resolve: fix typo

Follow-up for 2b015ea4b227054dd1c9a60d78e84e0362f1245a.

7 months agoNEWS,TODO: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:54:05 +0000 (16:54 +0900)] 
NEWS,TODO: fix typo

7 months agofs-util: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:53:15 +0000 (16:53 +0900)] 
fs-util: fix typo

Follow-up for 053e0626dbbfa5561a3c746d911e7be1525a64f1.

7 months agopcre2-util: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:52:04 +0000 (16:52 +0900)] 
pcre2-util: fix typo

Follow-up for 5517e214c8e6a18decf54884c9a5566fd7236764.

7 months agomachine: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:49:43 +0000 (16:49 +0900)] 
machine: fix typo

Follow-up for a4019c75c233cfbec96096cef9bdf878a2727d93.

7 months agostring-util: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:46:14 +0000 (16:46 +0900)] 
string-util: fix typo

Follow-up for 87b7d9b6ff23ec10b66bf53efeabf16ad85d7ad8.

7 months agonetwork/netdev: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:44:21 +0000 (16:44 +0900)] 
network/netdev: fix typo

Follow-up for 540eb5f03780b7df6bb013622fb112468f94951c.

7 months agocore/service: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:42:10 +0000 (16:42 +0900)] 
core/service: fix typo

Follow-up for c53d2d54bd29bd6f4c21705ae23425ade8c12167.

7 months agonetwork: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:41:25 +0000 (16:41 +0900)] 
network: fix typo

Follow-up for 96dd66eddfefacc0863c67ba6694e5f9c7fbabec.

7 months agoterminal-util: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:35:12 +0000 (16:35 +0900)] 
terminal-util: fix typo

Follow-up for 3390be38d19c9d339bbc0e003743ce4278aa58b6.

7 months agoterminal-util: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:34:03 +0000 (16:34 +0900)] 
terminal-util: fix typo

Follow-up for b27f791691b149ea660618dd93e7b9792d4e7680.

7 months agoudev: fix typo
Yu Watanabe [Mon, 7 Apr 2025 07:30:33 +0000 (16:30 +0900)] 
udev: fix typo

Follow-up for 0ba9d06963ecb848e71951ed5e9f6f6f03b80b06.

7 months agocore: do not use pidref_hash_ops_free for Manager.watch_pids
Mike Yuan [Sun, 6 Apr 2025 14:10:43 +0000 (16:10 +0200)] 
core: do not use pidref_hash_ops_free for Manager.watch_pids

The PidRefs are in all cases owned by Unit.pids, and gets removed
from Manager.watch_pids(_more) when the unit is destructed, via
unit_unwatch_pidref(). This hasn't caused any issue because
manager_clear_jobs_and_units() is called before destroying
Manager.watch_pids(_more), but let's get this right.

7 months agocore/manager: also assert on Manager.units_by_invocation_id being empty after cleanup
Mike Yuan [Sun, 6 Apr 2025 22:10:50 +0000 (00:10 +0200)] 
core/manager: also assert on Manager.units_by_invocation_id being empty after cleanup

7 months agoudev: move extra_timeout_usec() to udev-config.c
Yu Watanabe [Sat, 5 Apr 2025 16:25:53 +0000 (01:25 +0900)] 
udev: move extra_timeout_usec() to udev-config.c

Then, introduce manager_kill_worker_timeout() helper function.
No functional change, just refactoring.

7 months agotest: extend the unit test test-notify-recv.c
ZIHCO [Sat, 5 Apr 2025 03:54:10 +0000 (04:54 +0100)] 
test: extend the unit test test-notify-recv.c

7 months agopo: Translated using Weblate (Chinese (Simplified) (zh_CN))
Hang Li [Sun, 6 Apr 2025 18:46:36 +0000 (18:46 +0000)] 
po: Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 100.0% (257 of 257 strings)

Co-authored-by: Hang Li <dabao1955@163.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_CN/
Translation: systemd/main

7 months agocore: Resolve /dev/console if it's connected to stdin (#36666)
Daan De Meyer [Sun, 6 Apr 2025 12:14:35 +0000 (14:14 +0200)] 
core: Resolve /dev/console if it's connected to stdin (#36666)

7 months agobuild-path: port to find_executable() and friends, do not return resolved path (...
Yu Watanabe [Sun, 6 Apr 2025 02:25:51 +0000 (11:25 +0900)] 
build-path: port to find_executable() and friends, do not return resolved path (#37025)

7 months agobuild-path: teach pin_callout_binary() to search $PATH too 37025/head
Mike Yuan [Sat, 5 Apr 2025 20:56:19 +0000 (22:56 +0200)] 
build-path: teach pin_callout_binary() to search $PATH too

Prompted by 2caa462504af4f29a2df6805639b026d901099cd

7 months agobuild-path: port to open_and_check_executable(), do not return resolved path
Mike Yuan [Sat, 5 Apr 2025 20:35:01 +0000 (22:35 +0200)] 
build-path: port to open_and_check_executable(), do not return resolved path

Follow-up for b58c240312a5cc0f9f9eab3018d6459e44d085e0

We need to be extremely careful with using the path associated with fd,
since it contains the resolved path if a symlink was opened. In particular,
it's really not desirable to return the resolved executable path in
pin_callout_binary(), which would end up as argv[0] in udev_event_spawn(),
potentially changing the behavior of spawned process.

7 months agopath-util: generalize open_and_check_executable()
Mike Yuan [Sat, 5 Apr 2025 20:29:33 +0000 (22:29 +0200)] 
path-util: generalize open_and_check_executable()

7 months agomeson: remove more deprecated meson options (#36915)
Yu Watanabe [Sat, 5 Apr 2025 16:58:30 +0000 (01:58 +0900)] 
meson: remove more deprecated meson options (#36915)

This removes two more already deprecated meson options.

7 months agomeson: remove more deprecated meson options 36915/head
Yu Watanabe [Tue, 1 Apr 2025 04:49:36 +0000 (13:49 +0900)] 
meson: remove more deprecated meson options

- default-hierarchy meson option was deprecated by
  31323f21bb0ae7c712f43500c42997c91a6d20bf (v256).
- nscd meson option was deprecated by
  28f1f1a5e652508d6e61ace8918e8b831e4b62b4 (v257).

Let's completely remove them now.

7 months agomkosi/opensuse: drop default-hierarchy from systemd.spec
Yu Watanabe [Sat, 5 Apr 2025 11:59:44 +0000 (20:59 +0900)] 
mkosi/opensuse: drop default-hierarchy from systemd.spec

7 months agomkosi: update arch commit reference
Yu Watanabe [Sat, 5 Apr 2025 11:50:37 +0000 (20:50 +0900)] 
mkosi: update arch commit reference

7948d79b63 upgpkg: 257.5-1: new upstream release
d9badad1d4 drop use of deprecated nscd meson option
af071243cf upgpkg: 257.4-1: new upstream release

7 months agoudev-watch: push inotify fd to service manager's fdstore (#36977)
Yu Watanabe [Sat, 5 Apr 2025 11:34:42 +0000 (20:34 +0900)] 
udev-watch: push inotify fd to service manager's fdstore (#36977)

7 months agoshared/cred-util: Ensure TPM code is used with HAVE_TPM2 guards
Khem Raj [Sat, 5 Apr 2025 04:40:41 +0000 (21:40 -0700)] 
shared/cred-util: Ensure TPM code is used with HAVE_TPM2 guards

Building with no TPM2 we end up with following error

/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: note: in a call to built-in function ‘__builtin___memcpy_chk’
In function ‘memcpy’,
    inlined from ‘encrypt_credential_and_warn’ at ../git/src/shared/creds-util.c:1091:17:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: error: argument 2 null where non-null expected [-Werror=nonnull]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: note: in a call to built-in function ‘__builtin___memcpy_chk’
cc1: some warnings being treated as errors   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~

This is because code referencing tpm2 data structures is still used while the
initialization of the function has been compiled out since its conditional on HAVE_TPM2

We add needed guards in places where it is missing to fix this problem

Signed-off-by: Khem Raj <raj.khem@gmail.com>
7 months agonspawn: drop cgv1 handling; core: drop cgroup agent (#36764)
Yu Watanabe [Sat, 5 Apr 2025 08:57:18 +0000 (17:57 +0900)] 
nspawn: drop cgv1 handling; core: drop cgroup agent (#36764)

7 months agoTEST-17-UDEV: check journal about inotify watch 36977/head
Yu Watanabe [Fri, 4 Apr 2025 14:26:03 +0000 (23:26 +0900)] 
TEST-17-UDEV: check journal about inotify watch

7 months agoTEST-17-UDEV: rename subtests
Yu Watanabe [Fri, 4 Apr 2025 20:47:32 +0000 (05:47 +0900)] 
TEST-17-UDEV: rename subtests

7 months agoudev-watch: dump installed inotify watches on start and stop
Yu Watanabe [Fri, 4 Apr 2025 13:42:24 +0000 (22:42 +0900)] 
udev-watch: dump installed inotify watches on start and stop

7 months agoudev: push inotify fd to file descriptor store
Yu Watanabe [Wed, 2 Apr 2025 18:09:31 +0000 (03:09 +0900)] 
udev: push inotify fd to file descriptor store

Then, if we get inotify fd on start, it is not necessary to re-enable
inotify watch.

7 months agoudev-watch: split-out manager_process_inotify() from on_inotify()
Yu Watanabe [Wed, 2 Apr 2025 18:01:03 +0000 (03:01 +0900)] 
udev-watch: split-out manager_process_inotify() from on_inotify()

No functional change, just refactoring.

7 months agoudev: move inotify watch related functions to udev-watch.c
Yu Watanabe [Wed, 2 Apr 2025 17:55:36 +0000 (02:55 +0900)] 
udev: move inotify watch related functions to udev-watch.c

7 months agoboot: only link libgcc when compiler is gcc
David C. Manuelda [Fri, 4 Apr 2025 19:24:13 +0000 (21:24 +0200)] 
boot: only link libgcc when compiler is gcc

When compiling in systems which do not have gcc installed
(like a musl+llvm system) the forced linkage "-lgcc" is
stopping it to compile. As when compiler is clang it do not
need to link explicitelly to gcc I've modified meson to only
link to gcc library when compiler is gcc.

Closes: #35162
7 months agouse grep whole-word search
Matteo Croce [Fri, 4 Apr 2025 16:16:08 +0000 (18:16 +0200)] 
use grep whole-word search

grep supports whole-word search with `-w`, no need to look for a
trailing space.

7 months agonetwork: add support for HSR netdev
Beniamino Galvani [Mon, 31 Mar 2025 19:44:50 +0000 (21:44 +0200)] 
network: add support for HSR netdev

Add support for creating HSR/PRP interfaces. HSR (High-availability Seamless
Redundancy) and PRP (Parallel Redundancy Protocol) are two protocols that
provide seamless failover against failure of any single network component. They
are both implemented by the "hsr" kernel driver.

7 months agotree-wide: allow building with -Werror=flex-array-member-not-at-end (#36993)
Luca Boccassi [Fri, 4 Apr 2025 17:37:54 +0000 (18:37 +0100)] 
tree-wide: allow building with -Werror=flex-array-member-not-at-end (#36993)

Fixes #36988.

7 months agocore: also stash executor path in Manager
Mike Yuan [Fri, 4 Apr 2025 13:52:17 +0000 (15:52 +0200)] 
core: also stash executor path in Manager

Prompted by b58c240312a5cc0f9f9eab3018d6459e44d085e0

Let's not query it over and over again in exec_spawn().

7 months agoTEST-64-UDEV-STORAGE: enable debug logging and set timeout
Yu Watanabe [Fri, 4 Apr 2025 15:21:16 +0000 (00:21 +0900)] 
TEST-64-UDEV-STORAGE: enable debug logging and set timeout

For debugging the following failure:
```
41/95 systemd:integration-tests / TEST-64-UDEV-STORAGE-mdadm_basic                              TIMEOUT        1800.02s   killed by signal 15 SIGTERM
[   30.902392] TEST-64-UDEV-STORAGE.sh[517]: + sfdisk --wipe=always /dev/md/mdmirpar
[   31.326202] TEST-64-UDEV-STORAGE.sh[517]: + udevadm trigger --settle --parent-match /dev/md/mdmirpar
[  900.971338] kauditd_printk_skb: 10 callbacks suppressed
[  900.971343] audit: type=1130 audit(1743767825.783:146): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  900.974057] audit: type=1131 audit(1743767825.786:147): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Finishing after writing 68494 entries
qemu-kvm: terminating on signal 15 from pid 131949 (/usr/bin/python3)
```

7 months agoexec-invoke: Always go via stdin fd in setup_pam() to get tty 36666/head
Daan De Meyer [Thu, 3 Apr 2025 14:25:15 +0000 (16:25 +0200)] 
exec-invoke: Always go via stdin fd in setup_pam() to get tty

We might have resolved the tty to something else if it was set to
/dev/console, so let's always go via stdin in setup_pam(). This also
means we won't set the pam tty if only stdout or stderr are connected
to a tty, which seems like a sensible thing to do.

7 months agocore: Resolve /dev/console if it's connected to stdin
Daan De Meyer [Fri, 21 Mar 2025 09:39:46 +0000 (10:39 +0100)] 
core: Resolve /dev/console if it's connected to stdin

If /dev/console is connected to stdin there's a possibility that
the unit might try to start a logind session from within the unit.
Let's make sure that any such sessions are started on the tty that
/dev/console points to and not on /dev/console itself.

7 months agostat-util: drop unnecessary call of xopenat() in xstatfsat()
Yu Watanabe [Fri, 4 Apr 2025 11:24:40 +0000 (20:24 +0900)] 
stat-util: drop unnecessary call of xopenat() in xstatfsat()

7 months agoterminal-util: Make sure resolve_dev_console() always returns a full path
Daan De Meyer [Fri, 21 Mar 2025 09:36:14 +0000 (10:36 +0100)] 
terminal-util: Make sure resolve_dev_console() always returns a full path

Currently it returns a full path in some cases and a partial path in others.
Let's make sure it always returns a full path.

7 months agoudev-spawn: search executed command in build directory (#36985)
Yu Watanabe [Fri, 4 Apr 2025 15:11:15 +0000 (00:11 +0900)] 
udev-spawn: search executed command in build directory (#36985)

This makes pin_callout_binary() optionally provides the path of the pinned
binary, and makes it used in udev-spawn.c, to allow easy debugging of
program invocations requested by RUN{program} and friends.

7 months agoNEWS: document kernel baseline bump 36764/head
Mike Yuan [Sun, 16 Mar 2025 18:30:37 +0000 (19:30 +0100)] 
NEWS: document kernel baseline bump

Follow-up for 16ac586e5a77942bf1147bc9eae684d544ded88f

7 months agoNEWS: remark cgroup v1 removal
Mike Yuan [Sun, 16 Mar 2025 18:26:41 +0000 (19:26 +0100)] 
NEWS: remark cgroup v1 removal

7 months agocore/cgroup: drop extraneous CGRuntime check in unit_get_memory_available()
Mike Yuan [Mon, 24 Mar 2025 18:46:46 +0000 (19:46 +0100)] 
core/cgroup: drop extraneous CGRuntime check in unit_get_memory_available()

Currently, for units whose CGRuntime is not allocated just yet, e.g.
inactive ones, MemoryAvailable fails to account for their MemoryMax/High
settings. Let's remove the CGRuntime check hence. The call to
unit_get_memory_accounting() would certainly fail, but it doesn't matter,
since 'current' is initially set to 0 anyways.

7 months agocore/cgroup: fold unit_get_current_memory() into generic memory accounting helper
Mike Yuan [Mon, 24 Mar 2025 15:47:09 +0000 (16:47 +0100)] 
core/cgroup: fold unit_get_current_memory() into generic memory accounting helper

7 months agoprocfs-util: modernize convert_meminfo_value_to_uint64_bytes()
Mike Yuan [Mon, 24 Mar 2025 15:45:10 +0000 (16:45 +0100)] 
procfs-util: modernize convert_meminfo_value_to_uint64_bytes()

7 months agoprocfs-util: use xsprintf() where appropriate
Mike Yuan [Mon, 24 Mar 2025 15:35:46 +0000 (16:35 +0100)] 
procfs-util: use xsprintf() where appropriate

7 months agocore/cgroup: remove legacy hierarchy setup
Mike Yuan [Thu, 20 Mar 2025 17:35:50 +0000 (18:35 +0100)] 
core/cgroup: remove legacy hierarchy setup

This also makes pin_cgroupfs_fd actually pin the fs root,
so that we can port all cg_* helpers to operate under
the fd later on.

7 months agocore: remove cgroups-agent
Mike Yuan [Sun, 16 Mar 2025 20:09:07 +0000 (21:09 +0100)] 
core: remove cgroups-agent

7 months agomkosi: update debian commit reference
Mike Yuan [Wed, 2 Apr 2025 19:08:48 +0000 (21:08 +0200)] 
mkosi: update debian commit reference

4643263123 Add NEWS entry to warn about network connectivity loss due to mDNS, and workaround
c995755707 Update changelog for 257.4-9 release
5e2ba1a045 resolved: break mDNS, remove conflict with avahi
6cf6fa39b4 Update changelog for 257.4-8 release
5067878f3a reintroduce systemd-resolved, with conflict on avahi-daemon
60c0d67e45 d/rules: drop nscd meson option
542de2ed44 Install new files for upstream CI
1e9b0e30da d/t/boot-and-services: skip gdm3 test in nested LXD run
4142fb487b systemd.preinst: fix shellcheck warnings
7879441e78 systemd.preinst: do not use systemctl
1d5ba16cf0 Update changelog for 257.4-7 release
ddd3438e04 autopkgtest: re-enable integration tests
98698b582f autopkgtest: fix debugging leftover
f62660777f Backport patches to fix integration tests skipping
b7308013af autopkgtest: when nested tests-in-lxd skips don't fail outer run
d5e96c6e56 Update changelog for 257.4-6 release
2493e2ffc7 Add Lintian override for 'unknown-field Protected'
e27ebff834 d/control: fix systemd-boot and systemd-boot-tools descriptions
705fff1663 systemd: conflict with dracut on arm64
7e92bc39e9 Update changelog for 257.4-5 release
7638a4dcc1 autopkgtest: fix unit-tests for upstream CI
83a6bbe55a Add missing dh-exec shbang to d/systemd-tests.install
11b82593a5 Update changelog for 257.4-4 release
f221a72abd Drop systemd-nspawn on arm64
b8ecb66d05 Drop systemd-resolved package
560cde98d7 Move leftover resolved files to its own package
fc2758d02d autopkgtest: drop versioning constraints on tzdata
b2b7c59141 autopkgtest: remove workaround for 'meson compiile mkosi' and use 'mkosi -f' instead to avoid slow rebuilds
17e11869b5 systemd.postinst: add markers for janitor removals
581a5994f5 Handle new tmp mount on upgrade in preinst rather than postinst
58f6a4f689 d/control: only conflict against opensysusers << 0.7.3-4.1~
6dee609537 userdb: fix wildcard matching
cf722bcd44 systemd-container: use more wildcards to install files
2339308f43 userdbd: use wildcard to install units
a663f671bd Add myself to Uploaders
4a5bef9a48 Install new files
c529659001 Drop systemd-cgroups-agent with upstream profile
970061c678 d/rules: add TODO reminder to drop Ubuntu-specific workaround
88fc574439 systemd-boot: do case-insensitive parsing of efibootmgr output
eecb9466e0 Update tzdata-legacy version constraint for new bookworm-p-u tzdata version
5d9570efad Update changelog for 257.4-3 release
614efde487 Fix versioned breaks/replaces for sd-boot-tools

7 months agocgroup-util: remove now unused cg_kernel_controllers()
Mike Yuan [Sun, 16 Mar 2025 17:48:21 +0000 (18:48 +0100)] 
cgroup-util: remove now unused cg_kernel_controllers()

7 months agonspawn: reject existing cgroupfs mount if cgns is enabled
Mike Yuan [Sun, 16 Mar 2025 21:42:02 +0000 (22:42 +0100)] 
nspawn: reject existing cgroupfs mount if cgns is enabled

7 months agonspawn: do not spuriously override cgroup2fs options on host
Mike Yuan [Sun, 16 Mar 2025 21:08:48 +0000 (22:08 +0100)] 
nspawn: do not spuriously override cgroup2fs options on host

7 months agonspawn/meson: drop duplicate condition on ENABLE_NSPAWN
Mike Yuan [Sat, 29 Mar 2025 14:55:58 +0000 (15:55 +0100)] 
nspawn/meson: drop duplicate condition on ENABLE_NSPAWN

Follow-up for d95818f5221d9b9b19648cffa0cb2407f023b27e

The whole dir is skipped if disabled, so no need for individual
conditions below.