]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
12 months agotimer: add unit tests for DeferReactivation 34591/head
Matteo Croce [Fri, 4 Oct 2024 23:39:37 +0000 (01:39 +0200)] 
timer: add unit tests for DeferReactivation

Create a unit test for systemd timer DeferReactivation config option.
The test works by creating a timer which fires every 5 seconds and
starts an unit which runs for 5 seconds.
With DeferReactivation=true, the timer must fire every 5+5 seconds,
instead of the 5 it fires normally.

As we need at least two timer runs to check if the delta is correct,
the test duration on success will be at least 20 seconds.
To be safe, the test script waits 35 seconds: this is enough to get
at least three runs but low enough to avoid clogging the CI.

12 months agotimer: introduce DeferReactivation setting
Arthur Shau [Thu, 14 Mar 2024 19:43:13 +0000 (12:43 -0700)] 
timer: introduce DeferReactivation setting

By default, in instances where timers are running on a realtime schedule,
if a service takes longer to run than the interval of a timer, the
service will immediately start again when the previous invocation finishes.
This is caused by the fact that the next elapse is calculated based on
the last trigger time, which, combined with the fact that the interval
is shorter than the runtime of the service, causes that elapse to be in
the past, which in turn means the timer will trigger as soon as the
service finishes running.

This behavior can be changed by enabling the new DeferReactivation setting,
which will cause the next calendar elapse to be calculated based on when
the trigger unit enters inactivity, rather than the last trigger time.

Thus, if a timer is on an realtime interval, the trigger will always
adhere to that specified interval.
E.g. if you have a timer that runs on a minutely interval, the setting
guarantees that triggers will happen at *:*:00 times, whereas by default
this may skew depending on how long the service runs.

Co-authored-by: Matteo Croce <teknoraver@meta.com>
12 months agoMerge pull request #34700 from yuwata/network-conf-parser
Yu Watanabe [Fri, 11 Oct 2024 20:22:11 +0000 (05:22 +0900)] 
Merge pull request #34700 from yuwata/network-conf-parser

network: several cleanups for conf parsers

12 months agoreport bpf_current_task_under_cgroup() errors to userspace
Matteo Croce [Fri, 11 Oct 2024 16:26:58 +0000 (18:26 +0200)] 
report bpf_current_task_under_cgroup() errors to userspace

bpf_current_task_under_cgroup() returns 1 if the task is under the
specified cgroup, 0 if not, negative if an error happens.

Differentiate the 1 and -1 cases, and report to userspace when we got
and error.
An error like this is mostly unlikely, the only common one is that the
userspace doesn't populate the map, and the call returns -EAGAIN.

Tested by mocking the return value of bpf_current_task_under_cgroup():
    Enumeration completed
    enp1s0f0np0: Configuring with /etc/systemd/network/20-test.network.
    Sysctl monitor BPF returned error: Link number out of range
    Sysctl monitor BPF returned error: No CSI structure available
    Sysctl monitor BPF returned error: Invalid exchange
    Sysctl monitor BPF returned error: Exchange full
    Sysctl monitor BPF returned error: Invalid request code
    Sysctl monitor BPF returned error: Unknown error 58
    Sysctl monitor BPF returned error: Device not a stream
    Sysctl monitor BPF returned error: Timer expired
    Sysctl monitor BPF returned error: Machine is not on the network
    Sysctl monitor BPF returned error: Object is remote
    Sysctl monitor BPF returned error: Advertise error

12 months agoMerge pull request #34720 from YHNdnzj/extra-fds-followup
Yu Watanabe [Fri, 11 Oct 2024 19:46:51 +0000 (04:46 +0900)] 
Merge pull request #34720 from YHNdnzj/extra-fds-followup

core: several follow-ups for ExtraFileDescriptors

12 months agosystemd-update-helper: Show executed commands if debug logging is enabled
Daan De Meyer [Fri, 11 Oct 2024 14:51:04 +0000 (16:51 +0200)] 
systemd-update-helper: Show executed commands if debug logging is enabled

12 months agonetwork/route: use log_section_warning() more 34700/head
Yu Watanabe [Sun, 22 Sep 2024 21:34:02 +0000 (06:34 +0900)] 
network/route: use log_section_warning() more

12 months agonetwork/route: use generic [Route] section parser more
Yu Watanabe [Sun, 22 Sep 2024 21:20:05 +0000 (06:20 +0900)] 
network/route: use generic [Route] section parser more

12 months agonetwork/route: use log_syntax_parse_error() more
Yu Watanabe [Sun, 22 Sep 2024 20:51:37 +0000 (05:51 +0900)] 
network/route: use log_syntax_parse_error() more

