Commit Graph
81163 Commits
Author SHA1 Message Date
Salim B e0a5e2d66b docs: fix typos 2025-05-07 00:49:49 +09:00
Daan De Meyer 1fbfbe81b5 tree-wide: Get rid of prefix_roota() in favor of path_join()
We deprecated prefix_roota() in favor of chase() and path_join().
Let's finish the removal by replacing the few remaining call sites
with path_join().
2025-05-06 17:40:33 +02:00
Daan De Meyer 38c9ca5380 tree-wide: Remove strv_from_stdarg_alloca()
It's trivial to replace all uses of this function with STRV_MAKE()
and strv_new_ap() so let's get rid of this variant.
2025-05-06 17:40:01 +02:00
Mike Yuan c0239e5f11 macro: implement ABS via __builtin_imaxabs() 2025-05-06 17:39:01 +02:00
Lennart Poettering e9f9ddbfa8 boot: make console_key_read() return param optional
Inspired by #36684
2025-05-06 17:38:25 +02:00
Daan De Meyer efc529cfbd Add missing alloc-util.h to string-util.h
Used by strndupa_safe() and strdupa_safe().

Follow up for 02207b54d5
2025-05-06 17:38:11 +02:00
Daan De Meyer 02207b54d5 alloc-util: Move strdupa_safe() and strndupa_safe() to string-util.h 2025-05-06 15:42:01 +02:00
Daan De Meyer e4a08721c3 string-util: Remove utf8.h and alloc-util.h includes 2025-05-06 13:27:54 +02:00
Yu Watanabe 8d7f05abc8 cleanup: bugprone argument issues (#37346)
Follow up from https://github.com/systemd/systemd/pull/37281
2025-05-06 18:56:07 +09:00
Daan De Meyer 0682853b2f Various preparatory changes from #37344 (#37348) 2025-05-06 11:23:15 +02:00
Daan De Meyer c09ce222b6 hashmap: Drop debug params
Passing in the func, file and line information complicates the
interface. On top of that, it prevents forward declaring Hashmap in
strv.h, as we need to pass the macros everywhere that we allocate a
hashmap, which means we have to include the hashmap header everywhere
we have a function that allocates a hashmap instead of just having to
forward declare Hashmap.

Let's drop the file, func and line information from the debug information.
Instead, in the future we can add a description field to hashmaps like we
already have in various other structs to describe the purpose of the hashmap
which should be much more useful than having the file, line and function where
the hashmap was allocated.
2025-05-06 10:14:26 +02:00
Daan De Meyer 40a6cdc29e macro: Introduce ABS() macro and use it in header files
abs() requires including the entirety of stdlib.h just for a single
trivial function. Let's introduce the ABS() macro and use it in header
files instead so we can get rid of stdlib.h transitive includes in header
files in a later commit.
2025-05-06 10:14:26 +02:00
Daan De Meyer c94f6ab1bf string-table: Move more implementation logic into functions
Let's move some more implementation logic into functions. We keep
the logic that requires the macro in the macro and move the rest into
functions.

While we're at it, let's also make the parameter declarations of
all the string table macros less clausthrophobic.
2025-05-06 10:14:24 +02:00
Daan De Meyer 76d62b63ef main-func: Reduce transitive includes
Let's move some logic from _DEFINE_MAIN_FUNCTION() and other places
in main-func.h into functions that we implement in main-func.c to
allow moving some included headers from the header to the .c file.
2025-05-06 10:07:27 +02:00
Jelle van der Waa 3ce45cd3ac shared: fix leftover bool value from flags conversion
Follow-up for 5c48335ef4
2025-05-06 09:31:50 +02:00
Yu Watanabe d3059d48ee hibernate-resume: automatically decrypt dissected swap (#37335)
Closes https://github.com/systemd/systemd/issues/27247
(https://github.com/systemd/systemd/pull/35328,
https://github.com/systemd/systemd/issues/37330)
2025-05-06 13:00:24 +09:00
Yu Watanabe 2482bd49c3 network,udev: several improvements for logging (#37337)
No functional changes. Continuation of #37269.
2025-05-06 12:43:15 +09:00
Yu Watanabe a3a98a3793 prioq: coding style fixes 2025-05-05 22:53:01 +02:00
Jelle van der Waa 4b779c874c shared: rename type to fstype
Follow the argument comment naming already used.
2025-05-05 21:34:31 +02:00
Jelle van der Waa 60f6d70a29 network: correct argument comments 2025-05-05 19:47:49 +02:00
Jelle van der Waa 5cdec544c7 libsystemd-network: fix typo in argument comment 2025-05-05 19:38:18 +02:00
Mike Yuan 656a7bb1fb hibernate-resume: automatically decrypt dissected swap if told so via autoSwap
With the addition of /dev/disk/by-designator/ along with
ID_DISSECT_PART_DESIGNATOR attr, it is now trivial to tell
whether the swap device we hibernated into is the "auto" one.
Hence use that bit of info and generate cryptsetup unit
in hibernate-resume-generator if that's the case.

Ideally, gpt-auto should really just handle swap already
in initrd, which would save us a myriad of trouble and
the system behaves more consistently. But I don't see that
happening anytime soon. This is the second best option
we have I reckon.

Closes #27247 (#35328, #37330)
2025-05-05 19:37:11 +02:00
Mike Yuan a88ee2c8df sleep: record whether the hibernation device is auto swap (with "swap" designator) 2025-05-05 19:37:10 +02:00
Jelle van der Waa 866a662abe treewide: correct argument comments for sd_notifyf 2025-05-05 19:35:39 +02:00
Jelle van der Waa ff259047d5 shared: fix typo in read_etc_hostname definition 2025-05-05 19:32:52 +02:00
Jelle van der Waa 160159a709 resolve: update argument comments 2025-05-05 19:32:23 +02:00
Mike Yuan 60997a87ef blockdev-util: don't use mixed style of retval in block_device_get_originating
We have two typical styles of 'ret' param assignment + retval:

1) < 0 on actual error, 0 on nothing (ret == NULL), > 0 on something
2) recognizable errno on nothing, < 0 on other errors, >= 0 on something

but never use both at the same time.
2025-05-05 18:39:05 +02:00
Mike Yuan ab2f5407a0 core/cgroup: block_get_originating() doesn't return > 0
Follow-up for 612fc70fc0
2025-05-05 18:39:05 +02:00
Debarshi Ray ab46feb3e2 meson: Ensure that distribution packages own systemenvgeneratordir
Currently, Fedora's systemd RPM doesn't own systemenvgeneratordir
(ie., /usr/lib/systemd/system-environment-generators) [1] because it's
not created when systemd is installed.  In contrast, userenvgeneratordir
(ie., /usr/lib/systemd/user-environment-generators) is created, unless
the environment-d Meson option is explicitly disabled.

While this can be worked around elsewhere, it's better if the upstream
build system created the directories consistently.  It will avoid
repetition, and prevent silly bugs or deviations from creeping in.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2284085
2025-05-06 00:12:02 +09:00
Daan De Meyer b75c6c3c3f meson: Make sure check-filesystems.sh runs from the build directory
run_command()'s working directory is documented as undefined but it
seems to be the current source directory as when the -ftime-trace
clang option is enabled, -.json is written to src/basic/meson.build
every time meson is run.

Let's make sure the command is executed in the build directory so that
any auxiliary files are written there as well.
2025-05-05 17:09:18 +02:00
Mike Yuan 0777e64ea2 units: two tweaks for socket units (#37309) 2025-05-05 15:13:00 +02:00
Yu Watanabe 11c5eff1cb udev/net: update log message 2025-05-05 22:07:04 +09:00
Yu Watanabe f4282e6a06 udev/net: mention which SR-IOV setting could not be applied in log message 2025-05-05 22:07:04 +09:00
Yu Watanabe fed4da3a19 network/sriov: mention which setting could not be applied in log message 2025-05-05 22:07:04 +09:00
Yu Watanabe d28746ef55 network: make log_link_message_full_errno() take format string 2025-05-05 22:07:04 +09:00
Yu Watanabe 3d026764f1 network/nexthop: split out nexthop_to_string() 2025-05-05 22:07:00 +09:00
Yu Watanabe c6f53cde20 network/route: split out route_to_string() from log_route_debug() 2025-05-05 22:06:19 +09:00
madroach a2bd93c2e8 hwdb: add HP 150 Wired Mouse (#37341) 2025-05-05 21:34:33 +09:00
Alexander Stepchenko 0cf03a36f2 man/systemctl: add preposition for clarity 2025-05-05 13:01:05 +02:00
Tim Small a50fa2a40f man/network: Note .link early boot caveat, and .network .netdev usage.
Document .link .network and .netdev file type distinctions in early
introductory text, and document distro-specific need to sync link files
with early-boot copies, see Debian bug 1005282:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005282 for an
example.
2025-05-04 12:27:50 +09:00
Yu Watanabe a6619f9678 Vmspawn fixes (#37320)
Fixes
https://github.com/systemd/systemd/pull/36618#issuecomment-2844694845

and 

```
qemu-kvm: -device vmgenid,guid=5f303a47-6fae-4dd7-969c-6c1ea61e816e: 'vmgenid' is not a valid device model name
```
2025-05-04 12:24:04 +09:00
Mike Yuan bad578b145 core: rename core-varlink -> varlink
To make things consistent with dbus.[ch]
2025-05-04 12:22:38 +09:00
Daan De Meyer 5e6dd20a6e Various changes to prepare for running IWYU on the repository (#37319)
These are various commits that were required to get things compiling
after running IWYU. I think all of them make sense on their own, hence
this split PR to merge them ahead of time.
2025-05-02 13:41:31 +02:00
Arian van Putten 10819eb0d5 vmspawn: fix grow_image: Assertion `path' failed.
arg_image might be NULL (e.g. when booting a USI, or when passing -D)
2025-05-02 11:05:06 +02:00
Arian van Putten f17247c701 vmspawn: don't use vmgenid on aarch64 as it's not supported
fixes:

```
qemu-kvm: -device vmgenid,guid=5f303a47-6fae-4dd7-969c-6c1ea61e816e: 'vmgenid' is not a valid device model name
```
2025-05-02 11:05:06 +02:00
Daan De Meyer 7e674d22d3 test: Remove unused sources from tests 2025-05-02 09:41:43 +02:00
Daan De Meyer a0233fcd86 socket-util: Replace sockaddr length macros with functions
There's no need for these to be macros, let's just make them regular
functions instead.
2025-05-02 09:41:41 +02:00
Daan De Meyer 256c4203f9 networkd-network-gperf.gperf: Add various missing includes
We currently include these transitively but to allow using IWYU to
remove headers later, let's add these as direct includes so the IWYU
changes don't break compilation.
2025-05-01 16:58:12 +02:00
Daan De Meyer 95f87834f5 shared: Make sure ip-protocol-xxx.h headers include <netinet/in.h>
These headers use macros from <netinet/in.h> so let's make sure they
include the header.
2025-05-01 16:58:10 +02:00
Daan De Meyer 228e93c5c5 shared: Add blkid-util.c
IWYU analyzes source files and their corresponding header file so
let's add a source file blkid-util.c so blkid-util.h is analyzed as
well.
2025-05-01 14:02:17 +02:00