Mike Yuan [Mon, 30 Sep 2024 19:21:53 +0000 (21:21 +0200)]
gpt-auto: use RET_GATHER at one more place
Mike Yuan [Sat, 28 Sep 2024 13:54:42 +0000 (15:54 +0200)]
core/manager: pass soft-reboot count to generators
soft-reboot allows switching into a different root/installation,
i.e. potentially invalidate settings from kernel cmdline and such.
Let's hence inform generators about soft-reboots.
Mike Yuan [Fri, 11 Oct 2024 15:57:06 +0000 (17:57 +0200)]
core/manager: minor cleanup for generator_path_any() and friends
Mike Yuan [Mon, 14 Oct 2024 16:13:35 +0000 (18:13 +0200)]
shared/exec-util: modernize execute_strv() and friends a bit
do_spawn() is also called during execute_strv(), so rename
"direxec" to "exec-inner".
Mike Yuan [Fri, 11 Oct 2024 15:53:34 +0000 (17:53 +0200)]
shared/exec-util: minor rearrangement, drop unused EXEC_DIR_NONE
Mike Yuan [Fri, 11 Oct 2024 16:04:17 +0000 (18:04 +0200)]
basic/stat-util: use xopenat() where appropriate
Yu Watanabe [Tue, 23 Apr 2024 04:15:49 +0000 (13:15 +0900)]
sd-radv: drop sd_radv_prefix and friends, and use sd_ndisc_option to manage NDisc options
No effective functional change, just refactoring.
Yu Watanabe [Mon, 14 Oct 2024 20:58:49 +0000 (05:58 +0900)]
Merge pull request #34738 from behrmann/ukifyoption
ukify: Add a config object
Yu Watanabe [Sat, 12 Oct 2024 20:15:18 +0000 (05:15 +0900)]
TEST-13-NSPAWN: add test for 'machinectl terminate'
This also fixes the test for io.systemd.Machine.Terminate.
When systemd-nspawn@.service receives stop signal, then systemd-nspawn
sends SIGRTMIN+3 to the container, which was previously ignored by the
custom init script used by the container.
Let's introduce another trap for the signal, and correctly handle it.
Follow-up for
164af66f9abdfd8935098d9f10c746ff29dea7df.
Yu Watanabe [Mon, 14 Oct 2024 20:58:03 +0000 (05:58 +0900)]
Merge pull request #34743 from yuwata/bus-message-dump-fd
bus-message-util: introduce bus_message_dump_fd() and _string()
Yu Watanabe [Mon, 14 Oct 2024 20:57:34 +0000 (05:57 +0900)]
Merge pull request #34745 from yuwata/local-outbounds-prefsrc
local-addresses: honor RTA_PREFSRC field of gateway
Gaël PORTAY [Mon, 14 Oct 2024 17:16:07 +0000 (19:16 +0200)]
docs: add a missing : character
This adds the missing colon character to the section systemd-sysusers.
Michiel [Mon, 14 Oct 2024 13:50:36 +0000 (15:50 +0200)]
Fix some typos in socket-util.h
Lennart Poettering [Mon, 14 Oct 2024 09:55:59 +0000 (11:55 +0200)]
man: document preference for secure_getenv() in coding style
Luca Boccassi [Mon, 14 Oct 2024 11:31:03 +0000 (12:31 +0100)]
Merge pull request #34749 from yuwata/network-address-parse-broadcast
network/address: fix parser for Broadcast=
Antonio Alvarez Feijoo [Mon, 14 Oct 2024 10:02:04 +0000 (12:02 +0200)]
updatectl: remove unimplemented option
Lennart Poettering [Mon, 14 Oct 2024 11:27:46 +0000 (13:27 +0200)]
Merge pull request #34623 from ikruglov/ikruglov/io-systemd-Machine-Image
machine: implement varlink interfaces io.systemd.MachineImage.{List, Update}
Lennart Poettering [Mon, 14 Oct 2024 09:51:43 +0000 (11:51 +0200)]
Merge pull request #34716 from dvdhrm/pr/derand
Clarify nameing-scheme in DESKTOP_ENVIRONMENT documentation
Ivan Kruglov [Tue, 8 Oct 2024 15:00:27 +0000 (17:00 +0200)]
machine: tests for varlink interfaces
- io.systemd.MachineImage.List
- io.systemd.MachineImage.Update
Ivan Kruglov [Fri, 11 Oct 2024 12:38:58 +0000 (14:38 +0200)]
machine: listen on io.systemd.MachineImage socket
Ivan Kruglov [Tue, 8 Oct 2024 15:00:11 +0000 (17:00 +0200)]
machine: introduce io.systemd.MachineImage.Update varlink method
io.systemd.MachineImage.Update implements the following dbus org.freedesktop.machine1.Manager interfaces:
- RenameImage
- MarkImageReadOnly
- SetImageLimit
Ivan Kruglov [Tue, 8 Oct 2024 14:58:22 +0000 (16:58 +0200)]
machine: introduce io.systemd.MachineImage.List varlink method
io.systemd.MachineImage.List implements the following dbus org.freedesktop.machine1.Manager interfaces:
- GetImage
- ListImages
- GetImageHostname
- GetImageMachineID
- GetImageMachineInfo
- GetImageOSRelease
Ivan Kruglov [Tue, 8 Oct 2024 09:30:10 +0000 (11:30 +0200)]
machine: generalize rename_image_and_update_cache() logic
This is a prep step to reuse the function in varlink interface
Ivan Kruglov [Wed, 2 Oct 2024 11:21:46 +0000 (13:21 +0200)]
machine: move manager_acquire_image to src/machine/machined-core.c
This is a prep step to reuse the function in varlink interface.
Ivan Kruglov [Tue, 1 Oct 2024 08:04:08 +0000 (10:04 +0200)]
machine: fix misnamed params in src/shared/discover-image.h
Yu Watanabe [Mon, 14 Oct 2024 01:42:25 +0000 (10:42 +0900)]
bash-completion/busctl: support wait command
Follow-up for
30465af656a10c124e7fa9fb33f7ad8454e9af2e.
Jörg Behrmann [Sun, 13 Oct 2024 13:20:44 +0000 (15:20 +0200)]
ukify: Add more mypy options
This achieves parity with the mypy config used in mkosi.
The import of builtins is needed because otherwise type is attempted to be
resolved to the variable in the scope.
Jörg Behrmann [Mon, 14 Oct 2024 07:58:05 +0000 (09:58 +0200)]
ukify: Add UkifyConfig
Using a dataclass instead of an argparse namespace to pass around the parsed
options allows to track the types properly.
Jörg Behrmann [Thu, 10 Oct 2024 09:57:12 +0000 (11:57 +0200)]
ukify: Add a unified interface for signing tools
Jörg Behrmann [Sat, 12 Oct 2024 13:50:57 +0000 (15:50 +0200)]
ukify: Fix type of UKI.executable
Lennart Poettering [Mon, 14 Oct 2024 07:56:47 +0000 (09:56 +0200)]
Merge pull request #34730 from yuwata/boot-efi-follow-ups
boot/efi: several follow-ups for recent change
Yu Watanabe [Sun, 13 Oct 2024 06:17:07 +0000 (15:17 +0900)]
network/address: use config_parse_in_addr_non_null() at one more place
No functional change, just refactoring.
Yu Watanabe [Sun, 13 Oct 2024 06:08:04 +0000 (15:08 +0900)]
network/address: do not set family in config_parse_broadcast()
The family will be checked later in
address_section_verify() -> address_section_adjust_broadcast(),
hence it is not necessary to set here.
Follow-up for
5d15c7b19cae6d3332d4e213c380e0fcc1317a2c.
Fixes oss-fuzz#
372994449.
Fixes #34748.
Yu Watanabe [Sun, 13 Oct 2024 09:50:48 +0000 (18:50 +0900)]
Merge pull request #34555 from rpigott/busctl-wait
busctl: add wait verb to wait for signals
Ronan Pigott [Wed, 2 Oct 2024 18:57:24 +0000 (11:57 -0700)]
busctl: add a test for busctl wait
Yu Watanabe [Sun, 13 Oct 2024 05:48:35 +0000 (14:48 +0900)]
Merge pull request #34520 from vcaputo/mmap-cache-unused-min
mmap-cache: enforce an unused windows minimum
Ronan Pigott [Thu, 26 Sep 2024 01:42:59 +0000 (18:42 -0700)]
busctl: add wait verb to wait for signals
It's like busctl call, but it waits for a signal rather than a reply to
a method call.
lumingzh [Sun, 13 Oct 2024 00:38:42 +0000 (02:38 +0200)]
po: Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (253 of 253 strings)
Co-authored-by: lumingzh <lumingzh@qq.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_CN/
Translation: systemd/main
Yu Watanabe [Sat, 12 Oct 2024 22:24:08 +0000 (07:24 +0900)]
test: add test for local outbounds with preferred source address
Yu Watanabe [Sat, 12 Oct 2024 21:56:38 +0000 (06:56 +0900)]
local-addresses: honor RTA_PREFSRC field of gateway
Fixes #34739.
Yu Watanabe [Sat, 12 Oct 2024 21:30:58 +0000 (06:30 +0900)]
local-addresses: use FOREACH_ARRAY() macro
Yu Watanabe [Sat, 12 Oct 2024 20:56:25 +0000 (05:56 +0900)]
sha256: use memory-util-fundamental.h
Prompted by https://github.com/systemd/systemd/pull/34722#discussion_r1797352922.
Yu Watanabe [Fri, 11 Oct 2024 19:01:28 +0000 (04:01 +0900)]
boot/efi/log: always include filename, line, and function in log message
Then, drop unused log_trace().
Yu Watanabe [Fri, 11 Oct 2024 18:53:37 +0000 (03:53 +0900)]
boot/efi/smbios: initialize output parameters if entries not found
Yu Watanabe [Fri, 11 Oct 2024 18:52:10 +0000 (03:52 +0900)]
boot/efi: trivial coding style cleanups
Follow-ups for #34717 and #34718.
Yu Watanabe [Sat, 12 Oct 2024 00:49:23 +0000 (09:49 +0900)]
bus-message-util: introduce bus_message_dump_fd() and _string()
Then, use them in analyze and oomctl.
Yu Watanabe [Sat, 12 Oct 2024 00:46:50 +0000 (09:46 +0900)]
analyze: fall back to simple method from dump_patterns() and friends
No functional change, just refactoring.
Ryan Wilson [Fri, 11 Oct 2024 20:38:58 +0000 (13:38 -0700)]
Add integration test for ExtraFileDescriptors after daemon-reexec
This commit adds a corresponding integration test for ExtraFileDescriptors
after systemctl daemon-reexec. This ensures systemd keeps the file
descriptors while the service manager is restarting and we don't lose
ability to restart the service correctly.
Jörg Behrmann [Fri, 11 Oct 2024 12:34:15 +0000 (14:34 +0200)]
ukify: Require both key and cert be set in generate_keys
If either is None the write in this branch of the code will fail.
Jörg Behrmann [Thu, 10 Oct 2024 16:23:35 +0000 (18:23 +0200)]
ukify: Add missing typing for iterator
Yu Watanabe [Fri, 11 Oct 2024 23:12:38 +0000 (08:12 +0900)]
Merge pull request #34591 from teknoraver/timer
timer: introduce DeferReactivation setting
Yu Watanabe [Fri, 11 Oct 2024 23:12:10 +0000 (08:12 +0900)]
Merge pull request #34698 from yuwata/udev-node-lock-file
udev-node: remove stack directories and their lock files by workers, rather than manager
Yu Watanabe [Fri, 11 Oct 2024 23:11:35 +0000 (08:11 +0900)]
Merge pull request #34722 from anonymix007/fundamental-sha1
fundamental: Add SHA1
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.
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>
Yu Watanabe [Thu, 10 Oct 2024 18:37:01 +0000 (03:37 +0900)]
TEST-17-UDEV: also check if /run/udev/links.lock/ is empty on settle
Yu Watanabe [Thu, 10 Oct 2024 01:42:24 +0000 (10:42 +0900)]
udev-node: drop unnecessary manager side cleaning up logic for stack directory
Unnecessary stack directories and their lock files are removed by
workers. Hence, the logic is not necessary anymore.
Yu Watanabe [Thu, 10 Oct 2024 01:36:46 +0000 (10:36 +0900)]
udev-node: drop workaround for by-diskseq symlinks
This effectively reverts
09373c1a50297079e6b0447ea97af4e9a60f77fa,
as stack directories and lock files are removed by udev workers on
unlocking.
Yu Watanabe [Thu, 10 Oct 2024 01:33:22 +0000 (10:33 +0900)]
udev-node: remove lockfile and stack directory when not necessary if possible
Replaces
09373c1a50297079e6b0447ea97af4e9a60f77fa.
Let's remove stack directories and their lock files by workers if
possible.
Now, lock files must be created before creating stack directories, hence
lock files are moved to /run/udev/links.lock/ , e.g.,
Before:
/run/udev/links/disk\x2fby-diskseq\x2f1/.lock
After:
/run/udev/links.lock/disk\x2fby-diskseq\x2f1
Fixes ##34637.
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
anonymix007 [Fri, 11 Oct 2024 13:30:43 +0000 (16:30 +0300)]
test: Add tests for SHA1
anonymix007 [Tue, 10 Sep 2024 13:58:20 +0000 (16:58 +0300)]
fundamental: Import SHA1 implementation from libxcrypt
anonymix007 [Fri, 11 Oct 2024 13:44:54 +0000 (16:44 +0300)]
macro: Add DISABLE_WARNING_STRINGOP_OVERREAD
While at it, also add -Wunknown-warning-option to basic_disabled_warnings to fix compilation with clang
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
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
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
Yu Watanabe [Sun, 22 Sep 2024 21:34:02 +0000 (06:34 +0900)]
network/route: use log_section_warning() more
Yu Watanabe [Sun, 22 Sep 2024 21:20:05 +0000 (06:20 +0900)]
network/route: use generic [Route] section parser more
Yu Watanabe [Sun, 22 Sep 2024 20:51:37 +0000 (05:51 +0900)]
network/route: use log_syntax_parse_error() more
Yu Watanabe [Sun, 22 Sep 2024 20:43:22 +0000 (05:43 +0900)]
network/route-nexthop: use generic [Route] section parser more
Yu Watanabe [Sun, 22 Sep 2024 20:40:55 +0000 (05:40 +0900)]
network/route-nexthop: use log_syntax_parse_error()
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.
Yu Watanabe [Sun, 22 Sep 2024 19:13:51 +0000 (04:13 +0900)]
network/route-metric: use log_syntax_parse_error()
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.
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
===
Yu Watanabe [Sun, 22 Sep 2024 18:28:19 +0000 (03:28 +0900)]
network/address: use log_section_warning() more
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.
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.
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.
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)
Mike Yuan [Tue, 8 Oct 2024 13:48:49 +0000 (15:48 +0200)]
core/service: add missing serialization for extra fds
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.
Mike Yuan [Tue, 8 Oct 2024 13:05:03 +0000 (15:05 +0200)]
core/service: use LIST_HEAD where appropriate
Mike Yuan [Sun, 15 Sep 2024 13:04:04 +0000 (15:04 +0200)]
time-util: use saturate_add for usec_add()
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
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
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
anonymix007 [Thu, 10 Oct 2024 15:35:30 +0000 (18:35 +0300)]
fundamental: Add EFI_GUID userspace definition
anonymix007 [Wed, 11 Sep 2024 21:26:34 +0000 (00:26 +0300)]
boot: Add log_info and log_debug
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
anonymix007 [Wed, 11 Sep 2024 12:18:05 +0000 (15:18 +0300)]
boot: Move smbios-related functions to a separate file
anonymix007 [Sat, 31 Aug 2024 18:34:56 +0000 (21:34 +0300)]
boot: Add xcalloc and xcalloc_multiply
anonymix007 [Sat, 31 Aug 2024 18:31:49 +0000 (21:31 +0300)]
boot: Add EFI_STATUS_IS_ERROR macro
anonymix007 [Thu, 10 Oct 2024 15:23:42 +0000 (18:23 +0300)]
boot: Add bswap_{16,32}
anonymix007 [Thu, 10 Oct 2024 14:54:13 +0000 (17:54 +0300)]
boot: Add be32toh
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
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
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
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
Lennart Poettering [Fri, 11 Oct 2024 09:13:27 +0000 (11:13 +0200)]
smbios: make code more readable by introducing a "limit" pointer