]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 months agosd-boot: use sysfail entry for UEFI firmware update failure 34856/head
Igor Opaniuk [Thu, 23 Jan 2025 12:31:04 +0000 (13:31 +0100)] 
sd-boot: use sysfail entry for UEFI firmware update failure

Add support for using a sysfail boot entry in case of UEFI firmware
capsule update failure [1]. The status of a firmware update is obtained from
the EFI System Resource Table (ESRT), which provides an optional mechanism
for identifying device and system firmware resources for the purposes of
targeting firmware updates to those resources.

Current implementation uses the value of LastAttemptStatus field from
ESRT, which describes the result of the last firmware update attempt for
the firmware resource entry. The field is updated each time an
UpdateCapsule() is attempted for an ESRT entry and is preserved across
reboots (non-volatile).

This can be be used in setups with support for A/B OTA updates, where
the boot firmware and Linux/RootFS might be updated synchronously.

[1] https://uefi.org/specs/UEFI/2.10/23_Firmware_Update_and_Reporting.html
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
5 months agobootctl: configure a sysfail entry
Igor Opaniuk [Mon, 24 Mar 2025 14:33:16 +0000 (15:33 +0100)] 
bootctl: configure a sysfail entry

You can configure the sysfail boot entry using the bootctl command:
$ bootctl set-sysfail sysfail.conf

The value will be stored in the `LoaderEntrySysFail` EFI variable.

The `LoaderEntrySysFail` EFI variable would be unset automatically
during next boot by `systemd-boot-clear-sysfail.service` if no
system failure occured, otherwise it would be kept as it is and a system
failure reason will be saved to `LoaderSysFailReason` EFI variable.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
5 months agosd-boot: add support for a sysfail entry
Igor Opaniuk [Mon, 24 Mar 2025 14:30:49 +0000 (15:30 +0100)] 
sd-boot: add support for a sysfail entry

Add support for a sysfail boot entry. Sysfail boot entries can be
used for optional tweaking the automatic selection order in case a
failure state of the system in some form is detected (boot firmware
failure etc).

The EFI variable `LoaderEntrySysFail` holds the boot loader entry to
be used in the event of a system failure. If a failure occurs, the reason
will be stored in the `LoaderSysFailReason` EFI variable.

