Commit Graph
81015 Commits
Author SHA1 Message Date
Daan De Meyer c2ba4a2864 docs: Document manual cgroup controller management for Delegate=yes
This isn't immediately clear, so let's explicitly document this fact.

More context in https://github.com/systemd/systemd/issues/7355.
2025-04-25 00:42:24 +01:00
Werner Sembach d2502f55a2 hwdb/keyboard: Map FN key on TUXEDO InfinityFlex 14 Gen1
Map the FN key of TUXEDO InfinityFlex 14 Gen1 that wrongly produces the F23
scancode by default.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
2025-04-25 07:20:22 +09:00
Daan De Meyer d04f6fe446 selinux: Disable selinux logging in mac_init() as well
We currently only disable selinux logging in mac_selinux_setup(),
but not in mac_init(). We don't want libraries we use to log unless
we tell them to, so disable selinux's logging in mac_init() as well.
2025-04-25 06:17:28 +09:00
Michal Koutný 3a4aa7f5b2 update TODO 2025-04-25 06:14:42 +09:00
Luca Boccassi a3dc2bbf96 test: use /run/ for test configuration, not /etc/
In case of failures we don't want to leave an image with intermediate
test configuration, as images are reused across multiple tests

Follow-up for edca63a632
2025-04-25 06:13:43 +09:00
Daan De Meyer 45f63c3db7 test: Add custom signal handlers to integration test wrapper script
meson will send SIGTERM if the test gets stuck and hits the timeout,
in which case we still want to do log saving and analysis, so let's
add some signal handlers which allow us to do that.