12 months agonetwork/route-nexthop: use generic [Route] section parser more
Yu Watanabe [Sun, 22 Sep 2024 20:43:22 +0000 (05:43 +0900)] 
network/route-nexthop: use generic [Route] section parser more

12 months agonetwork/route-nexthop: use log_syntax_parse_error()
Yu Watanabe [Sun, 22 Sep 2024 20:40:55 +0000 (05:40 +0900)] 
network/route-nexthop: use log_syntax_parse_error()

12 months agonetwork/route-metric: merge conf parsers for route metric
Yu Watanabe [Sun, 22 Sep 2024 19:09:33 +0000 (04:09 +0900)] 
network/route-metric: merge conf parsers for route metric

This introduces a generic [Route] section parser, then embed conf
parsers for route metric into it.

12 months agonetwork/route-metric: use log_syntax_parse_error()
Yu Watanabe [Sun, 22 Sep 2024 19:13:51 +0000 (04:13 +0900)] 
network/route-metric: use log_syntax_parse_error()

12 months agonetwork/address: several cleanups for config_parse_address()
Yu Watanabe [Sun, 22 Sep 2024 18:36:15 +0000 (03:36 +0900)] 
network/address: several cleanups for config_parse_address()

- make it accept an empty string,
- use config_parse_in_addr_prefix(),
- move null address checker to address_section_verify().

No functional change, just refactoring.

12 months agonetwork/address: warn but ignore Broadcast= setting for an IPv6 address
Yu Watanabe [Sun, 22 Sep 2024 18:30:32 +0000 (03:30 +0900)] 
network/address: warn but ignore Broadcast= setting for an IPv6 address

Previously, the below was refused and the IPv6 address would not assigned.
===
[Address]
Address=2001:db8:0:f101::15/64
Broadcast=192.168.0.255
===
However, in the following case, networkd warned about the broadcast
address would be ignored, and the IPv6 address would be configured.
===
[Address]
Broadcast=192.168.0.255
Address=2001:db8:0:f101::15/64
===

12 months agonetwork/address: use log_section_warning() more
Yu Watanabe [Sun, 22 Sep 2024 18:28:19 +0000 (03:28 +0900)] 
network/address: use log_section_warning() more

12 months agonetwork/routing-policy-rule: use in_addr_prefix for From= and To=
Yu Watanabe [Sun, 22 Sep 2024 16:51:43 +0000 (01:51 +0900)] 
network/routing-policy-rule: use in_addr_prefix for From= and To=

Also, this makes the settings parsed independently, and the
inconsistency will be checked in the section verifier.

No functional change, just refactoring.

12 months agoconf-parser: introduce config_parse_in_addr_prefix()
Yu Watanabe [Sun, 22 Sep 2024 16:50:44 +0000 (01:50 +0900)] 
conf-parser: introduce config_parse_in_addr_prefix()

It is not used currently, but will be used later.

12 months agoin-addr-util: rename in_addr_prefix_from_string_auto_internal() -> _full()
Yu Watanabe [Fri, 11 Oct 2024 18:23:04 +0000 (03:23 +0900)] 
in-addr-util: rename in_addr_prefix_from_string_auto_internal() -> _full()

The function is also used in other source files. Hence, not internal.
No functional change, just refactoring.

