Commit Graph
9733 Commits
Author SHA1 Message Date
Daan De Meyer dbef7bcf29 shared: Followups for #37575 2025-05-25 03:28:50 +09:00
Jelle van der Waa 79d70bb282 killall: correct argument comment 2025-05-24 17:13:39 +02:00
Jelle van der Waa 03722d7120 tpm2-util: rename 'policy' -> 'pcrlock_policy'
Follow the used argument comment naming.
2025-05-24 17:13:39 +02:00
Jelle van der Waa d7bf63bcad creds-util: correct argument comment 2025-05-24 17:13:39 +02:00
Jelle van der Waa 457ce7d94a machine-id-setup: correct argument comments 2025-05-24 16:58:56 +02:00
Jelle van der Waa 3f0a9665d9 dissect-image: rename 'dest' -> 'where'
Consistently name dissect_image_mount*.
2025-05-24 16:58:55 +02:00
Daan De Meyer 69a283c5f2 shared: Clean up includes
Split out of #37344.
2025-05-24 14:00:44 +02:00
Mike Yuan 4108529d3e core: renames in io.systemd.Manager (#37582)
1. rename sources to follow `core/varlink-*` patter per @YHNdnzj's
comment in
https://github.com/systemd/systemd/pull/35098#issuecomment-2876509919
2. camelCase Context/Runtime in varlink spec. Varlink fields are
camelCase unless well defined config names.
2025-05-23 17:46:26 +02:00
Yu Watanabe 2c1cc93840 hostname: add hardware family, sku and version (#36956)
Add support for the hardware family, SKU (Stock-Keeping Unit) and
version. The values are read from the file /etc/machine-info or DMI as
fallback.

The entries are useful to provide an unified interface to collect detail
hardware information. The /etc/machine-info entries enable embedded
devices without UEFI support to provide the information via a common
interface.

Fixes: #31134
2025-05-23 23:17:01 +09:00
Ivan Kruglov 9ffa967413 core: lowercase Context/Runtime
Varlink fields are camelCase unless well defined config names.
2025-05-23 06:32:49 -07:00
Daan De Meyer 5ea01af240 meson: Use .inc for generated code meant to be included in other files
These files use the .h extension but are not standalone so let's not
make it appear like they are proper headers and instead use the .inc
extension.
2025-05-22 11:25:29 +02:00
Stefan Herbrechtsmeier 29a352e8c1 hostname: add hardware version
Add support for the hardware version. The version describes a distinct
version of compatibility hardware. The value is read from the file
/etc/machine-info or DMI as fallback.

The integration provides an unified interface to collect detail hardware
information. The /etc/machine-info entry enables embedded devices
without UEFI support to read the information from a custom store.
2025-05-22 09:00:14 +02:00
Stefan Herbrechtsmeier 79e9fb68a3 hostname: add hardware Stock-Keeping Unit
Add support for the hardware Stock-Keeping Unit (SKU). The SKU describes
a distinct type of hardware for sale, purchase or inventory management.
The value is read from the file /etc/machine-info or DMI as fallback.

The integration provides an unified interface to collect detail hardware
information. The /etc/machine-info entry enables embedded devices
without UEFI support to read the information from a custom store.
2025-05-22 09:00:14 +02:00
Daan De Meyer 54f3008a1e pretty-print: Add missing fileio.h include
LONG_LINE_MAX comes from fileio.h and is used in pretty-print.h so
pretty-print.h should include it.
2025-05-21 23:53:40 +09:00
Daan De Meyer cdd5fac068 tree-wide: Include <libaudit.h> via libaudit-util.h
Let's keep the ifdeffery for the include in one place.
2025-05-21 14:05:56 +02:00
Daan De Meyer 9f23910935 tests: Move implementation of DEFINE_HEX_PTR() into source file
Otherwise we have to add a hexdecoct.h include to tests.h which we
want to avoid.
2025-05-21 13:59:18 +02:00
Daan De Meyer 9f74f56f36 test-tables: Pass enum type to test_table() as well
clang-include-cleaner has a hard time figuring out unused includes
with all the macro string concatentation we're doing in test_table().
Let's help it out a little by also passing the enum type into test_table().

While technically not needed, this makes the tests a bit more self-descriptive
and not really much more verbose so it feels like a good chance regardless,
even if the primary purpose is to help clang-include-cleaner figure out
used and unused includes.
2025-05-21 13:24:42 +02:00
Yu Watanabe ef27ebab08 Clean up more includes (#37527)
Split out of #37344
2025-05-21 19:43:39 +09:00
Jelle van der Waa d0ae0e4f07 pretty-print: correct argument comment 2025-05-21 10:50:25 +02:00
Jelle van der Waa d8b9f67e67 treewide: fix header file definitions 2025-05-21 10:50:25 +02:00
Daan De Meyer 7a30bc9ad6 shared: Introduce conf-parser-forward.h
conf-parser.h pulls in a lot of other headers as needed by all the
macros it defines. We can't easily move the implementations of these
macro to conf-parser.c, so let's instead introduce conf-parser-forward.h
with just the stuff in it needed by other header files.

We'll make use of this when cleaning up includes to only include the
minimal parts of conf-parser.h that are required by other headers without
pulling in the kitchen sink.
2025-05-21 10:49:42 +02:00
Daan De Meyer fa34123c35 test: Clean up includes
To make sure everything still compiles, we add a preliminary include
of forward.h to tests.h to make sure it is included in every test source
file. We'll clean up the tests.h includes in a later commit.

We also add a <errno.h> include to errno-list.h to keep test-errno-list.c
compiling. It'll be removed again when we clean up includes in src/basic.

Split out of #37344.
2025-05-21 10:49:42 +02:00
Daan De Meyer 4cb9717bdc pcre2-util: Make sure PatternCompileCase enum is named 2025-05-21 10:37:18 +02:00
Daan De Meyer 1fda0f4cae Various meson improvements (#37510) 2025-05-20 13:44:33 +02:00
Luca Boccassi 6946eed3fa core: Also refresh confext extensions when reloading notify-reload service (#33995)
`ExtensionImages=` and `ExtensionDirectories=` now let you specify
vpick-named extensions; however, since they just get set up once when
the service is started, you can't see newer versions without restarting
the service entirely. Here, also reload confext extensions when you
reload a service. This allows you to deploy a new version of some
configuration and have it picked up at reload time without interruption
to your workload.

Right now, we would only reload confext extensions and leave the sysext
ones behind, since it didn't seem prudent to swap out what is likely
program code at reload. This is made possible by only going for the
`SYSTEMD_CONFEXT_HIERARCHIES` overlays (which only contains `/etc`).

This PR:
- Adjusts `service.c` to also refresh extensions when needed. 
- Adds integration tests to check that a confext reload actually
occurred.
- Adds to the `systemd.exec` man pages to document this behavior.

This is a follow up to #24864 and #31364. Thank you to @bluca and
@goenkam for help in getting this up.
2025-05-20 11:27:34 +01:00
Daan De Meyer d86fead481 meson: Rework clang-tidy integration to be done via unit tests
Instead of using run-clang-tidy.py with its own scheduling, let's
just gather a list of source files ourselves and then use that to
add a unit test for each source file that runs clang-tidy on the
source file.

We also add a bit of logic to run clang-tidy on most header files
as well for extra coverage. This uncovered various header files that
were not standalone so this commit also includes fixes to make sure
the clang-tidy tests are all green.

We can also use this in a later commit to run clang-include-cleaner
on each source file in the same way.
2025-05-20 10:29:59 +02:00
maia x.andLuca Boccassi dfdeb0b1cb core: reload confexts when reloading notify-reload services
`ExtensionImages=` and `ExtensionDirectories=` now let you specify
vpick-named extensions; however, since they just get set up once when
the service is started, you can't see newer versions without restarting
the service entirely.  Here, also reload confext extensions when you
reload a service. This allows you to deploy a new version of some
configuration and have it picked up at reload time without interruption
to your workload.

Right now, we would only reload confext extensions and leave the sysext
ones behind, since it didn't seem prudent to swap out what is likely
program code at reload. This is made possible by only going for the
`SYSTEMD_CONFEXT_HIERARCHIES` overlays (which only contains `/etc`).

Implementation wise, this uses the new kernel API and two collaborating
child processes under the host & child namespaces in order to gather the
right FDs needed:

  - (1) In child, set up the extension images and directories in a slave
	mountns, and obtain their FDs.
  - (2) Fork into a grandchild under target process namespace, and do a
        "fake" unmount to obtain the FD of the underlying target folder
	say /etc).
  - (3) In the child again, set up new overlay under host NS rights.

We do not want to do I/O heavy jobs inline in PID1 blocking the state
machine, so add separate async states to handle this case.

Co-authored-by: Luca Boccassi <luca.boccassi@gmail.com>
2025-05-19 13:36:21 +01:00
Daan De Meyer 96b9d4162f bpf-link: Add HAVE_LIBBPF check
Fixes compilation error in userns-restrict.c where we try to include
libbpf.h when it is not available.
2025-05-16 21:36:15 +09:00
Yu Watanabe ed3dce108d varlink: fix typo
Follow-up for 736349958e.
2025-05-16 17:47:54 +09:00
Lennart Poettering 645e35633f Clean up includes (#37467)
Split out of #37344 

More small components that shouldn't be all too controversial.
2025-05-16 10:07:19 +02:00
Lennart Poettering 22b5ddb90f tree-wide: fix use of flink_tmpfile()
Let's always make sure the temporary file returned by fopen_tmpfile()
and friends is removed on failure (via _cleanup_). Conversely, make sure
that once the file is renamed into its final place, we no longer try to
remove the temporary file (since it's not going to exist anymore).
2025-05-16 08:28:42 +02:00
Daan De Meyer ef10d4b526 Bugprone argument comment - round 5 (#37481) 2025-05-15 20:33:50 +02:00
Jelle van der Waa 346c62f9ca treewide: correct argument comments 2025-05-15 15:39:20 +02:00
Jelle van der Waa f15dcafdb1 discover-image: correct argument comments 2025-05-15 14:50:33 +02:00
Mike Yuan 7762e9bbb2 core: always enable CPU accounting; cgtop: drop cgv1 handling (#37448) 2025-05-15 14:41:07 +02:00
Luca Boccassi ed5c3f4436 core: use socket cookie for naming per-connection service instances + set $SO_COOKIE env var to it (#37469) 2025-05-15 11:11:21 +01:00
Jelle van der Waa 5ae4d7c9ba tpm2-util: correct argument comments 2025-05-15 11:12:43 +02:00
Jelle van der Waa 2f75e5efa1 tpm2-util: rename tpm2_unseal arguments
To make it consistent with its implementation.
2025-05-15 11:12:28 +02:00
Lennart Poettering 272017d32a socket-util: add trivial socket_get_cookie() helper 2025-05-15 09:45:19 +02:00
Lennart Poettering 8d7d2edcbb bus-polkit: add a generic vtable for methods with no params, but with polkit 2025-05-15 09:31:27 +02:00
Mike Yuan 29da53dde3 core: always enable CPU accounting
Our baseline is v5.4 and cgroup v2 is enforced now,
which means CPU accounting is cheap everywhere without
requiring any controller, hence just remove the directive.
2025-05-15 02:19:16 +02:00
Mike Yuan 5fde5c0399 systemctl-show: drop BlockIO* property formatter 2025-05-15 02:19:15 +02:00
Mike Yuan 3274ef6792 core: drop Manager.blockio_accounting
Follow-up for 98d64ff500
2025-05-15 02:19:15 +02:00
Daan De Meyer 90711654df user-record: Make sure UserStorage enum has the same name as its typedef 2025-05-15 00:00:03 +02:00
Daan De Meyer 0dc510ab03 tpm2-util: Make sure structs/enums are named and add to forward.h
We have to name structs/enums to be able to forward declare them, so
let's do that and add the missing ones to forward.h.
2025-05-14 22:34:02 +02:00
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 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 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 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
Luca Boccassi ab5cb21e32 mount-util: add helper to get source from mountinfo 2025-05-14 15:13:28 +01:00