sysfail_check() expected to be extented to support possible
conditions when we should boot sysfail("recovery") boot entry.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
5 months agobless-boot: some fixes (#37375)
Lennart Poettering [Mon, 12 May 2025 13:11:06 +0000 (15:11 +0200)] 
bless-boot: some fixes (#37375)

This mostly makes sure we do something reasonable when our tool is
called from a boot of an entry that was already marked as definitely
"bad" on a previous boot. Such an entry we can return into a "good"
state, but we cannot return it into an "indeterminate" state, because
the status quo ante is already known.

Fixes: #37350
5 months agobless-boot: never try to rename an entry file onto itself 37375/head
Lennart Poettering [Wed, 7 May 2025 13:34:51 +0000 (15:34 +0200)] 
bless-boot: never try to rename an entry file onto itself

If we are booting a known bad entry, and we are asked to mark it as bad,
we so far would end up renaming the entry onto itself, which resulted in
EEXIST and is really borked operation. Let's catch that case and handle
it explicitly.

5 months agobless-boot: in "status" output report bad state from prev boot as "dirty"
Lennart Poettering [Wed, 7 May 2025 13:24:06 +0000 (15:24 +0200)] 
bless-boot: in "status" output report bad state from prev boot as "dirty"

The bless-boot logic currently assumes that if the name of the boot
entry reported via the EFI var matches the name on disk that the state
is "indeterminate", as we haven't counted down the counter (to mark it
bad) or drop the counter (to mark it good) yet. But there's one corner
case we so far didn't care about: what if the entry already reached 0
left tries in a previous boot, i.e. if the user invoked an entry already
known to be completely bad. In that case we'd still return
"indeterminate", but that's kinda misleading, because we *know* the
currently booted entry is bad, however we inherited that fact from a
previous boot, we didn't determine it on the current.

hence, let's introduce a new status we report in this case, that is both
distinct from "bad" (which indicates whether the *current* boot is bad)
and "indirect" (which indicates the current boot has not been decided on
yet): "dirty".

Why "dirty"? To mirror "clean" which we already have, which indicates a
boot already marked good in a previous boot, which is a relatively
symmetric state.

This is a really weak api break of sorts, because it introduces a new
state we never reported before, but I think it's fine, because the old
reporting was just wrong, and in a way this is bugfix, that we now
report correctly something where previously returned kind of rubbish
(though systematic rubbish).

Replaces:  #37350

5 months agobless-boot: switch from last_path_component() to path_find_last_component()
Lennart Poettering [Wed, 7 May 2025 13:23:00 +0000 (15:23 +0200)] 
bless-boot: switch from last_path_component() to path_find_last_component()

Using path_find_last_component() means special cases such as the root dir
and paths referencing dirs are detected and refused.

5 months agoREADME: mention explicitly that dmi-sysfs must be built-in, cannot be loaded as kmod
Lennart Poettering [Mon, 12 May 2025 08:38:15 +0000 (10:38 +0200)] 
README: mention explicitly that dmi-sysfs must be built-in, cannot be loaded as kmod

Fixes: #37391
5 months agopo: Translated using Weblate (Catalan)
naly zzwd [Sun, 11 May 2025 20:05:06 +0000 (20:05 +0000)] 
po: Translated using Weblate (Catalan)

Currently translated at 100.0% (257 of 257 strings)

po: Translated using Weblate (Catalan)

Currently translated at 79.7% (205 of 257 strings)

Co-authored-by: naly zzwd <xeanhort007@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ca/
Translation: systemd/main

5 months agoAdd netdev files associated with link to networkd JSON output (#37402)
Valentin Hăloiu [Sun, 11 May 2025 00:33:28 +0000 (01:33 +0100)] 
Add netdev files associated with link to networkd JSON output (#37402)

`networkctl status LINK` gained support for showing the netdev
configuration files associated with a link in
c9837c17d57d7e0fd9d3e2a4f2693f389ca76c24, but these netdev files were
never added to the JSON output too.

This pull-request fixes that by adding two new fields (`NetDevFile` and
`NetDevFileDropins`) to the `networkctl` (and `D-Bus`) JSON output.

5 months agotest: fix root check for test-bpf-foreign-programs
Luca Boccassi [Sat, 10 May 2025 11:31:19 +0000 (12:31 +0100)] 
test: fix root check for test-bpf-foreign-programs

This test requires root, but the check was mistakenly dropped, causing it
to fail with an assert when running without root:

src/test/test-bpf-foreign-programs.c:308: Assertion failed: expected "test_bpf_cgroup_programs(m, "single_prog.service", single_prog, ELEMENTSOF(single_prog))" to succeed, but got error: Operation not permitted

Restore the uid check

Follow-up for 22e2f0642897cfa7ba975527f5394bd7fcdf639b

5 months agomount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too...
Yu Watanabe [Fri, 9 May 2025 18:22:20 +0000 (03:22 +0900)] 
mount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too (#37398)

Split out from #36337

5 months agocore/bpf: drop old kernels support (#37151)
Yu Watanabe [Fri, 9 May 2025 18:13:42 +0000 (03:13 +0900)] 
core/bpf: drop old kernels support (#37151)

5 months agoudev: several cleanups for managing events (#37384)
Yu Watanabe [Fri, 9 May 2025 17:30:25 +0000 (02:30 +0900)] 
udev: several cleanups for managing events (#37384)

Mostly no functional changes, just refactoring.

5 months agomount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too 37398/head
Mike Yuan [Mon, 24 Feb 2025 17:32:58 +0000 (18:32 +0100)] 
mount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too

Follow-up for 4e24796b5a64064f8b21c07356eba19e9db4bb33

5 months agocore/mount: remove unused temporary variable
Mike Yuan [Sun, 6 Apr 2025 22:26:57 +0000 (00:26 +0200)] 
core/mount: remove unused temporary variable

5 months agoboot: skip shim-specific logic when running with new shim
Luca Boccassi [Wed, 7 May 2025 23:49:25 +0000 (00:49 +0100)] 
boot: skip shim-specific logic when running with new shim

Since shim 16 the plain BS->LoadImage() will just work (TM), we do not need
anymore to set up manual overrides and manually call in the shim-specific
lock protocol or to set shim-specific EFIVAR to make addons work or to load
shim-signed kernels.

Check if the new protocol added in v16 is present, and if so, skip
all that. Once versions < 16 are no longer supported/revoked, all
the code can be dropped entirely.

5 months agoudev: move error handling in event_requeue() to caller 37384/head
Yu Watanabe [Tue, 6 May 2025 17:46:11 +0000 (02:46 +0900)] 
udev: move error handling in event_requeue() to caller

Also, remove udev database on failure.

5 months agoudev: split out device_broadcast_on_error()
Yu Watanabe [Tue, 6 May 2025 17:32:56 +0000 (02:32 +0900)] 
udev: split out device_broadcast_on_error()

5 months agosd-device: rename arguments
Yu Watanabe [Tue, 6 May 2025 17:31:46 +0000 (02:31 +0900)] 
sd-device: rename arguments

To make it consistent with its declaration and other function
prototypes.

5 months agoudev: move timeout event sources from struct Event to struct Worker
Yu Watanabe [Tue, 6 May 2025 10:23:53 +0000 (19:23 +0900)] 
udev: move timeout event sources from struct Event to struct Worker

The timeout event sources are enabled only when the event is being
processed by a worker, hence they are not necessary to be owned by the
event.

No effective functional change, just refactoring.

5 months agoudev: list up all dependencies of an event when the first time it is examined
Yu Watanabe [Mon, 5 May 2025 17:25:32 +0000 (02:25 +0900)] 
udev: list up all dependencies of an event when the first time it is examined

No functional change, just refactoring.

5 months agoudev: check earlier if there is a free room for processing an event
Yu Watanabe [Mon, 5 May 2025 16:37:16 +0000 (01:37 +0900)] 
udev: check earlier if there is a free room for processing an event

5 months agoudev: cache last queued event entry
Yu Watanabe [Sat, 26 Apr 2025 06:09:12 +0000 (15:09 +0900)] 
udev: cache last queued event entry

When we have N queued events, LIST_APPEND() takes O(N).
Let's cache the last event to optimize queueing.

5 months agoudev: introduce event_freep() and use it as cleanup attribute
Yu Watanabe [Sat, 26 Apr 2025 06:37:11 +0000 (15:37 +0900)] 
udev: introduce event_freep() and use it as cleanup attribute

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

5 months agoMore header cleanups (#37381)
Daan De Meyer [Fri, 9 May 2025 15:22:33 +0000 (17:22 +0200)] 
More header cleanups (#37381)

5 months agotest: allow to allocate test scope even running with unprivileged user 37151/head
Yu Watanabe [Wed, 16 Apr 2025 18:03:53 +0000 (03:03 +0900)] 
test: allow to allocate test scope even running with unprivileged user

5 months agocore/bpf-devices: use bpf_program_supported()
Yu Watanabe [Tue, 8 Apr 2025 08:26:58 +0000 (17:26 +0900)] 
core/bpf-devices: use bpf_program_supported()

Note, BPF_PROG_TYPE_CGROUP_DEVICE is supported since kernel v4.15.
As our baseline on the kernel is v5.4, we can assume the bpf type is
always supported.

5 months agocore/bpf-firewall: replace bpf_firewall_supported() with bpf_program_supported()
Yu Watanabe [Wed, 16 Apr 2025 17:39:08 +0000 (02:39 +0900)] 
core/bpf-firewall: replace bpf_firewall_supported() with bpf_program_supported()

Note, BPF_PROG_TYPE_CGROUP_SKB is supported since kernel v4.10, and
BPF_F_ALLOW_MULTI and program name is supported since kernel v4.15.
As our baseline on the kernel is v5.4, we can assume that the type,
flag, and naming is supported when bpf_program_supported() succeeds.

5 months agocore/cgroup: foreign bpf programs needs to pass bpf_program_supported()
Yu Watanabe [Wed, 16 Apr 2025 18:10:38 +0000 (03:10 +0900)] 
core/cgroup: foreign bpf programs needs to pass bpf_program_supported()

As CONFIG_CGROUP_BPF may be disabled on the kernel or we are running on
sanitizers. See comments in bpf_program_supported().

Follow-up for 3fcb98cbff0a5be8bf7c5deda6c1f7e8a31699bd.

5 months agobpf-program: introduce bpf_program_supported() helper function
Yu Watanabe [Wed, 16 Apr 2025 17:05:09 +0000 (02:05 +0900)] 
bpf-program: introduce bpf_program_supported() helper function

It checks if the kernel is built with CONFIG_CGROUP_BPF.
It is currently unused, but will be used later.

5 months agobpf-compat: drop unused compat_libbpf_probe_bpf_prog_type()
Yu Watanabe [Tue, 29 Apr 2025 20:20:06 +0000 (05:20 +0900)] 
bpf-compat: drop unused compat_libbpf_probe_bpf_prog_type()

5 months agocore/bpf: drop unnecessary check for probing program type
Yu Watanabe [Tue, 29 Apr 2025 20:13:26 +0000 (05:13 +0900)] 
core/bpf: drop unnecessary check for probing program type

BPF_PROG_TYPE_CGROUP_SKB is supported since kernel v4.10
(0e33661de493db325435d565a4a722120ae4cbf3) and
BPF_PROG_TYPE_CGROUP_SOCK_ADDR is supported since kernel v4.17
(4fbac77d2d092b475dda9eea66da674369665427).

Our baseline on the kernel is v5.4. The check is not necessary.

5 months agocore: replace cgroup_bpf_supported() with dlopen_bpf_full()
Yu Watanabe [Sun, 20 Apr 2025 03:14:23 +0000 (12:14 +0900)] 
core: replace cgroup_bpf_supported() with dlopen_bpf_full()

After 3988e2489aaf30034e09918890f688780c154af7, the function is a simple
wrapper of bpf_dlopen() with logging. Let's introduce dlopen_bpf_full()
that takes log level, and replace cgroup_bpf_supported() with it.

5 months agoudev: replace get_user/group_creds() with userdb/groupdb_by_name() (#37304)
Yu Watanabe [Fri, 9 May 2025 11:54:16 +0000 (20:54 +0900)] 
udev: replace get_user/group_creds() with userdb/groupdb_by_name() (#37304)

This also makes networkd not refuse User=/Group=root.

5 months agohwdb: keyboard: Add Alienware special keys
Kurt Borja [Thu, 8 May 2025 07:37:55 +0000 (04:37 -0300)] 
hwdb: keyboard: Add Alienware special keys

Add Alienware *Performance mode* toggle key and *Macro* keys.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
5 months agoAdd emulated release to G-Mode key
Marcos Alano [Thu, 8 May 2025 10:28:16 +0000 (07:28 -0300)] 
Add emulated release to G-Mode key

6 months agostrv: Move STRV_FOREACH() to strv-fundamental.h 37381/head
Daan De Meyer [Wed, 7 May 2025 19:43:39 +0000 (21:43 +0200)] 
strv: Move STRV_FOREACH() to strv-fundamental.h

6 months agoalloc-util: Remove unneeded stdlib.h include
Daan De Meyer [Tue, 6 May 2025 12:20:43 +0000 (14:20 +0200)] 
alloc-util: Remove unneeded stdlib.h include

6 months agocompress: Drop lz4 includes from compress.h
Daan De Meyer [Wed, 7 May 2025 09:43:44 +0000 (11:43 +0200)] 
compress: Drop lz4 includes from compress.h

The lz4 functions are only used in test-compress.c, so let's just
put the declarations and includes in there instead of having everyone
including compress.h pull in the lz4 headers.

6 months agoterminal-util: Move various functions to ansi-color.c
Daan De Meyer [Wed, 7 May 2025 09:26:36 +0000 (11:26 +0200)] 
terminal-util: Move various functions to ansi-color.c

6 months agobasic: Move parts of audit-util.{c,h} to libaudit-util.{c,h} in shared/
Daan De Meyer [Wed, 7 May 2025 09:15:12 +0000 (11:15 +0200)] 
basic: Move parts of audit-util.{c,h} to libaudit-util.{c,h} in shared/

6 months agomacro: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 14:03:20 +0000 (16:03 +0200)] 
macro: Reduce transitive includes

6 months agobasic: Override glibc's sys/param.h header with an empty file
Daan De Meyer [Tue, 6 May 2025 13:39:03 +0000 (15:39 +0200)] 
basic: Override glibc's sys/param.h header with an empty file

Instead of unconditionally including sys/param.h in
macro-fundamental.h which itself includes a bunch of other unnecessary
headers, let's override it with an empty file to avoid it from overriding
our MAX() macro. We can't make including it an error as it's included (
for seemingly no good reason) by <resolv.h>.

6 months agoudevadm-info: parse all arguments before doing anything (#37292)
Yu Watanabe [Fri, 9 May 2025 05:09:45 +0000 (14:09 +0900)] 
udevadm-info: parse all arguments before doing anything (#37292)

6 months agoudevadm-info: use string table to parse query type 37292/head
David Tardon [Wed, 7 May 2025 13:05:22 +0000 (15:05 +0200)] 
udevadm-info: use string table to parse query type

6 months agoudevadm-info: drop args of stat_device()
David Tardon [Fri, 25 Apr 2025 12:56:35 +0000 (14:56 +0200)] 
udevadm-info: drop args of stat_device()

They are all static vars now, so can be used directly.

6 months agoudevadm-info: shorten the code a bit
David Tardon [Fri, 25 Apr 2025 12:36:02 +0000 (14:36 +0200)] 
udevadm-info: shorten the code a bit

6 months agoudevadm-info: reject devices passed via opts too
David Tardon [Wed, 7 May 2025 12:35:54 +0000 (14:35 +0200)] 
udevadm-info: reject devices passed via opts too

Follow-up-for a6b4b2fa010f6dc5e18f1a14d93204c6c1416278

6 months agoudevadm-info: split arg. parsing into a separate function
David Tardon [Fri, 3 Nov 2023 13:56:52 +0000 (14:56 +0100)] 
udevadm-info: split arg. parsing into a separate function

6 months agoudevadm-info: drop superfluous pager_open() call
David Tardon [Fri, 25 Apr 2025 12:42:34 +0000 (14:42 +0200)] 
udevadm-info: drop superfluous pager_open() call

It's already called in advance in info_main().

6 months agoudevadm-info: make arg_pager_flags static
David Tardon [Thu, 17 Apr 2025 08:21:41 +0000 (10:21 +0200)] 
udevadm-info: make arg_pager_flags static

6 months agoudevadm-info: move static dtor closer to args
David Tardon [Thu, 17 Apr 2025 08:20:33 +0000 (10:20 +0200)] 
udevadm-info: move static dtor closer to args

6 months agoudev: use userdb_by_name()/groupdb_by_name() 37304/head
Yu Watanabe [Wed, 30 Apr 2025 11:43:44 +0000 (20:43 +0900)] 
udev: use userdb_by_name()/groupdb_by_name()

Prompted by https://github.com/systemd/systemd/pull/37294#discussion_r2068141968.

6 months agouserdb: introduce USERDB_SYNTHESIZE_NUMERIC flag
Yu Watanabe [Fri, 9 May 2025 02:18:02 +0000 (11:18 +0900)] 
userdb: introduce USERDB_SYNTHESIZE_NUMERIC flag

When the flag is set, even if the specified UID/GID does not exist,
create a synthetic user record for the UID/GID.
Currently, only system UID/GID are supported.

6 months agonetwork/tuntap: allow to specify root to User=/Group=
Yu Watanabe [Wed, 30 Apr 2025 16:30:35 +0000 (01:30 +0900)] 
network/tuntap: allow to specify root to User=/Group=

Follow-up for 940441b44c7040d62ae58b66bf124e9a0dae578d.

With the commit, User=/Group=root was refused and warned that the root
is not a system user. Typically it is not necessary to specify such, but
let's not log confusing warning and honor the setting.

6 months agouser-record: introduce USERDB_MATCH_ROOT_AND_SYSTEM
Yu Watanabe [Wed, 30 Apr 2025 14:27:59 +0000 (23:27 +0900)] 
user-record: introduce USERDB_MATCH_ROOT_AND_SYSTEM

It may be useful when we want to resolve root and system user/group
but want to refuse nobody user/group.

6 months agouserdb: introduce user/group_record_buildo() helper macros
Yu Watanabe [Wed, 30 Apr 2025 13:53:35 +0000 (22:53 +0900)] 
userdb: introduce user/group_record_buildo() helper macros

6 months agouser-util,user-record-nss: initialize buffer before calling getpwnam_r() and friends
Yu Watanabe [Thu, 1 May 2025 03:44:23 +0000 (12:44 +0900)] 
user-util,user-record-nss: initialize buffer before calling getpwnam_r() and friends

The buffer will be used by a library outside of our code base,
and may not be initialized even on success. Let's initialize
them for safety.

Hopefully fixes the following fuzzer warning:
```
==2039==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f9ad8be3ae6 in _nss_files_getsgnam_r (/lib/x86_64-linux-gnu/libnss_files.so.2+0x8ae6) (BuildId: 013bf05b4846ebbdbebdb05585acc9726c2fabce)
    #1 0x7f9ad93e5902 in getsgnam_r (/lib/x86_64-linux-gnu/libc.so.6+0x126902) (BuildId: 0323ab4806bee6f846d9ad4bccfc29afdca49a58)
    #2 0x7f9ad9b98153 in nss_sgrp_for_group /work/build/../../src/systemd/src/shared/user-record-nss.c:357:21
    #3 0x7f9ad9b98926 in nss_group_record_by_gid /work/build/../../src/systemd/src/shared/user-record-nss.c:431:21
    #4 0x7f9ad9bcebd7 in groupdb_by_gid_fallbacks /work/build/../../src/systemd/src/shared/userdb.c:1372:29

  Uninitialized value was created by a heap allocation
    #0 0x556fd5294302 in malloc /src/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1021:3
    #1 0x7f9ad9b9811d in nss_sgrp_for_group /work/build/../../src/systemd/src/shared/user-record-nss.c:353:23
    #2 0x7f9ad9b98926 in nss_group_record_by_gid /work/build/../../src/systemd/src/shared/user-record-nss.c:431:21
    #3 0x7f9ad9bcebd7 in groupdb_by_gid_fallbacks /work/build/../../src/systemd/src/shared/userdb.c:1372:29
```

6 months agoudevadm-trigger: parse all arguments before doing anything (#37293)
Yu Watanabe [Fri, 9 May 2025 03:09:18 +0000 (12:09 +0900)] 
udevadm-trigger: parse all arguments before doing anything (#37293)

6 months agoudev: enable kill workers timer when processing events stopped (#37382)
Yu Watanabe [Fri, 9 May 2025 01:42:48 +0000 (10:42 +0900)] 
udev: enable kill workers timer when processing events stopped (#37382)

This also extends test cases for
`udevadm control --start-exec-queue/--stop-exec-queue`.

6 months agoudevadm-trigger: use string table to parse scan type 37293/head
David Tardon [Wed, 7 May 2025 14:11:38 +0000 (16:11 +0200)] 
udevadm-trigger: use string table to parse scan type

6 months agoudevadm-trigger: add prefix to enumeration values
David Tardon [Tue, 29 Apr 2025 12:02:37 +0000 (14:02 +0200)] 
udevadm-trigger: add prefix to enumeration values

6 months agoudevadm-trigger: replace home-made key/value splitting function
David Tardon [Tue, 29 Apr 2025 11:57:10 +0000 (13:57 +0200)] 
udevadm-trigger: replace home-made key/value splitting function

6 months agotest: extend udevadm coverage test a bit
David Tardon [Tue, 29 Apr 2025 12:34:44 +0000 (14:34 +0200)] 
test: extend udevadm coverage test a bit

6 months agoudevadm: allow key without a value
David Tardon [Tue, 29 Apr 2025 12:29:59 +0000 (14:29 +0200)] 
udevadm: allow key without a value

6 months agoudevadm: move key/value parsing func. to udevadm-util.c
David Tardon [Tue, 29 Apr 2025 12:22:15 +0000 (14:22 +0200)] 
udevadm: move key/value parsing func. to udevadm-util.c

6 months agoudevadm-trigger: split arg. parsing into a separate function
David Tardon [Tue, 29 Apr 2025 08:36:28 +0000 (10:36 +0200)] 
udevadm-trigger: split arg. parsing into a separate function

6 months agoudevadm-trigger: add vertical space to separate cases
David Tardon [Tue, 29 Apr 2025 08:09:11 +0000 (10:09 +0200)] 
udevadm-trigger: add vertical space to separate cases

6 months agoTEST-17-UDEV: extend test cases for udevadm control --start-exec-queue/--stop-exec... 37382/head
Yu Watanabe [Wed, 7 May 2025 19:18:58 +0000 (04:18 +0900)] 
TEST-17-UDEV: extend test cases for udevadm control --start-exec-queue/--stop-exec-queue

6 months agoTEST-17-UDEV: drop needless numbering
Yu Watanabe [Wed, 7 May 2025 19:07:04 +0000 (04:07 +0900)] 
TEST-17-UDEV: drop needless numbering

The subtest was renamed from TEST-17-UDEV.10.sh.
Let's also drop the numbering from function name and interface name.

Follow-up for 40959dcc028a6884fbea00c11d89217a77716d4d.

6 months agoudev: enable kill workers timer when processing queued events stopped
Yu Watanabe [Wed, 7 May 2025 16:07:44 +0000 (01:07 +0900)] 
udev: enable kill workers timer when processing queued events stopped

It is not necessary to keep idle workers so long time in that case.

6 months agohashmap,prioq: check hash_ops or compare_func is identical to one already set (#37379)
Mike Yuan [Thu, 8 May 2025 20:50:38 +0000 (22:50 +0200)] 
hashmap,prioq: check hash_ops or compare_func is identical to one already set (#37379)

6 months agoudev-worker: send path to device node of whole disk when it is locked, and one cleanu...
Daan De Meyer [Thu, 8 May 2025 06:20:21 +0000 (08:20 +0200)] 
udev-worker: send path to device node of whole disk when it is locked, and one cleanup (#37385)

6 months agoboot: add an option to control action after SecureBoot enrollment (#36684)
Itxaka [Thu, 8 May 2025 04:28:41 +0000 (06:28 +0200)] 
boot: add an option to control action after SecureBoot enrollment (#36684)

This PR provides a new option for systemd-boot
`secure-boot-enroll-action` which allows to configure the behavior after
SecureBoot keys are enrolled.

Provides the option to either reboot or power off.

The current behavior is not changed, it will by default reboot as it did
before.

It also provides a small message about the action its going to take with
a small delay so the user can read it.

6 months agoprioq: make prioq_ensure_put() type safe 37379/head
Yu Watanabe [Wed, 7 May 2025 16:59:40 +0000 (01:59 +0900)] 
prioq: make prioq_ensure_put() type safe

6 months agoprioq: check if identical compare func is specified if already allocated
Yu Watanabe [Wed, 7 May 2025 17:01:55 +0000 (02:01 +0900)] 
prioq: check if identical compare func is specified if already allocated

6 months agohashmap: check if identical hash_ops is specified if already allocated
Yu Watanabe [Wed, 7 May 2025 17:06:28 +0000 (02:06 +0900)] 
hashmap: check if identical hash_ops is specified if already allocated

6 months agoresolve: use set_put_strdup_full() to specify hash_ops
Yu Watanabe [Wed, 7 May 2025 20:53:23 +0000 (05:53 +0900)] 
resolve: use set_put_strdup_full() to specify hash_ops

6 months agocore/unit: use the same hash_ops originally used on allocation
Yu Watanabe [Wed, 7 May 2025 19:59:37 +0000 (04:59 +0900)] 
core/unit: use the same hash_ops originally used on allocation

See unit_file_build_name_map().

6 months agoset: rename _set_ensure_allocated() -> set_ensure_allocated()
Yu Watanabe [Wed, 7 May 2025 17:10:31 +0000 (02:10 +0900)] 
set: rename _set_ensure_allocated() -> set_ensure_allocated()

Follow-ups for c09ce222b6379e8f73695e5ce53fce76a44d78c7.

6 months agonetwork: log_link_message_debug_errno() automatically append %m if necessary
Yu Watanabe [Wed, 7 May 2025 17:21:59 +0000 (02:21 +0900)] 
network: log_link_message_debug_errno() automatically append %m if necessary

Follow-up for d28746ef552b11cba8890963f49ce3e0082e6053.
Fixes CID#1609753.

6 months agoudev-worker: notify device node of whole disk to manager when the disk is locked 37385/head
Yu Watanabe [Tue, 6 May 2025 16:02:26 +0000 (01:02 +0900)] 
udev-worker: notify device node of whole disk to manager when the disk is locked

It is currently unused, but will be used later.

6 months agoudev-worker: allocate UdevEvent object just before use
Yu Watanabe [Tue, 6 May 2025 15:59:56 +0000 (00:59 +0900)] 
udev-worker: allocate UdevEvent object just before use

No functional change, just refactoring.

6 months agoman: fix typo
Yu Watanabe [Wed, 7 May 2025 18:37:35 +0000 (03:37 +0900)] 
man: fix typo

Follow-up for a50fa2a40f4a91d49503d3588a3dd29ea05e559b.

6 months agoboot: Add EDID (#36843)
Yu Watanabe [Wed, 7 May 2025 17:48:00 +0000 (02:48 +0900)] 
boot: Add EDID (#36843)

This adds a couple of custom CHIDs which include panel manufacturer and
product code.

6 months agoexec-util: make missing agents a gracefull handled issues
Lennart Poettering [Wed, 7 May 2025 15:47:01 +0000 (17:47 +0200)] 
exec-util: make missing agents a gracefull handled issues

Just downgrade the log message in case of ENOENT of agent binaries to
LOG_DEBUG. Do this in order to support distros which split off some
agent bianries into separate optional binaries.

Fixes: #37369
6 months agoflush_ports: flush POSIX message queues properly
Todd C. Miller [Tue, 6 May 2025 22:39:14 +0000 (16:39 -0600)] 
flush_ports: flush POSIX message queues properly

On Linux, read() on a message queue descriptor returns the message
queue statistics, not the actual message queue data.  We need to use
mq_receive() to drain the queues instead.

Fixes a problem where a POSIX message queue socket unit with messages
in the queue at shutdown time could result in a hang on reboot/shutdown.

6 months agounits: enable IgnoreOnIsolate=yes on systemd-udevd-kernel.socket
Yu Watanabe [Wed, 7 May 2025 12:44:22 +0000 (21:44 +0900)] 
units: enable IgnoreOnIsolate=yes on systemd-udevd-kernel.socket

Otherwise, initrd-cleanup.service requests isolation thus the socket
is stopped before switching root, and several early events after
switching root may be lost.

6 months agoanalyze-chid: Support EDID CHIDs 36843/head
anonymix007 [Mon, 31 Mar 2025 17:41:15 +0000 (20:41 +0300)] 
analyze-chid: Support EDID CHIDs

6 months agosd-device: Introduce sd_device_get_sysattr_value_with_size()
anonymix007 [Tue, 1 Apr 2025 14:40:29 +0000 (17:40 +0300)] 
sd-device: Introduce sd_device_get_sysattr_value_with_size()

6 months agochid: Setup EDID CHIDs
anonymix007 [Mon, 24 Mar 2025 13:53:49 +0000 (16:53 +0300)] 
chid: Setup EDID CHIDs

6 months agochid-fundamental: Introduce new CHID types
anonymix007 [Mon, 24 Mar 2025 13:43:12 +0000 (16:43 +0300)] 
chid-fundamental: Introduce new CHID types

These are extra types needed to distinguish devices by the installed
display panel

6 months agoboot: Add EDID parsing
anonymix007 [Mon, 31 Mar 2025 17:56:58 +0000 (20:56 +0300)] 
boot: Add EDID parsing

Will be used for identifying the currently used display panel
and choosing the appropriate DTB

6 months agofundamental: Introduce EDID header parsing
anonymix007 [Mon, 31 Mar 2025 17:38:24 +0000 (20:38 +0300)] 
fundamental: Introduce EDID header parsing

6 months agoboot: Add be16toh, le16toh and le32toh
anonymix007 [Mon, 31 Mar 2025 17:37:13 +0000 (20:37 +0300)] 
boot: Add be16toh, le16toh and le32toh

6 months agofundamental: Move common string constants from basic/string-util.h to string-util...
anonymix007 [Wed, 7 May 2025 15:01:07 +0000 (18:01 +0300)] 
fundamental: Move common string constants from basic/string-util.h to string-util-fundamental.h

6 months agoReduce the number of transitive includes (#37364)
Yu Watanabe [Wed, 7 May 2025 13:58:09 +0000 (22:58 +0900)] 
Reduce the number of transitive includes (#37364)

6 months agostatic-destruct: Reduce transitive includes 37364/head
Daan De Meyer [Mon, 5 May 2025 12:28:08 +0000 (14:28 +0200)] 
static-destruct: Reduce transitive includes

6 months agoiovec-util: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 12:15:47 +0000 (14:15 +0200)] 
iovec-util: Reduce transitive includes