12 months agohwdb: fix key toggle touchpad and programmable buttom for Positivo V142N (#34725)
Lucas Adriano Salles [Fri, 11 Oct 2024 16:58:14 +0000 (12:58 -0400)] 
hwdb: fix key toggle touchpad and programmable buttom for Positivo V142N (#34725)

12 months agocore/service: add missing serialization for extra fds 34720/head
Mike Yuan [Tue, 8 Oct 2024 13:48:49 +0000 (15:48 +0200)] 
core/service: add missing serialization for extra fds

12 months agocore/service: use array rather than list for extra fds, limit max number
Mike Yuan [Tue, 8 Oct 2024 12:53:14 +0000 (14:53 +0200)] 
core/service: use array rather than list for extra fds, limit max number

Follow-up for 3543456f84ec2e83e07b6c9bf2b3a1c5d30241d8

I don't think list is particularly useful here. The passed fds are
constant for the lifetime of service, and with this commit we track
the number of extra fds in a dedicated var anyway.

12 months agocore/service: use LIST_HEAD where appropriate
Mike Yuan [Tue, 8 Oct 2024 13:05:03 +0000 (15:05 +0200)] 
core/service: use LIST_HEAD where appropriate

12 months agotime-util: use saturate_add for usec_add()
Mike Yuan [Sun, 15 Sep 2024 13:04:04 +0000 (15:04 +0200)] 
time-util: use saturate_add for usec_add()

12 months agoMerge pull request #34717 from anonymix007/fundamental-boot-changes
Lennart Poettering [Fri, 11 Oct 2024 15:55:06 +0000 (17:55 +0200)] 
Merge pull request #34717 from anonymix007/fundamental-boot-changes

Fundamental and boot changes for multi-dt UKIs

12 months agoshared/bus-util: re-break comment, insert missing newline before case
Mike Yuan [Fri, 11 Oct 2024 13:29:00 +0000 (15:29 +0200)] 
shared/bus-util: re-break comment, insert missing newline before case

Follow-up for a178ffdfcd9d25886a6e563a0fbd9929852e85c4

12 months agoMerge pull request #34686 from DaanDeMeyer/bus-fallback
Daan De Meyer [Fri, 11 Oct 2024 13:16:54 +0000 (15:16 +0200)] 
Merge pull request #34686 from DaanDeMeyer/bus-fallback

Make sure bus_connect_transport_systemd() actually connects to the private manager bus

12 months agofundamental: Add EFI_GUID userspace definition 34717/head
anonymix007 [Thu, 10 Oct 2024 15:35:30 +0000 (18:35 +0300)] 
fundamental: Add EFI_GUID userspace definition

12 months agoboot: Add log_info and log_debug
anonymix007 [Wed, 11 Sep 2024 21:26:34 +0000 (00:26 +0300)] 
boot: Add log_info and log_debug

12 months agoboot: Add smbios_populate_raw_info
anonymix007 [Sat, 31 Aug 2024 18:38:21 +0000 (21:38 +0300)] 
boot: Add smbios_populate_raw_info

This function will be used to gather information for DeviceTree matching

12 months agoboot: Move smbios-related functions to a separate file
anonymix007 [Wed, 11 Sep 2024 12:18:05 +0000 (15:18 +0300)] 
boot: Move smbios-related functions to a separate file

12 months agoboot: Add xcalloc and xcalloc_multiply
anonymix007 [Sat, 31 Aug 2024 18:34:56 +0000 (21:34 +0300)] 
boot: Add xcalloc and xcalloc_multiply

12 months agoboot: Add EFI_STATUS_IS_ERROR macro
anonymix007 [Sat, 31 Aug 2024 18:31:49 +0000 (21:31 +0300)] 
boot: Add EFI_STATUS_IS_ERROR macro

12 months agoboot: Add bswap_{16,32}
anonymix007 [Thu, 10 Oct 2024 15:23:42 +0000 (18:23 +0300)] 
boot: Add bswap_{16,32}

12 months agoboot: Add be32toh
anonymix007 [Thu, 10 Oct 2024 14:54:13 +0000 (17:54 +0300)] 
boot: Add be32toh

12 months agoMerge pull request #34718 from poettering/efi-smbios-tweak
Lennart Poettering [Fri, 11 Oct 2024 11:34:13 +0000 (13:34 +0200)] 
Merge pull request #34718 from poettering/efi-smbios-tweak

efi: minor tweaks to smbios parsing

12 months agoMerge pull request #34703 from poettering/pidref-varlink
Lennart Poettering [Fri, 11 Oct 2024 11:33:44 +0000 (13:33 +0200)] 
Merge pull request #34703 from poettering/pidref-varlink

Serialize "PidRef" in a reasonable way in Varlink interfaces

12 months agoMerge pull request #34681 from ikruglov/ikruglov/io-systemd-Machine-post-merge-review
Lennart Poettering [Fri, 11 Oct 2024 10:15:56 +0000 (12:15 +0200)] 
Merge pull request #34681 from ikruglov/ikruglov/io-systemd-Machine-post-merge-review

machine: address post-merge review #34623

12 months agoseccomp: allowlist uretprobe() syscall
Lennart Poettering [Fri, 11 Oct 2024 07:46:14 +0000 (09:46 +0200)] 
seccomp: allowlist uretprobe() syscall

This is a new syscall provided by the kernel used to implement faster
uprobes. It's not supposed to be called by userspace, but only by kernel
generated uprobe code.

It should be fine to allow this, as the kernel authenticates the
invocation itself, and we shouldn't break compat with things.

Note that this allowlisting is not sufficient to make ureprobe() work.
libseccomp must be tought the syscall too, but this can happen
independently.

Fixes: #34615
12 months agosmbios: make code more readable by introducing a "limit" pointer 34718/head
Lennart Poettering [Fri, 11 Oct 2024 09:13:27 +0000 (11:13 +0200)] 
smbios: make code more readable by introducing a "limit" pointer

12 months agosmbios: move validation of SMBIOS table sizes fully into get_smbios_table()
Lennart Poettering [Fri, 11 Oct 2024 09:11:50 +0000 (11:11 +0200)] 
smbios: move validation of SMBIOS table sizes fully into get_smbios_table()

We do half a validation currently ourselves (i.e. check the header fits
into the rest of the data), and leave the other half to the
caller (i.e. check the table fits into the rest of the data).

get_smbios_table() is changed to accept the minimum object size and
validates it before returning a table.

Based on a discussion with @anonymix007.

12 months agostdio-bridge: Use customized log message for forwarding bus 34686/head
Daan De Meyer [Thu, 10 Oct 2024 13:54:57 +0000 (15:54 +0200)] 
stdio-bridge: Use customized log message for forwarding bus

Let's more clearly indicate that we failed to set up the server
which forwards messages from the remote client to the local bus
instead of logging a generic bus client message.

12 months agostdio-bridge: Use bus_log_connect_error()
Daan De Meyer [Thu, 10 Oct 2024 13:54:37 +0000 (15:54 +0200)] 
stdio-bridge: Use bus_log_connect_error()

12 months agobus-util: Move geteuid() check out of bus_connect_system_systemd()
Daan De Meyer [Wed, 9 Oct 2024 10:10:44 +0000 (12:10 +0200)] 
bus-util: Move geteuid() check out of bus_connect_system_systemd()

Let's move this check to bus_connect_transport_systemd() so that
bus_connect_system_systemd() will only ever connect to the manager
private manager bus instance and fail otherwise.

12 months agobus-util: Drop fallback to system/user bus if manager bus doesn't work
Daan De Meyer [Wed, 9 Oct 2024 09:44:34 +0000 (11:44 +0200)] 
bus-util: Drop fallback to system/user bus if manager bus doesn't work

We have various callsites that explicitly need the manager bus and
won't work with the system bus, like daemon-reexec and friends which
can't properly wait until the operation has finished unless using the
manager bus.

If we silently fall back to the system bus for these operations, we
can end up with rather hard to debug issues so let's remove the fallback
as it was added back in 2013 in a6aa89122d2fa5e811a72200773068c13bfffea2
without a clear explanation of why it was needed (I expect as a fallback
if kdbus wasn't available but that's not a thing anymore these days).

12 months agoupdate-utmp: Make reconnect logic more robust
Daan De Meyer [Wed, 9 Oct 2024 14:37:06 +0000 (16:37 +0200)] 
update-utmp: Make reconnect logic more robust

We might also fail to connect to the private manager bus itself if
the daemon-reexec is still ongoing, so let's handle that as well by
retrying on ECONNREFUSED.

12 months agomkosi: Fix up ownership of testuser home directory on first boot
Daan De Meyer [Wed, 9 Oct 2024 12:49:07 +0000 (14:49 +0200)] 
mkosi: Fix up ownership of testuser home directory on first boot

When building unprivileged, the testuser home directory ends up
owned by root:root because mkosi can't chown directories to other
owners when running unprivileged. So let's fix up the testuser
ownership on first boot with tmpfiles instead.

12 months agoMerge pull request #34707 from YHNdnzj/user-manager-reexec
Daan De Meyer [Fri, 11 Oct 2024 09:34:24 +0000 (11:34 +0200)] 
Merge pull request #34707 from YHNdnzj/user-manager-reexec

core: fix STATUS=Ready for user manager; units/user@.service: issue daemon-reexec when notify-reloading

12 months agomachined: also take new ProcessId structure when registering processes 34703/head
Lennart Poettering [Wed, 9 Oct 2024 20:03:51 +0000 (22:03 +0200)] 
machined: also take new ProcessId structure when registering processes

12 months agomachined: make List() varlink method return a full pidref JSON object for leader
Lennart Poettering [Wed, 9 Oct 2024 15:49:43 +0000 (17:49 +0200)] 
machined: make List() varlink method return a full pidref JSON object for leader

This new call has not been released yet, hence we can still change the
encoding of the "leader" field.

12 months agojson: add builder/dispatcher for PidRef → JSON and back
Lennart Poettering [Wed, 9 Oct 2024 15:48:29 +0000 (17:48 +0200)] 
json: add builder/dispatcher for PidRef → JSON and back

So far, at the one place we sent a PID over Varlink we did so as a
simple numeric pid_t value. That's of course is racy, since classic PIDs
are recycled too eagerly.

Let's address that, by passing around JSON objects distantly resembling our
PidRef structure. Note that this JSON object does *not* contain the
pidfd, however, but just the pidfd inode number if known.

I originally planned to include the pidfd in some direct form, but I
figured that's not really the best idea, since we always need a
side-channel of some form for that (i.e. AF_UNIX/SCM_RIGHTS), but we
should be able to report about PIDs even without that.

Moreover, while sending the pid number and pidfd id around should always
be OK to do, it's a lot more problematic to always send a pidfd around,
since that implies that fd passing is on and it is OK to install fds
remotely in some IPC peers fd table. For example, when doing a wild dump
of service manager service state we really shouldn't end up with a bunch
of fds installed in our client's fd table.

Hence, all in all I think it is cleaner to define a structure carrying
pid number and pidfd inode id, wich is passed directly as JSON. And then
optionally, in a separate field also pass around a pidfd where it makes
sense.

Note that sending around pidfds is not that beneficial anymore if we
have the pidfd inode id, because we can always securely and reliably get
a pidfd back from a pair of pid + inode id: first we do pidfd_open() on
the pid, and then we check if it is really the right one by comparing
.st_ino after fstat().

This logic is implemented gracefully: if for some reason pidfd/pidfd
inode nrs are not available (too old kernel), we'll fall back to plain
PID numbers.

The dispatching logic knows two distinct levels of validation of the
provided PID data: if SD_JSON_STRICT is specified we'll acquire a pidfd
for the PID, thus verifying it currently exists and failing if it
doesn't. If the flag is not set, well just store the provided info
as-is, will try to acquire a pidfd for it, but not fail if we cannot.
Both modes are important in different contexts.

Also note that in addition to the pidfd inode nr we always store the
current boot ID of the system in the JSON object, since only the
combination of pidfd inode nr and boot ID of the system really is a
world-wide unique reference to a process.

When dispatching a JSON pid field we operate somewhat gracefully: we
either support the triplet structure of pid, pid inode nr, boot id, or
we accept a simple classic UNIX pid.

12 months agovarlink-idl: introduce c/.h file for common varlink IDL structures
Lennart Poettering [Thu, 10 Oct 2024 08:33:50 +0000 (10:33 +0200)] 
varlink-idl: introduce c/.h file for common varlink IDL structures

Some structures we'll use in various varlink interfaces, move them to a
common .c/.h file. For now this is only the dual timestamp object, but
there will be more soon.

12 months agomacro: add voffsetof() helper, that operates like offsetof() but on variables
Lennart Poettering [Wed, 9 Oct 2024 16:00:31 +0000 (18:00 +0200)] 
macro: add voffsetof() helper, that operates like offsetof() but on variables

12 months agotest: also dump varlink IDL for Machine interface in the test
Lennart Poettering [Wed, 9 Oct 2024 19:51:02 +0000 (21:51 +0200)] 
test: also dump varlink IDL for Machine interface in the test

12 months agomeson: sort includes
Lennart Poettering [Thu, 10 Oct 2024 09:49:47 +0000 (11:49 +0200)] 
meson: sort includes

12 months agorpm/systemd-update-helper: Use systemctl reload to reexec/reload user managers 34707/head
Daan De Meyer [Thu, 10 Oct 2024 20:37:39 +0000 (22:37 +0200)] 
rpm/systemd-update-helper: Use systemctl reload to reexec/reload user managers

Let's always use systemctl reload to reexec and reload user managers
now that it always implies a reexec. This moves all the job management
logic to pid 1 instead of bash and reduces the complexity of the logic
as we remove systemd-run, pam and systemd-stdio-bridge from the equation.

12 months agounits/{user,capsule}@.service: issue daemon-reexec when notify-reloading
Mike Yuan [Thu, 10 Oct 2024 19:32:17 +0000 (21:32 +0200)] 
units/{user,capsule}@.service: issue daemon-reexec when notify-reloading

Closes #28367 (but not really in the exact form, see below)

We have the problem of restarting all user manager instances
after upgrade. Current approaches involve systemctl kill
with SIGRTMIN+25, which is async and feels rather ugly [1][2];
or systemctl --machine=user@ --user, which requires entering
each user session. Neither is particularly elegant.
Instead, let's just signal daemon-reexec when user@.service
is reloaded from system manager. Our long goal of dropping
daemon-reload in favor of reexec (see TODO) is unlikely to happen
due to user dbus restrictions, but here the synchronization
is done via READY=1.

[1] https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/blob/main/systemd.install?ref_type=heads#L37
[2] https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/systemd.postinst#L24

#28367 would not really work for us now I come to think about it,
because all processes will be reparented to pid1 as soon as
original user manager process exits. This alternative approach
seems good enough for our use case.

12 months agocore/manager-serialize: drop serialization for Manager.ready_sent
Mike Yuan [Thu, 10 Oct 2024 19:06:35 +0000 (21:06 +0200)] 
core/manager-serialize: drop serialization for Manager.ready_sent

This field indicates whether READY=1 has been sent to
the service manager/supervisor. Whenever we reload/reexec/soft-reboot,
manager_send_reloading() always resets it to false first,
so that READY=1 is sent after reloading finishes. Hence
we utterly get "false" at all times. Kill it.

12 months agocore/manager: still send out STATUS=Ready for user manager
Mike Yuan [Thu, 10 Oct 2024 19:16:05 +0000 (21:16 +0200)] 
core/manager: still send out STATUS=Ready for user manager

This effectively reverts 37d15cd132f3a8a0bf42fb252c1604e804171ff2.

The offending commit wrongly assumed that the second READY=1
notification is for system scope only, but it also serves the purpose
of flushing out previous STATUS= containing user unit job status.

12 months agoudev: allow persistent storage rules for ublk devices
Uday Shankar [Thu, 10 Oct 2024 20:29:10 +0000 (14:29 -0600)] 
udev: allow persistent storage rules for ublk devices

Tools such as lsblk which query the udev database instead of probing
devices directly fail when run on ublk devices. For instance, in the
following commands, the partition type is missing, despite the fact that
/dev/ublkb0 was just partitioned with a single Linux filesystem type
partition.

$ lsblk /dev/ublkb0
NAME       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
ublkb0     259:0    0 31.3G  0 disk
└─ublkb0p1 259:1    0 31.2G  0 part
$ lsblk -o pkname,parttype /dev/ublkb0
PKNAME PARTTYPE

ublkb0

This happens because ublk devices are missing from a couple of
whitelists in the udev rules which are responsible for populating the
database with the data lsblk is looking for. Add the ublk devices to
these whitelists.

12 months agodocs/DESKTOP_ENVIRONMENTS: fix formatting
David Rheinsberg [Fri, 11 Oct 2024 07:53:25 +0000 (09:53 +0200)] 
docs/DESKTOP_ENVIRONMENTS: fix formatting

The annotation about omittance is meant to be about the `RANDOM` string.
However, the current formatting makes it look like the entire naming
scheme is optional. Fix this.

12 months agodocs: don't mention split-usr path anymore
Lennart Poettering [Fri, 11 Oct 2024 07:55:07 +0000 (09:55 +0200)] 
docs: don't mention split-usr path anymore

We don't support split /usr/ anymore. Hence fix the paths. This
apparently matters because of PK validating the binary path.

Fixes: #34712
12 months agomkosi: fix sections for settings
Yu Watanabe [Thu, 10 Oct 2024 19:19:03 +0000 (04:19 +0900)] 
mkosi: fix sections for settings

Follow-up for 963157ca78429c51feb3103828d8cc94440956f3.

12 months agoMerge pull request #34699 from yuwata/netlink-cleanups
Yu Watanabe [Thu, 10 Oct 2024 19:30:16 +0000 (04:30 +0900)] 
Merge pull request #34699 from yuwata/netlink-cleanups

sd-netlink: several cleanups

12 months agosd-netlink: introduce two more _get_family() 34699/head
Yu Watanabe [Thu, 10 Oct 2024 05:45:11 +0000 (14:45 +0900)] 
sd-netlink: introduce two more _get_family()

Then, use them in sd_rtnl_message_get_family().

12 months agosd-netlink,network: rename functions and RoutingPolicyRule.type
Yu Watanabe [Thu, 10 Oct 2024 05:36:28 +0000 (14:36 +0900)] 
sd-netlink,network: rename functions and RoutingPolicyRule.type

To make them consistent to the netlink message header.
No functional change, just refactoring.

12 months agosd-netlink: introduce macros to define sd_rtnl_message setters and getters
Yu Watanabe [Thu, 10 Oct 2024 05:24:43 +0000 (14:24 +0900)] 
sd-netlink: introduce macros to define sd_rtnl_message setters and getters

12 months agosd-netlink: make size verifier in sd_netlink_message_read_xyz() stricter
Yu Watanabe [Thu, 10 Oct 2024 03:45:39 +0000 (12:45 +0900)] 
sd-netlink: make size verifier in sd_netlink_message_read_xyz() stricter

Also, fill remaining output buffer with zero, for safety.

12 months agosd-netlink: shorten sd_netlink_message_read_string_strdup() a bit
Yu Watanabe [Thu, 10 Oct 2024 03:43:57 +0000 (12:43 +0900)] 
sd-netlink: shorten sd_netlink_message_read_string_strdup() a bit

12 months agosd-netlink: various cleanups
Yu Watanabe [Thu, 10 Oct 2024 03:30:41 +0000 (12:30 +0900)] 
sd-netlink: various cleanups

- use uint8_t, uint16_t, and so on, rather than unsigned char, unsigned
  short, and so on, respectively,
- rename output parameters to ret or ret_xyz,
- add several missing assertions.

12 months agoman: reword comment a bit regarding ExecStartPre= multiple commands
Lennart Poettering [Mon, 7 Oct 2024 07:37:24 +0000 (09:37 +0200)] 
man: reword comment a bit regarding ExecStartPre= multiple commands

The documentation claimed that ExecStartPre=/ExecStartPost= accepts
multiple command lines, in contrast to ExecStart=. This is half an
untruth, because ExecStart= allows that too – as long as Type=oneshot is
set.

Hence, reword this a bit, and do not emphasize the contrast.

Prompted by: #34570

12 months agoukify: Fix systemd-measure detection in tests
Jörg Behrmann [Thu, 10 Oct 2024 11:52:31 +0000 (13:52 +0200)] 
ukify: Fix systemd-measure detection in tests

Fixes: 206fa93c854e3d5c94e56da9b53e107245f31503
12 months agomachine: use sd_json_dispatch_pid() in varlink code 34681/head
Ivan Kruglov [Thu, 10 Oct 2024 09:52:34 +0000 (11:52 +0200)] 
machine: use sd_json_dispatch_pid() in varlink code

12 months agosd-json: add sd_json_dispatch_pid()
Ivan Kruglov [Thu, 10 Oct 2024 09:35:30 +0000 (11:35 +0200)] 
sd-json: add sd_json_dispatch_pid()

12 months agomachine: switch to use PidRef when lookup machine by pid in dbus and varlink interfaces
Ivan Kruglov [Thu, 10 Oct 2024 09:51:57 +0000 (11:51 +0200)] 
machine: switch to use PidRef when lookup machine by pid in dbus and varlink interfaces

This commit includes adding introduce manager_get_machine_by_pidref() as a replacement for manager_get_machine_by_pid()
and moving surrounding code to utilise PidRef.

12 months agomachine: use sd_json_dispatch_signal() in varlink code
Ivan Kruglov [Wed, 9 Oct 2024 11:35:58 +0000 (13:35 +0200)] 
machine: use sd_json_dispatch_signal() in varlink code

12 months agosd-json: add sd_json_dispatch_signal()
Ivan Kruglov [Wed, 9 Oct 2024 11:35:14 +0000 (13:35 +0200)] 
sd-json: add sd_json_dispatch_signal()

12 months agomachine: remove redundant else if lookup_machine_by_name_or_pid()
Ivan Kruglov [Tue, 8 Oct 2024 16:55:39 +0000 (18:55 +0200)] 
machine: remove redundant else if lookup_machine_by_name_or_pid()

12 months agomachine: complete description of io.systemd.Machine.{List, Terminate, Kill, Unregiste...
Ivan Kruglov [Tue, 8 Oct 2024 16:50:47 +0000 (18:50 +0200)] 
machine: complete description of io.systemd.Machine.{List, Terminate, Kill, Unregister} methods

12 months agoMerge pull request #34684 from yuwata/login-scheduled-shutdown
Yu Watanabe [Thu, 10 Oct 2024 10:32:52 +0000 (19:32 +0900)] 
Merge pull request #34684 from yuwata/login-scheduled-shutdown

login: allow to cancel delayed action by CancelScheduledShutdown()

12 months agosd-event: rename output parameters to ret
Yu Watanabe [Thu, 10 Oct 2024 01:01:24 +0000 (10:01 +0900)] 
sd-event: rename output parameters to ret

12 months agomachined: use sd_json_dispatch_uint() when parsing CID
Lennart Poettering [Wed, 9 Oct 2024 20:02:10 +0000 (22:02 +0200)] 
machined: use sd_json_dispatch_uint() when parsing CID

This is preferable, because we will accept CIDs encoded as strings too
now, as we do for all other integers. Also, it's shorter. Yay!

12 months agoukify: fix return value type of resolve_at_path()
Yu Watanabe [Thu, 10 Oct 2024 00:33:47 +0000 (09:33 +0900)] 
ukify: fix return value type of resolve_at_path()

Follow-up for eca003de2f3a708c44946d36af6517cbcf3392ff.

12 months agonetwork/dhcp4: add support for ARPHRD_RAWIP and ARPHRD_NONE network interface types
Darsey Litzenberger [Wed, 9 Oct 2024 19:55:42 +0000 (13:55 -0600)] 
network/dhcp4: add support for ARPHRD_RAWIP and ARPHRD_NONE network interface types

This should fix QMI wwan modems, as noted in
https://github.com/systemd/systemd/issues/27219

12 months agorepart: fix typo
Yu Watanabe [Wed, 9 Oct 2024 20:30:08 +0000 (05:30 +0900)] 
repart: fix typo

Follow-up for d3032e651e2131c47d276e3fbdcbdf9fc51c8ef9.

12 months agocore/mount: fix typo
Yu Watanabe [Wed, 9 Oct 2024 20:29:05 +0000 (05:29 +0900)] 
core/mount: fix typo

Follow-up for 00ad3f02275b507a753495ace5e5f84cb38b604d.

12 months agoMerge pull request #34687 from DaanDeMeyer/mkosi
Yu Watanabe [Wed, 9 Oct 2024 20:26:14 +0000 (05:26 +0900)] 
Merge pull request #34687 from DaanDeMeyer/mkosi

Various fixes

12 months agostub: reindent lines
Yu Watanabe [Wed, 9 Oct 2024 17:29:11 +0000 (02:29 +0900)] 
stub: reindent lines

Follow-up for 2ea0487c1be4203ba3664d249418317846f55c1a.

12 months agomkosi: Fix sections for settings 34687/head
Daan De Meyer [Fri, 4 Oct 2024 12:22:35 +0000 (14:22 +0200)] 
mkosi: Fix sections for settings

Upstream we moved settings around a bit to different sections, let's
adapt to those changes in the systemd repo.

12 months agomkosi: Update to latest
Daan De Meyer [Fri, 4 Oct 2024 12:22:27 +0000 (14:22 +0200)] 
mkosi: Update to latest

12 months agomkosi: Remove particle profile
Daan De Meyer [Fri, 4 Oct 2024 12:09:48 +0000 (14:09 +0200)] 
mkosi: Remove particle profile

We have https://github.com/systemd/particleos for testing the particle
stuff so let's drop it from the systemd repo as it's bit rotting.

12 months agoefi-loader: Add @ to valid characters
Daan De Meyer [Sat, 5 Oct 2024 10:20:50 +0000 (12:20 +0200)] 
efi-loader: Add @ to valid characters

This is now a valid character with the introduction of multi UKI
profiles, so update the function to allow it.

12 months agoboot: Introduce file_size and use it when we're working with file_offset
Daan De Meyer [Fri, 4 Oct 2024 10:40:32 +0000 (12:40 +0200)] 
boot: Introduce file_size and use it when we're working with file_offset

When we're reading a section from disk, use file_size to use the
size on disk instead of the size in memory.

12 months agoboot: Rename pe section size to memory_size
Daan De Meyer [Fri, 4 Oct 2024 08:22:37 +0000 (10:22 +0200)] 
boot: Rename pe section size to memory_size

Let's clearly indicate this is the size in memory and not the size
on disk, these two are not guaranteed to be the same.

12 months agoukify: Read .profile from path starting with @
Daan De Meyer [Sat, 5 Oct 2024 15:01:21 +0000 (17:01 +0200)] 
ukify: Read .profile from path starting with @

12 months agoukify: Introduce resolve_at_path()
Daan De Meyer [Mon, 7 Oct 2024 09:29:40 +0000 (11:29 +0200)] 
ukify: Introduce resolve_at_path()

12 months agoMerge pull request #34665 from poettering/fastopen-fallback
Yu Watanabe [Wed, 9 Oct 2024 18:21:35 +0000 (03:21 +0900)] 
Merge pull request #34665 from poettering/fastopen-fallback

resolved: fix MSG_FASTOPEN fallback logic

12 months agoukify: Fix off by one error
Daan De Meyer [Sat, 5 Oct 2024 10:14:14 +0000 (12:14 +0200)] 
ukify: Fix off by one error

We weren't measuring the profile section itself.

12 months agoMerge pull request #34641 from behrmann/ukifystyle
Yu Watanabe [Wed, 9 Oct 2024 17:21:29 +0000 (02:21 +0900)] 
Merge pull request #34641 from behrmann/ukifystyle

Type annotate and format ukify

12 months agologind: add comment why we save action in execute_shutdown_or_sleep() 34684/head
Yu Watanabe [Wed, 9 Oct 2024 16:50:29 +0000 (01:50 +0900)] 
logind: add comment why we save action in execute_shutdown_or_sleep()

When I first read the code, I was confused about that. Hopefully, this
helps maintain code a bit.