Compare commits

...

12 Commits

Author SHA1 Message Date
Daan De Meyer 73f3600970 tree-wide: Mark linux includes as system includes
Even though these are in our tree, we should still treat them as
system includes which helps various tools (clangd, iwyu, ...) understand
that these are system includes and <> should be used instead of "".
2025-04-17 21:22:44 +02:00
Daan De Meyer bf5db803e7 tree-wide: Remove references to src/shared/linux
This directory doesn't exist anymore.
2025-04-17 21:22:44 +02:00
Daan De Meyer cba44a1975 basic: Remove circular dependency between process-util.h and pidref.h 2025-04-17 21:22:34 +02:00
Daan De Meyer 96334a84f2 basic: Remove cyclic dependency between macro.h and macro-fundamental.h
Currently, macros in macro-fundamental.h depend on various functions
and macros from macro.h when not building for sd-boot. Let's move these
into macro-fundamental.h so that the header is standalone. The implementations
of the functions are kept in macro.c.
2025-04-17 21:18:37 +02:00
Daan De Meyer e809b6a7e9 basic: Remove circular dep between alloc-util.h and memory-util.h 2025-04-17 21:18:37 +02:00
Daan De Meyer e0208363e5 basic: Move macro.h include in list.h to the top of the file
Now that the circular dependency between log.h, macro.h and list.h
is gone, we can move the include to the top.
2025-04-17 21:18:37 +02:00
Daan De Meyer 790a4ee5cf basic: Stop including log.h in macro.h
Now that the necessary functions from log.h have been moved to macro.h,
we can stop including log.h in macro.h. This requires modifying source
files all over the tree to include log.h instead.
2025-04-17 21:18:37 +02:00
Daan De Meyer 63f420dedc basic: Move assertion specific log functions to macro.h
These are only used by macro.h, so let's declare them there as well.
PROJECT_FILE is moved over as well as it's a generic macro and as
such makes sense to be in macro.h.
2025-04-17 21:18:37 +02:00
Daan De Meyer 78b6501311 macro: Move definition of dummy_t to macro-fundamental.h
There is code in macro-fundamental.h that makes use of dummy_t so
let's make sure to declare dummy_t in macro-fundamental.h as well.
2025-04-17 21:18:37 +02:00
Daan De Meyer 92e8293413 basic: Remove stdio-util.h include from log.h 2025-04-17 21:18:36 +02:00
Daan De Meyer b8e799caa8 basic: Remove list.h include from log.h 2025-04-17 21:18:36 +02:00
Daan De Meyer 50261211d6 basic: Move ratelimit logging functions to ratelimit.h
The ratelimit logging functions are only useful in a few scenarios
so let's move them to ratelimit.h instead of keeping them in the
generic log.h
2025-04-17 21:18:36 +02:00
444 changed files with 652 additions and 299 deletions

View File

@ -32,23 +32,23 @@ The following exceptions apply:
* some sources under src/udev/ are licensed under **GPL-2.0-or-later**,
so all udev programs (`systemd-udevd`, `udevadm`, and the udev builtins
and test programs) are also distributed under **GPL-2.0-or-later**.
* the header files contained in src/basic/linux/ and src/shared/linux/ are copied
* the header files contained in src/basic/linux/linux are copied
verbatim from the Linux kernel source tree and are licensed under **GPL-2.0 WITH
Linux-syscall-note** and are used within the scope of the Linux-syscall-note
exception provisions
* the following sources are licensed under the **LGPL-2.0-or-later** license:
- src/basic/utf8.c
- src/shared/initreq.h
* the src/shared/linux/bpf_insn.h header is copied from the Linux kernel
* the src/basic/linux/bpf_insn.h header is copied from the Linux kernel
source tree and is licensed under either **BSD-2-Clause** or **GPL-2.0-only**,
and thus is included in the systemd build under the BSD-2-Clause license.
* The src/basic/linux/wireguard.h header is copied from the Linux kernel
* The src/basic/linux/linux/wireguard.h header is copied from the Linux kernel
source tree and is licensed under either **MIT** or **GPL-2.0 WITH Linux-syscall-note**,
and thus is included in the systemd build under the MIT license.
* the following sources are licensed under the **MIT** license (in case of our
scripts, to facilitate copying and reuse of those helpers to other projects):
- hwdb.d/parse_hwdb.py
- src/basic/linux/batman_adv.h
- src/basic/linux/linux/batman_adv.h
- src/basic/sparse-endian.h
- tools/catalog-report.py
* the following sources are licensed under the **CC0-1.0** license:

View File

