Commit Graph

81284 Commits

Author SHA1 Message Date
Lennart Poettering
aefdbacff8 README: mention explicitly that dmi-sysfs must be built-in, cannot be loaded as kmod
Fixes: #37391
2025-05-12 10:38:15 +02:00
naly zzwd
b5ee8ec4e8 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
2025-05-12 14:54:03 +09:00
Valentin Hăloiu
1dbeb98fea 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
c9837c17d5, 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.
2025-05-11 09:33:28 +09:00
Luca Boccassi
f0b7ca9768 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 22e2f06428
2025-05-10 14:04:45 +02:00
Yu Watanabe
d7b217f2a9 mount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too (#37398)
Split out from #36337
2025-05-10 03:22:20 +09:00
Yu Watanabe
ef12eadfc8 core/bpf: drop old kernels support (#37151) 2025-05-10 03:13:42 +09:00
Yu Watanabe
b112a676d5 udev: several cleanups for managing events (#37384)
Mostly no functional changes, just refactoring.
2025-05-10 02:30:25 +09:00
Mike Yuan
b3cfee2f5d mount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too
Follow-up for 4e24796b5a
2025-05-09 18:39:51 +02:00
Mike Yuan
3cea9c403c core/mount: remove unused temporary variable 2025-05-09 18:39:37 +02:00
Luca Boccassi
b6c3fc750a 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.
2025-05-09 17:07:14 +01:00
Yu Watanabe
dcd2ad2314 udev: move error handling in event_requeue() to caller
Also, remove udev database on failure.
2025-05-10 00:26:32 +09:00
Yu Watanabe
f694a527ac udev: split out device_broadcast_on_error() 2025-05-10 00:26:32 +09:00
Yu Watanabe
e969ec1d51 sd-device: rename arguments
To make it consistent with its declaration and other function
prototypes.
2025-05-10 00:26:32 +09:00
Yu Watanabe
dc231d66ac 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.
2025-05-10 00:26:32 +09:00
Yu Watanabe
e1ae931064 udev: list up all dependencies of an event when the first time it is examined
No functional change, just refactoring.
2025-05-10 00:26:32 +09:00
Yu Watanabe
0cde671c29 udev: check earlier if there is a free room for processing an event 2025-05-10 00:26:32 +09:00
Yu Watanabe
4478546649 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.
2025-05-10 00:26:32 +09:00
Yu Watanabe
e962ebbe72 udev: introduce event_freep() and use it as cleanup attribute
No functional change, just refactoring and preparation for later change.
2025-05-10 00:26:32 +09:00
Daan De Meyer
180ea8b3ab More header cleanups (#37381) 2025-05-09 17:22:33 +02:00
Yu Watanabe
7ded1bcf04 test: allow to allocate test scope even running with unprivileged user 2025-05-10 00:17:52 +09:00
Yu Watanabe
ad446c8ceb 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.
2025-05-10 00:17:52 +09:00
Yu Watanabe
ec3c5cfac7 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.
2025-05-10 00:17:52 +09:00
Yu Watanabe
22e2f06428 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 3fcb98cbff.
2025-05-10 00:17:52 +09:00
Yu Watanabe
71be1f3875 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.
2025-05-10 00:17:52 +09:00
Yu Watanabe
df80d728be bpf-compat: drop unused compat_libbpf_probe_bpf_prog_type() 2025-05-10 00:17:52 +09:00
Yu Watanabe
fb9991962d 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.
2025-05-10 00:17:52 +09:00
Yu Watanabe
4d2b9abbe1 core: replace cgroup_bpf_supported() with dlopen_bpf_full()
After 3988e2489a, 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.
2025-05-10 00:17:52 +09:00
Yu Watanabe
e06e34a3b6 udev: replace get_user/group_creds() with userdb/groupdb_by_name() (#37304)
This also makes networkd not refuse User=/Group=root.
2025-05-09 20:54:16 +09:00
Kurt Borja
15450ba214 hwdb: keyboard: Add Alienware special keys
Add Alienware *Performance mode* toggle key and *Macro* keys.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
2025-05-09 20:42:00 +09:00
Marcos Alano
fb8149234a Add emulated release to G-Mode key 2025-05-09 20:41:45 +09:00
Daan De Meyer
5f142e01d0 strv: Move STRV_FOREACH() to strv-fundamental.h 2025-05-09 11:33:33 +02:00
Daan De Meyer
56c710ce37 alloc-util: Remove unneeded stdlib.h include 2025-05-09 11:33:33 +02:00
Daan De Meyer
2782dae50f 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.
2025-05-09 11:33:33 +02:00
Daan De Meyer
7227d5bfff terminal-util: Move various functions to ansi-color.c 2025-05-09 11:33:33 +02:00
Daan De Meyer
c992250c24 basic: Move parts of audit-util.{c,h} to libaudit-util.{c,h} in shared/ 2025-05-09 11:33:33 +02:00
Daan De Meyer
3b7d332047 macro: Reduce transitive includes 2025-05-09 11:33:31 +02:00
Daan De Meyer
3b58245624 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>.
2025-05-09 11:23:14 +02:00
Yu Watanabe
37c8a03ebf udevadm-info: parse all arguments before doing anything (#37292) 2025-05-09 14:09:45 +09:00
David Tardon
6cdc63d120 udevadm-info: use string table to parse query type 2025-05-09 12:14:21 +09:00
David Tardon
4ef3019ceb udevadm-info: drop args of stat_device()
They are all static vars now, so can be used directly.
2025-05-09 12:14:21 +09:00
David Tardon
8ea3c1fb9e udevadm-info: shorten the code a bit 2025-05-09 12:14:21 +09:00
David Tardon
31767b92a0 udevadm-info: reject devices passed via opts too
Follow-up-for a6b4b2fa01
2025-05-09 12:14:21 +09:00
David Tardon
d89b3004da udevadm-info: split arg. parsing into a separate function 2025-05-09 12:14:16 +09:00
David Tardon
86ff972ac3 udevadm-info: drop superfluous pager_open() call
It's already called in advance in info_main().
2025-05-09 12:10:51 +09:00
David Tardon
5b4d73208e udevadm-info: make arg_pager_flags static 2025-05-09 12:10:51 +09:00
David Tardon
cb3f6c9e0d udevadm-info: move static dtor closer to args 2025-05-09 12:10:51 +09:00
Yu Watanabe
0c93e66386 udev: use userdb_by_name()/groupdb_by_name()
Prompted by https://github.com/systemd/systemd/pull/37294#discussion_r2068141968.
2025-05-09 12:10:28 +09:00
Yu Watanabe
e4d07d1a2d 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.
2025-05-09 12:10:28 +09:00
Yu Watanabe
6d30c11a0a network/tuntap: allow to specify root to User=/Group=
Follow-up for 940441b44c.

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.
2025-05-09 12:10:28 +09:00
Yu Watanabe
6377f40d26 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.
2025-05-09 12:10:28 +09:00