This won't be very useful until https://github.com/mesonbuild/meson/pull/14513
lands, since we only get half a second from meson to handle SIGTERM
before it sends SIGKILL, but let's land this already so we immediately
start taking advantage of the meson fix once it lands.
2025-04-25 06:11:43 +09:00
Yu Watanabe 497b7a30a9 Several cleanups for reading IP address from DBus message (#37230) 2025-04-25 06:07:18 +09:00
Yu Watanabe 90e799de1f sd-json: fix conditions
Fixes a bug in 6647bbeab1 (v257).

Fixes CID#1609496.
2025-04-25 06:06:38 +09:00
Daan De Meyer dcedcb443c Various clang-tidy improvements (#37237) 2025-04-24 14:40:39 +02:00
Daan De Meyer d06abcf68e meson: Implement duplicate includes check with clang-tidy
Instead of doing this with our own script, let's use clang-tidy
instead.
2025-04-24 12:36:38 +02:00
Daan De Meyer 5008a92469 network: Remove duplicate include 2025-04-24 12:36:38 +02:00
Daan De Meyer 44e86153d1 meson: Define our own clang-tidy target
meson's target has a few issues:
- Runs on all source files regardless if they're included in the
  build or not
- Doesn't have any dependencies on generated sources which means we
  have to do a full build first before we can run clang-tidy
- Doesn't allow us to pass any extra arguments

To work around these, let's define our own clang-tidy target instead
using llvm's run-clang-tidy script. Alongside the clang-tidy target,
let's start keeping track of all generated sources which we make the
clang-tidy target depend on. We also add a new target which will only
generate source files which is useful for setting up the source tree
for running code analysis against it.
2025-04-24 12:36:36 +02:00
Yu Watanabe 10594762c7 Remove unused code and fix one bug (#37225) 2025-04-24 12:28:48 +09:00
Daan De Meyer bcf716ca01 tree-wide: Remove dead code
This code seems to not be used anywhere at all, so let's drop it.

Follow up for ba8d00e859
Follow up for 85686b37b0
Follow up for aff853f8ea
Follow up for 36dad381a2
2025-04-24 10:15:19 +09:00
Daan De Meyer 8621c646b8 core: Use parse_syscall_archs() in bus_exec_context_set_transient_property() 2025-04-24 10:15:19 +09:00
Daan De Meyer 058d680625 network: Fix wrong config parser for Bridge.MulticastIGMPVersion
Follow up for afa51e2dfb
2025-04-24 10:14:57 +09:00
Yu Watanabe 264749453c core/dbus-cgroup: use bus_message_read_in_addr_auto() at one more place 2025-04-24 10:11:07 +09:00
Daan De Meyer 176b887da4 bus-message-util: use bus_message_read_family() at one more place 2025-04-24 10:11:07 +09:00
Yu Watanabe 06a5d24d78 resolvectl: skip reading remaining elements when an invalid address is specified
Previous code assumed that both family and address are read when
-EINVAL, hence the following read of port and name could succeed.

Let's drop the assumption, and skip reading remaining elements.

No functional change, just refactoring and preparation for later change.
2025-04-24 10:11:07 +09:00
Yu Watanabe 90293a9583 resolvectl: make three booleans for read_dns_server_one() into one enum 2025-04-24 10:11:07 +09:00
Nick Labich 5d49aec4c1 repart: Allow devices as sources for --copy-from
Implements #37208
2025-04-24 09:33:51 +09:00
Yu Watanabe a31777df99 udev: support soft-reboot (#37222) 2025-04-24 09:31:56 +09:00
Daan De Meyer bde994efcc mkosi: Run clangd within the tools tree instead of the build container
Running within the build sandbox has a number of disadvantages:
- We have a separate clangd cache for each distribution/release combo
- It requires to build the full image before clangd can be used
- It breaks every time the image becomes out of date and requires a
  rebuild
- We can't look at system headers as we don't have the knowledge to map
  them from inside the build sandbox to the corresponding path on the host

Instead, let's have mkosi.clangd run clangd within the tools tree. We
already require building systemd for both the host and the target anyway,
and all the dependencies to build systemd are installed in the tools tree
already for that, as well as clangd since it's installed together with the
other clang tooling we install in the tools tree. Unlike the previous approach,
this approach only requires the mkosi tools tree to be built upfront, which has
a much higher chance of not invalidating its cache. We can also trivially map
system header lookups from within the sandbox to the path within mkosi.tools
on the host so that starts working as well.
2025-04-23 21:04:07 +02:00
Daan De Meyer cfe8f3ec74 Add clang-tidy check in CI (#37226)
This will make sure we keep our headers standalone and don't introduce
any new cyclic header dependencies
2025-04-23 16:43:17 +02:00
Daan De Meyer 9b5895be12 ci: Add basic clang-tidy check to linter workflow
Let's add a basic clang-tidy check to the linter workflow. This
gives us the following:
- A check so that we don't introduce any new cyclic header dependencies
- A check to make sure all of our header files are standalone, as clang-tidy
  will fail to parse header files that don't include all their dependencies.
2025-04-23 16:13:58 +02:00
Daan De Meyer 50810ff7b8 Various logging improvements and cleanups (#37040) 2025-04-23 15:31:44 +02:00
Daan De Meyer 9e3d048bd0 ci: Use mkosi in linter workflow
Let's reuse the mkosi tools tree to get all the tools we need instead
of pulling them from pypi.
2025-04-23 15:27:49 +02:00
Daan De Meyer 98a8117eb9 Add .clangd configuration file that disables the unused include check
The clangd include checker is rather broken and is littered with false
positives in our codebase, so let's disable the feature until it improves
a bit.
2025-04-23 15:27:49 +02:00
Daan De Meyer 44d50ba88e execute: Get rid of custom logging macros
We already have LOG_CONTEXT_PUSH_EXEC() which with two additions
does exactly the same as the custom logging macros, so let's get rid
of the custom logging macros and use LOG_CONTEXT_PUSH_EXEC() instead.
2025-04-23 14:48:45 +02:00
Daan De Meyer a94d0e3177 timedate: Drop custom logging macros in favor of log context
Additionally, using the log context makes sure the extra fields are
applied to all log messages generated while the context is in place,
rather than only log messages logged with log_unit_xxx() in timedated
itself.

It also means the unit name is prefixed to all log messages logged
within that context. While it's not clear whether we always want the
unit name to be attached to library log messages, we also don't want
the unit name to not be attached to any library log messages, so we opt
to add more rather than less information by adding the unit name everywhere
for now.

In the future we can look into some log.h helpers to enable/disable
adding the prefix to the following log messages or not.
2025-04-23 14:46:46 +02:00
Daan De Meyer ba77798bba unit: Make sure individual unit maximum log level always takes priority
Currently LogLevelMax= can only be used to decrease the maximum log level
for a unit but not to increase it. Let's make sure the latter works as
well, so LogLevelMax=debug can be used to enable debug logging for specific
units without enabling debug logging globally.
2025-04-23 14:46:12 +02:00
Daan De Meyer 6d47c16ce0 log: Make sure LOG_CONTEXT_SET_LOG_LEVEL() can be nested 2025-04-23 14:46:12 +02:00
cvlc12 05f2d9c080 homectl: Use 'user_subvol_rm_allowed' for btrfs by default. 2025-04-23 14:45:18 +02:00
Daan De Meyer b5bea81b74 Various fixes to streamline running code analysis tools such as clang-tidy (#37224) 2025-04-23 14:34:52 +02:00
Daan De Meyer d55c896907 core: Merge forward declaration and definition of DynamicUser 2025-04-23 13:48:48 +02:00
Daan De Meyer e3a70ca482 core: Drop unused forward declaration
We already include unit.h.
2025-04-23 13:48:48 +02:00
Daan De Meyer d25c238f97 basic: Move various macros from assert-util.h to assert-fundamental.h
ASSERT_PTR() and friends in assert-fundamental.h make use of assert()
and assert_se() which when not building for sd-boot are defined in
assert-util.h. Because assert() from glibc is only overridden in
assert-util.h, the macros in assert-fundamental.h still end up using
the glibc assert.

Let's fix this by moving the required macros and related logic to
assert-fundamental.h.
2025-04-23 13:48:48 +02:00
Daan De Meyer 5332be60d3 tree-wide: Use assert_se() instead of assert() in various places
assert() is compiled away if NDEBUG is set which causes an unused
variable warning in various places when the next commit is applied
so let's use assert_se() to avoid these warnings.
2025-04-23 13:48:16 +02:00
Daan De Meyer a843382d1e journal: Always compile journal authentication related files
Tooling such as clang-tidy is bad at dealing with condition
compilation on the build system level instead of at the source file
level. What happens? It still tries to analyze the file and fails
horribly if the required headers aren't available. Let's work around
the issue and make things more consistent at the same time by doing
the necessary HAVE_GCRYPT checks inside of the source files instead
of doing them at the build system level.

We also add some typedefs to allow getting rid of various HAVE_GCRYPT
checks.
2025-04-23 11:50:33 +02:00
Daan De Meyer 84104ad613 libsystemd: Skip _sd-common.h include check when __clang_analyzer__ is defined
This check doesn't work properly when tools such as clang-tidy are
analyzing headers. Since we don't care about the check in that case,
skip it if __clang_analyzer__ is defined similar to how we skip it as
well if __COVERITY__ is defined.
2025-04-23 11:50:32 +02:00
Daan De Meyer ed2506d1d0 boot: Make free() a non inline function
The static inline declaration in iovec-fundamental.h causes static
analyze tooling warnings (clang-tidy). Let's get around it by making
free() non-inline. LTO will make sure it's still inlined properly.
2025-04-23 11:50:32 +02:00
Daan De Meyer c0ced8fc32 Remove more circular header dependencies (#37185)
Continuation of https://github.com/systemd/systemd/pull/37112
2025-04-23 11:24:02 +02:00
Daan De Meyer 401a22bfc1 tree-wide: Make sure all headers are standalone
Let's make sure all of our headers include everything they require.
2025-04-23 10:33:38 +02:00
Daan De Meyer 44de729cdc basic: Use _Static_assert() in missing_audit.h instead of assert_cc()
We want to make the header standalone so it includes all the stuff it
needs. However, including macro.h for assert_cc() doesn't work because
of generate-audit_type-list.sh which would have to become more complex
to handle the extra include directories.

Instead, let's just use _Static_assert() directly which is a builtin and
doesn't need any extra includes.
2025-04-23 10:33:37 +02:00
Daan De Meyer f82e233128 timesync: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer cf108818b3 sysupdate: Remove circular header includes 2025-04-23 10:33:37 +02:00
Daan De Meyer 68527d3051 resolved: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer 834dc38310 resolve: Move implementations of some functions to resolved-dns-packet.c
These depend on a full definition of DnsResourceRecord which we want
to forward declare in the next commit, so let's move the implementation
of these functions to the implementation file and make them lowercase.
2025-04-23 10:33:37 +02:00
Daan De Meyer 6f502df478 resolve: Move two functions from resolved-conf.h to resolved-dns-server.h
Preparation for getting rid of circular header dependencies.
2025-04-23 10:33:37 +02:00
Daan De Meyer 1fe208e60a portable: Remove circular header dependencies 2025-04-23 10:33:37 +02:00