@ -5,7 +5,6 @@ set -e
# Exclude following paths from the Coccinelle transformations
EXCLUDED_PATHS=(
"src/boot/efi/*"
"src/shared/linux/*"
"src/basic/linux/*"
# Symlinked to test-bus-vtable-cc.cc, which causes issues with the IN_SET macro
"src/libsystemd/sd-bus/test-bus-vtable.c"

View File

@ -2053,11 +2053,18 @@ boot_stubs = []
build_dir_include = include_directories('.')
basic_includes = include_directories(
'src/basic',
'src/fundamental',
'src/systemd',
'.')
basic_includes = [
include_directories(
'src/basic',
'src/fundamental',
'src/systemd',
'.',
),
include_directories(
'src/basic/linux',
is_system : true
),
]
libsystemd_includes = [basic_includes, include_directories(
'src/libsystemd/sd-bus',

View File

@ -5,6 +5,7 @@
#include "ansi-color.h"
#include "battery-util.h"
#include "build.h"
#include "log.h"
#include "main-func.h"
#include "pretty-print.h"

View File

@ -4,6 +4,7 @@
#include "analyze-compare-versions.h"
#include "compare-operator.h"
#include "log.h"
#include "macro.h"
#include "string-util.h"
#include "strv.h"

View File

@ -6,7 +6,6 @@
#include "alloc-util.h"
#include "macro.h"
#include "memory-util.h"
void* memdup(const void *p, size_t l) {
void *ret;

View File

@ -8,6 +8,7 @@
#include <string.h>
#include "macro.h"
#include "memory-util.h"
#if HAS_FEATURE_MEMORY_SANITIZER
# include <sanitizer/msan_interface.h>
@ -266,5 +267,3 @@ _alloc_(2) static inline void *realloc0(void *p, size_t new_size) {
return q;
}
#include "memory-util.h"

View File

@ -8,6 +8,7 @@
#include "argv-util.h"
#include "capability-util.h"
#include "errno-util.h"
#include "log.h"
#include "missing_sched.h"
#include "parse-util.h"
#include "path-util.h"

View File

@ -6,6 +6,7 @@
#include "ansi-color.h"
#include "build.h"
#include "extract-word.h"
#include "log.h"
#include "macro.h"
#include "string-util.h"
#include "terminal-util.h"

View File

@ -8,6 +8,7 @@
#include "capability-util.h"
#include "cap-list.h"
#include "extract-word.h"
#include "log.h"
#include "macro.h"
#include "parse-util.h"
#include "stdio-util.h"

View File

@ -20,6 +20,7 @@
#include "macro.h"
#include "parse-util.h"
#include "pidref.h"
#include "process-util.h"
#include "stat-util.h"
#include "user-util.h"

View File

@ -10,6 +10,7 @@
#include "errno-util.h"
#include "fd-util.h"
#include "fs-util.h"
#include "log.h"
#include "macro.h"
#include "string-util.h"

View File

@ -27,6 +27,7 @@
#include "fd-util.h"
#include "fileio.h"
#include "io-util.h"
#include "log.h"
#include "macro.h"
#include "sparse-endian.h"
#include "string-table.h"

View File

@ -14,6 +14,7 @@
#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
#include "string-table.h"
#include "utf8.h"

View File

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dlfcn-util.h"
#include "log.h"
static int dlsym_many_or_warnv(void *dl, int log_level, va_list ap) {
void (**fn)(void);

View File

@ -15,6 +15,7 @@
#include "fd-util.h"
#include "fileio.h"
#include "io-util.h"
#include "log.h"
#include "macro.h"
#include "memory-util.h"
#include "missing_fs.h"

View File

@ -7,6 +7,7 @@
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "log.h"
#include "string-util.h"
#include "strv.h"
#include "tmpfile-util.h"

View File

@ -11,6 +11,7 @@
#include "errno-util.h"
#include "escape.h"
#include "extract-word.h"
#include "log.h"
#include "macro.h"
#include "parse-util.h"
#include "path-util.h"

View File

@ -8,6 +8,7 @@
#include "ether-addr-util.h"
#include "hexdecoct.h"
#include "log.h"
#include "macro.h"
#include "string-util.h"

View File

@ -15,6 +15,7 @@
#include "fileio.h"
#include "fs-util.h"
#include "io-util.h"
#include "log.h"
#include "macro.h"
#include "missing_fcntl.h"
#include "missing_fs.h"

View File

@ -1,6 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "format-ifname.h"
#include "log.h"
#include "stdio-util.h"
#include "string-util.h"
assert_cc(STRLEN("%") + DECIMAL_STR_MAX(int) <= IF_NAMESIZE);

View File

@ -4,6 +4,7 @@
#include "gcrypt-util.h"
#include "hexdecoct.h"
#include "log.h"
static void *gcrypt_dl = NULL;

View File

@ -8,6 +8,7 @@
#include "dirent-util.h"
#include "errno-util.h"
#include "glob-util.h"
#include "log.h"
#include "macro.h"
#include "path-util.h"
#include "strv.h"

View File

@ -12,6 +12,7 @@
#include "alloc-util.h"
#include "fileio.h"
#include "hashmap.h"
#include "log.h"
#include "logarithm.h"
#include "macro.h"
#include "memory-util.h"

View File

@ -10,6 +10,7 @@
#include "alloc-util.h"
#include "env-file.h"
#include "hostname-util.h"
#include "log.h"
#include "os-util.h"
#include "string-util.h"
#include "strv.h"

View File

@ -5,6 +5,7 @@
#include "env-util.h"
#include "errno-util.h"
#include "initrd-util.h"
#include "log.h"
#include "parse-util.h"
#include "stat-util.h"
#include "string-util.h"

View File

@ -1,6 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "keyring-util.h"
#include "log.h"
#include "alloc-util.h"
#include "memory-util.h"
#include "missing_syscall.h"

View File

@ -5,6 +5,7 @@
#include "alloc-util.h"
#include "cgroup-util.h"
#include "limits-util.h"
#include "log.h"
#include "memory-util.h"
#include "parse-util.h"
#include "process-util.h"

Some files were not shown because too many files have changed in this diff Show More