Commit Graph
81464 Commits
Author SHA1 Message Date
Daan De Meyer 9ebbb785b0 serialize: Move some logic to the implementation file
This will allow removing the string-util.h include in #37344.
2025-05-15 04:25:47 +09:00
Yu Watanabe ff4814f60c validatefs: follow ups for recent change (#37447)
Follow-ups for #37434.
2025-05-15 04:25:28 +09:00
Yu Watanabe 1ef6cee327 Bugprone argument comment - round 4 (#37380)
Follow up from https://github.com/systemd/systemd/pull/37356
2025-05-15 03:36:16 +09:00
Daan De Meyer 17b0d165f6 capability-util: Ignore unknown capabilities instead of aborting
capability_quintet_mangle() can be called with capability sets
containing unknown capabilities. Let's not crash when this is the
case but instead ignore the unknown capabilities.

Fixes d5e12dc75e
2025-05-15 03:33:32 +09:00
Yu Watanabe 561f53c92b Small fixups after review for stable (#37442) 2025-05-15 03:30:41 +09:00
Yu Watanabe 5472f6c78f Improve hwdb boilerplate texts (#37440) 2025-05-15 03:29:53 +09:00
Yu Watanabe f78e89b018 validatefs: split out validating gpt label and type
No functional change, just refactoring.
This addresses https://github.com/systemd/systemd/pull/37434#discussion_r2088950725.
2025-05-15 02:58:05 +09:00
Yu Watanabe e4db2c9b83 validatefs: drop unnecessary empty lines 2025-05-15 02:57:57 +09:00
Yu Watanabe e71ff6639c man: fix typo
Follow-up for 778cfac5fb.
Addresses https://github.com/systemd/systemd/pull/37434#discussion_r2088882005.
2025-05-15 02:56:30 +09:00
Daan De Meyer 7305347221 discover-image: Move some logic to the implementation file
This will allow removing the string-util.h and path-util.h includes
as part of #37344.
2025-05-14 19:55:56 +02:00
Daan De Meyer d802d40e86 forward: Add forward declaration for LockFile (#37445) 2025-05-14 19:55:18 +02:00
Daan De Meyer e03e45aef2 Cleanup up includes #1 (#37438) 2025-05-14 19:55:03 +02:00
Daan De Meyer ba6d1f9aca forward: Add forward declaration for LockFile 2025-05-14 19:20:00 +02:00
Yu Watanabe eba8cc8981 integration-tests: several cleanups (#37394) 2025-05-15 01:45:10 +09:00
Zbigniew Jędrzejewski-Szmek 81d7934882 fundamental: assume that intmax_t is the biggest integer
Allowing intmax_t to be narrower than some other type in the assert
is rather strange. By definition, it is the widest type.

Follow-up for c0239e5f11.
2025-05-14 18:35:32 +02:00
Zbigniew Jędrzejewski-Szmek 1a47f96a8d systemd-journald: drop pointless bitfield annotations
This actually doesn't change the struct size, because bools are coalesced
anyway. Also group the bool fields together.
2025-05-14 18:35:32 +02:00
Zbigniew Jędrzejewski-Szmek c730fd7ddd elf2efi: make code more pythonic
Follow-up for 53628612b7.

With 'or', we ignore the empty string (but not '0'), and we only call
time.time() lazily. So this works the same as the code that is replaced,
but avoids the ugly repetition.
2025-05-14 18:35:21 +02:00
Luca Boccassi fa25fece05 Minor docs cleanups (#37439) 2025-05-14 17:16:05 +01:00
Zbigniew Jędrzejewski-Szmek 9282a85ed7 hwdb: say that settings can be also set to 0
We recommend that users create overriddes. This creates the problem that there
is no syntax to unset a property. Thus, the user needs to just set the property
to "something else" in the override file. But then the blurb saying that
"VAR=1" (or "VAR=0" in some cases) is the only allowed value can be confusing.
Say that both 0 and 1 can be set, since this documentation is also intended
for end users.

In our files, we generally don't want the override values anywhere. But we
have a test which checks the rvalue, which should be enough.
2025-05-14 18:08:26 +02:00
Zbigniew Jędrzejewski-Szmek 97f7b74f97 hwdb.d: update/expand boilerplate on various hwdb files
We don't want to encourage people to copy the whole files. The
boilerplate text that recommends an override file rather than a
full copy appeared first in 0213a26f65,
but was added in other places in 57bb707d48.

Directly inspired by 951e8cb060, but
the wrong boilerplate was added in other places too.
2025-05-14 18:08:26 +02:00
Zbigniew Jędrzejewski-Szmek 16acf66cf6 hwdb.d: reword and simplify boilerplate texts
Let's keep things simple and uniform. We put a dot at the
end of some commands… This is obviously correct, but might confuse
some poor user.
2025-05-14 18:08:26 +02:00
Zbigniew Jędrzejewski-Szmek 2fe7cdd91a docs/BOOT_LOADER_INTERFACE: minor grammar fixes 2025-05-14 18:06:38 +02:00
Zbigniew Jędrzejewski-Szmek f72e277d0b docs: punctuation and a typo 2025-05-14 18:06:04 +02:00
Lennart Poettering 4fefc10c0d validatefs: fix checks on file systems backed by multiple devices (i.e. verity) (#37434)
Fixes #37157
2025-05-14 17:53:06 +02:00
Daan De Meyer e2165e01bd vmspawn: Clean up includes
Split out of #37344
2025-05-14 17:21:37 +02:00
Daan De Meyer 5a94aaaf5d xdg-autostart-generator: Clean up includes
Split out of #37344
2025-05-14 17:21:37 +02:00
Daan De Meyer 905ebf6b79 sd-bus: Make sure sd_bus_error and sd_bus_error_map structs are named
Otherwise we can't forward declare them.

Split out of #37344
2025-05-14 17:21:37 +02:00
Daan De Meyer 5f7b80b4e5 hashmap: Make sure Iterator struct is named
Otherwise we can't forward declare it.

Split out of #37344
2025-05-14 17:21:37 +02:00
Daan De Meyer 02b6ac3a50 static-destruct: Move static_destruct() logic to implementation file
This will allow us to remove the memory-util.h include from
static-destruct.h as part of #37344.
2025-05-14 16:56:41 +02:00
Daan De Meyer bdcd47a269 blockdev-util: Remove dependency on string-util.h
Let's insist on a string literal in SYS_BLOCK_PATH_MAX() so that
we don't accidentally allocate VLAs and let's inline strempty() in
xsprintf_sys_block_path() so we don't need to include string-util.h
in blockdev-util.h

We'll remove the actual string-util.h include as part of #37344.
2025-05-14 16:56:05 +02:00
Daan De Meyer 5f3b558b99 Introduce forward.h header with forward declarations (#37428)
In preparation for adopting forward declarations to reduce unnecessary
transitive includes across the tree, let's introduce a forward.h header
with forward declarations for all libc, libsystemd, basic and shared
types.

Additionally, this header exports all basic integer types and errno
constants, as well as all macros including assertions macros. These
header files contain types often used in headers and are always included
in every source file one way or another anyway.

To avoid having to include memory-util.h and alloc-util.h in forward.h,
we split off the parts we need from both into cleanup-util.h and only
include cleanup-util.h in forward.h.

To keep this commit self-contained, we include cleanup-fundamental.h and
cleanup-util.h from the headers that originally contained the same
macros. We'll remove these again in a later commit that optimizes the
includes in src/basic and src/fundamental.

Split out of #37364
2025-05-14 16:51:10 +02:00
Daan De Meyer b23c1cf55e boot: Use DEFINE_TRIVIAL_CLEANUP_FUNC() to define strv_freep() 2025-05-14 16:22:54 +02:00
Lennart Poettering c019ad849f test: attempt to fix resolved wait-online testcase
Fixes: #37430
2025-05-14 16:09:32 +02:00
Lennart Poettering 61b15b78e5 ci: extend validatefs testcase to validate verity partitions 2025-05-14 15:44:54 +02:00
Lennart Poettering 778cfac5fb man: document that gpt-label/gpt-type uuid xattrs are now lists 2025-05-14 15:44:54 +02:00
Lennart Poettering 02347d24e4 repart: initialize validatefs xattrs to list *all* verity subordinate partitions
Now that we can actually list multiple gpt labels/type uuids in xattrs,
let's start doing so.

Fixes: #37157
2025-05-14 15:44:54 +02:00
Lennart Poettering f7d3262844 validatefs: properly authenticate all subordinate devices of DM devices
Previously, we'd only authenticate "one" of the subordinate devices of a
DM device, and which one was somewhat undefined, it would be what we
find in slaves/ first. This is in particular a problem with dm-verity
which generally has two subordinate devices: the data device and the
hash device.

Let's fix this properly. This means two things:

1. iterate through *all* subordinate devices of a DM device (i.e.
   iterate through the sysfs slaves/ subdir), not just
   one

2. permit configuring a list of gpt labels and gpt type uuids in the
   xattrs of mount points, so that all valid combinations can be listed.

This only updates the validation like this. The generation of xattrs
that carry multiple type uuids/labels in systemd-repart will follow in a
later commit.

This extends the syntax of the two gpt-related xattrs, to allow lists of
things. This is a true extension, without breaking compat (but even if
it was, it wouldn't matter given that validatefs was added post v257,
i.e. is not included in a stable release.

Fixes: #37157
2025-05-14 15:44:54 +02:00
Daan De Meyer 686bbf1e7f Introduce forward.h header with forward declarations
In preparation for adopting forward declarations to reduce unnecessary
transitive includes across the tree, let's introduce a forward.h header
with forward declarations for all libc, libsystemd, basic and shared types.

Additionally, this header exports all basic integer types and errno constants,
as well as all macros including assertions macros. These header files contain
types often used in headers and are always included in every source file one
way or another anyway.

To avoid having to include memory-util.h and alloc-util.h in forward.h, we
split off the parts we need from both into cleanup-util.h and only include
cleanup-util.h in forward.h.

To keep this commit self-contained, we include cleanup-fundamental.h and
cleanup-util.h from the headers that originally contained the same macros.
We'll remove these again in a later commit that optimizes the includes in
src/basic and src/fundamental.

Split out of #37364
2025-05-14 15:44:17 +02:00
Lennart Poettering 510e966677 validatefs: split out validate_fields_check() into three functions
Just some basic refactoring, no actual code changes
2025-05-14 13:04:20 +02:00
Lennart Poettering 798d140cac avoid race between systemd-logind and systemd-udevd in setting ACLs (#36444)
Follow-up for #36408.
Hopefully fixes #24026, #28512, and/or #23547.
2025-05-14 13:03:46 +02:00
Lennart Poettering 66d84090f4 Address post-merge issues in the sysfail entry functionality (#37426) 2025-05-14 13:03:13 +02:00
Lennart Poettering 86bb6f4052 fork-journal: some follow-ups (#37423) 2025-05-14 13:02:46 +02:00
Lennart Poettering c55f87062d journald: rename primary object from "Server" to "Manager"
In all our daemons the primary entrypoint object is called "Manager".
But so far there was one exception: in journald it was called "Server".
Let's normalize that, and stick to the same nomenclature everywhere, to
make journald less special.

No real code change, just some search&replace.
2025-05-14 13:02:26 +02:00
Jelle van der Waa 2a1a6e5dd0 sd-device: fix argument comment chase_flags 2025-05-14 12:10:56 +02:00
Jelle van der Waa 39f4686045 basic: fix consistency of flags argument for chase and chaseat
Both functions have one flags argument, so we don't need to
rename them to `chase_flags`.
2025-05-14 12:10:54 +02:00
Jelle van der Waa 3e1ff91fd6 shared/cred-util: fix argument comment for copy_file_at 2025-05-14 11:15:46 +02:00
Jelle van der Waa ac54e84a4e ask-password-api: use flags consistently as argument name 2025-05-14 11:15:45 +02:00
Jelle van der Waa 09755ba511 treewide: fix argument comment for getxattr_at_bool 2025-05-14 11:15:45 +02:00
Jelle van der Waa 4827c9fde8 basic: fix argument naming for vt_release 2025-05-14 11:15:45 +02:00
Jelle van der Waa 88a66cfbd5 hostname: use argument comment name transient_hostname 2025-05-14 11:15:45 +02:00