Yu Watanabe [Wed, 18 Sep 2024 16:53:19 +0000 (01:53 +0900)]
test: add tests for seccomp_suppress_sync()
Yu Watanabe [Thu, 19 Sep 2024 18:52:19 +0000 (03:52 +0900)]
seccomp-util: pass negative fds as is to fsync() and friends
Closes #34478.
Co-authored-by: Mike Yuan <me@yhndnzj.com>
Yu Watanabe [Thu, 19 Sep 2024 14:28:15 +0000 (23:28 +0900)]
Merge pull request #34486 from DaanDeMeyer/test-process-util
test-process-util: Migrate to new assertion macros
Daan De Meyer [Thu, 19 Sep 2024 14:22:24 +0000 (16:22 +0200)]
Merge pull request #34481 from yuwata/has-tpm2
tpm2-util: several cleanups for tpm2_support()
Daan De Meyer [Thu, 19 Sep 2024 11:59:56 +0000 (13:59 +0200)]
Merge pull request #34483 from yuwata/network-conf-parser-neighbor-nexthop
network: several cleanups for conf parsers
Daan De Meyer [Thu, 19 Sep 2024 10:21:55 +0000 (12:21 +0200)]
test-process-util: Ignore EINVAL from setresuid() and setresgid()
If we're running in a user namespace with a single user and without
the nobody user, we'll get EINVAL from these system calls so make
sure we handle those gracefully.
Daan De Meyer [Thu, 19 Sep 2024 10:04:34 +0000 (12:04 +0200)]
test-process-util: Use FORK_REOPEN_LOG everywhere we close all fds
To make sure logging works in the child processes.
Daan De Meyer [Thu, 19 Sep 2024 09:39:09 +0000 (11:39 +0200)]
test-process-util: Migrate to new assertion macros
Yu Watanabe [Thu, 19 Sep 2024 10:21:05 +0000 (19:21 +0900)]
man/systemd-analyze: mention required libraries for TPM2 support
Closes #34477.
Yu Watanabe [Thu, 19 Sep 2024 10:11:23 +0000 (19:11 +0900)]
tpm2-util: colorize output of 'systemd-analyze has-tpm2'
Yu Watanabe [Wed, 18 Sep 2024 20:40:13 +0000 (05:40 +0900)]
shell-completion/analyze: add has-tpm2
Yu Watanabe [Thu, 19 Sep 2024 10:08:06 +0000 (19:08 +0900)]
tpm2-util: update comment
has-tpm2 command is moved to systemd-analyze.
Follow-up for
58e359604ffdca12bb4d2c5807b96e070611c0f6.
Yu Watanabe [Wed, 18 Sep 2024 20:25:48 +0000 (05:25 +0900)]
tpm2-util: do not load tpm2 libraries when not interested in the existence of the libraries
For example, 'bootctl status' only interested in if the efi has TPM2
support and a TPM2 driver is loaded. Hence, not necessary to load
libtss2.
Yu Watanabe [Wed, 18 Sep 2024 20:25:37 +0000 (05:25 +0900)]
tpm2-util: introduce tpm2_is_fully_supported()
Yu Watanabe [Thu, 19 Sep 2024 09:59:17 +0000 (18:59 +0900)]
Merge pull request #34479 from yuwata/sd-json-dispatch-field-table-static
tree-wide: make sd_json_dispatch_field table static
Yu Watanabe [Wed, 18 Sep 2024 19:49:30 +0000 (04:49 +0900)]
network/nexthop: introduce generic conf parser for [NextHop] section
Yu Watanabe [Wed, 18 Sep 2024 19:28:32 +0000 (04:28 +0900)]
network/nexthop: make conf parsers for Family= and Gateway= independent of each other
Yu Watanabe [Wed, 18 Sep 2024 19:19:38 +0000 (04:19 +0900)]
network/nexthop: use log_section_warning() and friend
Daan De Meyer [Thu, 19 Sep 2024 09:38:47 +0000 (11:38 +0200)]
Add ASSERT_OK_ZERO_ERRNO() and ASSERT_OK_EQ_ERRNO()
Daan De Meyer [Thu, 19 Sep 2024 07:20:03 +0000 (09:20 +0200)]
Merge pull request #34474 from DaanDeMeyer/user-group
Two integration test fixes
Daan De Meyer [Wed, 18 Sep 2024 13:53:33 +0000 (15:53 +0200)]
test: Run TEST-74-AUX-UTILS in virtual machine
Various tests skip themselves when running in a container so make
sure the test runs in a virtual machine so we get full coverage.
Yu Watanabe [Wed, 18 Sep 2024 23:43:51 +0000 (08:43 +0900)]
test: create .netdev file at last
Previously, when the test ran on mkosi, then networkd was not masked, and
might be already started. In that case, the interface test2 would be created
soon after the .netdev file is created, and the .link file would not be
applied to the interface. Hence, the later test case for
'networkctl cat @test2:link' would fail.
This make networkd always started at the beginning of the test, and
.netdev file created after .link file is created. So, .link file is
always applied to the interface created by the .netdev file.
Yu Watanabe [Thu, 19 Sep 2024 00:18:44 +0000 (09:18 +0900)]
Yu Watanabe [Thu, 19 Sep 2024 00:14:21 +0000 (09:14 +0900)]
Daan De Meyer [Wed, 18 Sep 2024 13:38:43 +0000 (15:38 +0200)]
ci: Don't add testuser to wheel and systemd-journal groups
This breaks TEST-74-AUX-UTILS when run in a VM as the user gets access
to journal files that the test expects it can't access.
Frantisek Sumsal [Wed, 18 Sep 2024 10:54:51 +0000 (12:54 +0200)]
test: drop removed SCSI passthrough feature
This feature has been deprecated since QEMU 5.0 and finally removed in
QEMU 9.1 [0] which now causes issues when running the storage tests on
latest Arch:
------ testcase_long_sysfs_path: BEGIN ------
...
qemu-system-x86_64: -device virtio-blk-pci,drive=drive0,scsi=off,bus=pci_bridge25: Property 'virtio-blk-pci.scsi' not found
E: qemu failed with exit code 1
[0] https://github.com/qemu/qemu/commit/
a271b8d7b2f39275a05e49deb7c8edc20b7a8279
Yu Watanabe [Wed, 18 Sep 2024 19:03:11 +0000 (04:03 +0900)]
network/neighbor: use log_section_warning_errno()
Yu Watanabe [Wed, 18 Sep 2024 18:59:34 +0000 (03:59 +0900)]
network/neighbor: introduce generic Neighbor section parser
Yu Watanabe [Wed, 18 Sep 2024 18:54:29 +0000 (03:54 +0900)]
network/neighbor: use struct in_addr_data
Yu Watanabe [Wed, 18 Sep 2024 18:39:15 +0000 (03:39 +0900)]
conf-parser: drop unnecessary temporary variable
Yu Watanabe [Wed, 18 Sep 2024 18:35:03 +0000 (03:35 +0900)]
conf-parser: introduce config_parse_in_addr_data()
Yu Watanabe [Wed, 18 Sep 2024 16:34:19 +0000 (01:34 +0900)]
tree-wide: drop unnecessary 'struct'
Yu Watanabe [Wed, 18 Sep 2024 16:27:44 +0000 (01:27 +0900)]
nsresource: make sd_json_dispatch_field table static
This also adds missing error check of sd_json_dispatch().
Follow-up for
54452c7b2aa03536331fc1ec04439c89d0320b57.
Yu Watanabe [Wed, 18 Sep 2024 16:21:42 +0000 (01:21 +0900)]
creds-util: make sd_json_dispatch_field table static
Yu Watanabe [Wed, 18 Sep 2024 16:03:09 +0000 (01:03 +0900)]
resolve: make sd_json_dispatch_field table static
Yu Watanabe [Wed, 18 Sep 2024 15:56:53 +0000 (00:56 +0900)]
resolvectl: make sd_json_dispatch_field table static
Yu Watanabe [Wed, 18 Sep 2024 16:16:53 +0000 (01:16 +0900)]
updatectl: make sd_json_dispatch_field table static
This also fixes memory leak of Version object on failure.
Follow-up for
ec15bb71c2ccd57702325a6e6626053a343f3511.
Yu Watanabe [Wed, 18 Sep 2024 16:06:59 +0000 (01:06 +0900)]
varlinkctl: make sd_json_dispatch_field table static
Yu Watanabe [Wed, 18 Sep 2024 16:05:24 +0000 (01:05 +0900)]
ssh-generator: make sd_json_dispatch_field table static
Yu Watanabe [Wed, 18 Sep 2024 15:44:16 +0000 (00:44 +0900)]
machine: make sd_json_dispatch_field table static
Antonio Alvarez Feijoo [Wed, 18 Sep 2024 09:29:40 +0000 (11:29 +0200)]
nsresourced: fix build without libbpf
```
In file included from ../src/nsresourced/nsresourced-manager.c:9:
../src/shared/bpf-link.h:5:10: fatal error: bpf/libbpf.h: No such file or directory
5 | #include <bpf/libbpf.h>
| ^~~~~~~~~~~~~~
```
Follow-up for
46718d344fdaaaf523d854a0c728197e7406a55a
Daan De Meyer [Wed, 18 Sep 2024 05:43:59 +0000 (07:43 +0200)]
repart: Drop unprivileged subvolumes logic for btrfs
The functionality was explicitly not included in 6.11 for some
unknown reason so drop the logic from systemd-repart as well so
we don't release v257 with it included.
Antonio Alvarez Feijoo [Wed, 18 Sep 2024 13:02:53 +0000 (15:02 +0200)]
man/repart: use <varname> instead of <variable>
Otherwise, `<variable>$BOOT</variable>` is rendered:
```
[2548/2992] Generating man/repart.d.5 with a custom command
Element variable in namespace '' encountered in para, but no template matches.
Element variable in namespace '' encountered in para, but no template matches.
```
Marius Hoch [Wed, 18 Sep 2024 10:07:00 +0000 (12:07 +0200)]
hwdb: Add accel orientation quirk for the IdeaPad Duet 3 10IGL5-LTE
Signed-off-by: Marius Hoch <mail@mariushoch.de>
Daan De Meyer [Mon, 16 Sep 2024 21:04:02 +0000 (23:04 +0200)]
repart: Support specifying multiple directories to ExcludeFiles=
chenjiayi [Wed, 18 Sep 2024 03:12:34 +0000 (11:12 +0800)]
systemd: rewatch pids under cgroup v1 when sigchld of processes more than main pid and control pid is captured
If `Delegate` is configured in service, cgroup agent will never send out
any datagram as .control subcgroup is generated. Thus systemd will watch
all processes on the cgroup hierarchy for SIGCHLD to deal with unreliable
cgroup notifications.
In this way, systemd should rewatch all processes when any SIGCHLD is
captured, more than the control pid or main pid.
Jason Yundt [Tue, 17 Sep 2024 18:00:26 +0000 (14:00 -0400)]
man: document ShowStatus and SetShowStatus()
SetShowStatus() was added in order to fix #11447. Recently, I ran into
the exact same problem that OP was experiencing in #11447. I wasn’t able
to figure out how to deal with the problem until I found #11447, and it
took me a while to find #11447.
This commit takes what I learned from reading #11447 and adds it to the
documentation. Hopefully, this will make it easier for other people who
run into the same problem in the future.
Daan De Meyer [Wed, 18 Sep 2024 06:50:38 +0000 (08:50 +0200)]
Merge pull request #34464 from yuwata/test-space-in-path
test: allow to run tests under directory that contains spaces
Yu Watanabe [Tue, 17 Sep 2024 20:00:21 +0000 (05:00 +0900)]
test: quote paths to executables
Fixes #34459.
Yu Watanabe [Tue, 17 Sep 2024 19:59:38 +0000 (04:59 +0900)]
kernel-install: unquote plugin paths in KERNEL_INSTALL_PLUGINS
To support the case that paths to plugins contain spaces.
Prompted by #34459
Yu Watanabe [Wed, 18 Sep 2024 00:31:17 +0000 (09:31 +0900)]
Merge pull request #34460 from yuwata/test-86-follow-ups
test: follow-ups for TEST-86
Daan De Meyer [Tue, 17 Sep 2024 19:46:04 +0000 (21:46 +0200)]
tmpfiles.d: Remove purge flag from lines that don't support it
Fixes
db15657dfb8100c3c6cd8cf60fa68521e019d47a
Daan De Meyer [Tue, 17 Sep 2024 19:44:37 +0000 (21:44 +0200)]
ukify: Remove debug log
This prints a python data structure which we shouldn't do during
normal operation.
Yu Watanabe [Tue, 17 Sep 2024 20:09:20 +0000 (05:09 +0900)]
Merge pull request #34040 from AdrianVovk/repart-dollar-boot
repart: Implement $BOOT support
Daan De Meyer [Tue, 17 Sep 2024 19:09:19 +0000 (21:09 +0200)]
Merge pull request #34440 from yuwata/network-log-no-matching-network
network: log when no matching .network file found
Yu Watanabe [Sun, 15 Sep 2024 17:42:05 +0000 (02:42 +0900)]
network/dhcp4: use device_get_property_bool() at link_needs_dhcp_broadcast()
No functional change, just refactoring.
Yu Watanabe [Tue, 17 Sep 2024 18:58:58 +0000 (03:58 +0900)]
test: drop unused test.sh for TEST-86-MULTI-PROFILE-UKI
The test cannot run with the bash test runner, as it requires python.
Hence, test.sh is not necessary.
Follow-up for
a37640653cab108bb2cfdcba7e9422cced925e95.
Yu Watanabe [Tue, 17 Sep 2024 18:50:43 +0000 (03:50 +0900)]
test: minor coding style fixlets
Follow-up for
a37640653cab108bb2cfdcba7e9422cced925e95.
Yu Watanabe [Tue, 17 Sep 2024 18:48:45 +0000 (03:48 +0900)]
Merge pull request #34457 from poettering/uki-with-many-testcase
multi-profile UKIs: test case
Michael Ferrari [Mon, 16 Sep 2024 17:54:53 +0000 (19:54 +0200)]
homed: wait for user input during firstboot
This mirrors the behavior of `systemd-firstboot` and allows bootup
messages to settle down before user input is actually processed.
See: https://github.com/systemd/systemd/issues/34448
Yu Watanabe [Tue, 17 Sep 2024 18:13:47 +0000 (03:13 +0900)]
conf-parser: use hashmap_ensure_put() at one more place
Yu Watanabe [Tue, 17 Sep 2024 18:05:41 +0000 (03:05 +0900)]
conf-parser: log errors in config_parse_many_files() and friends
Previously, if an file cannot be opened, e.g. due to its permission,
config_parse_many() or so did not log the error even if CONFIG_PARSE_WARN
flag is set. This makes all error paths in these functions are logged,
and the log level is controlled by the flag.
Prompted by #34436.
Adrian Vovk [Wed, 4 Sep 2024 03:48:28 +0000 (23:48 -0400)]
repart: Add tests for supplement partitions
Adrian Vovk [Sat, 17 Aug 2024 17:30:46 +0000 (13:30 -0400)]
repart: Add SupplementFor= logic
This was designed to deal with $BOOT, as defined by the Boot Loader
Specification, but it was made a generic mechanism because it is useful
elsewhere too. See the updated man page for usage examples, motivation,
and an explanation of how this works.
Adrian Vovk [Thu, 5 Sep 2024 00:19:27 +0000 (20:19 -0400)]
repart: Consider existing partitions when placing
Fixes an oversight in `context_allocate_partitions` that makes it
succeed in cases where it should fail. Essentially, there was nothing
actually enforcing SizeMinBytes= and PaddingMinBytes= for partitions
that exist, only for new partitions. This behavior is inconsistent with
the docs, which state that existing partitions will be grown to at least
the specified minimum size, and that "If the backing device does not
provide enough space to fulfill the constraints placing the partition
will fail".
Adrian Vovk [Wed, 4 Sep 2024 03:45:08 +0000 (23:45 -0400)]
strv: Fixup STRV_FOREACH_PAIR macro
The macro didn't properly parenthesize a caller-controlled argument.
For example: `STRV_FOREACH_PAIR(a, b, something ?: something_else)`
would expand to `typeof(*something ?: something_else)`, which would
cause compile failures
Yu Watanabe [Tue, 17 Sep 2024 17:50:19 +0000 (02:50 +0900)]
log: introduce log_oom_full()
Yu Watanabe [Tue, 17 Sep 2024 17:35:28 +0000 (02:35 +0900)]
network: log loaded .network and .netdev files
Yu Watanabe [Sun, 15 Sep 2024 18:24:19 +0000 (03:24 +0900)]
network: log when no matching .network file found
When an interface enters unmanaged state, there are two possibilities:
- no matching .network file found,
- found a matching .network with Unmanaged=yes.
When a matching .network file is found, networkd logs the filename.
Let's also log when no matching .network file is found.
This also slightly adjust the log message when a matching .network file
found.
Closes #34436.
PavlNekrasov [Tue, 17 Sep 2024 10:17:21 +0000 (13:17 +0300)]
Use correct error code in log message in output_waiting_jobs (#34404)
The error code `r` from the read function is being logged, but the error code `rc` from the table data insertion function should be logged instead.
Yu Watanabe [Tue, 17 Sep 2024 10:15:12 +0000 (19:15 +0900)]
Merge pull request #34443 from yuwata/network-sysctl-monitor-follow-ups
network/sysctl-monitor: several follow-ups and cleanups
Lennart Poettering [Fri, 5 Jul 2024 16:16:17 +0000 (18:16 +0200)]
update TODO
Lennart Poettering [Tue, 16 Jul 2024 08:48:39 +0000 (10:48 +0200)]
ci: add testcase for multi-profile UKIs
This tests the whole shebang:
1. That ukify can generate them properly
2. That systemd-boot can dissect them properly
3. That systemd-stub can accept profile selection propery
4. That the profile information ends up in /run/systemd/stub/ properly
5. That systemd-measure correctly calculates the expected PCR 11 values
for each profile and that we can unlock a public-key bound LUKS
volume with it
Yu Watanabe [Tue, 17 Sep 2024 06:13:38 +0000 (15:13 +0900)]
docs: fix typo in filename: REATLIME -> REALTIME
Yu Watanabe [Tue, 17 Sep 2024 06:33:15 +0000 (15:33 +0900)]
test/repart: fix mkfs checker
Follow-up for
27cacec939a46f61706d7b48a51b6f5880be4662.
Daan De Meyer [Mon, 16 Sep 2024 19:45:55 +0000 (21:45 +0200)]
Fix generator logging
log_setup() overrides the previously set log target again so we
can't use it in log_setup_generator().
Follow-up for
aa976d87889ae22b7347787a1ebd03a31dcc0a9e
Arian van Putten [Mon, 16 Sep 2024 21:35:13 +0000 (23:35 +0200)]
CONTROL_GROUP_INTERFACE: fix link to systemd-run code
Yu Watanabe [Tue, 17 Sep 2024 06:00:06 +0000 (15:00 +0900)]
network: drop unnecessary BPF related objects from Manager when disabled
Yu Watanabe [Mon, 16 Sep 2024 06:10:46 +0000 (15:10 +0900)]
network/sysctl-monitor: do not allocate sysctl_shadow when eBPF is not supported
When eBPF is disabled, the hashmap will be never used. Let's not
allocate it.
Yu Watanabe [Mon, 16 Sep 2024 06:08:36 +0000 (15:08 +0900)]
network/sysctl-monitor: fix use-after-free
Previously, manager_free() did not assign NULL to Manager.sysctl_shadow,
hence sysctl_clear_link_shadows() called by link_free() will causes
use-after-free. To fix the issue, this makes Manager.sysctl_shadow will be
set to NULL after it is freed,
Fixes a bug introduced by
6d9ef22acdeac4b429efb75164341233955484af.
Yu Watanabe [Mon, 16 Sep 2024 00:58:51 +0000 (09:58 +0900)]
network/sysctl: several cleanups for sysctl_add_monitor()
- rename rootcg -> root_cgroup_fd, to emphasize it is a fd,
- drop nested function call, and check error code.
Yu Watanabe [Mon, 16 Sep 2024 00:43:18 +0000 (09:43 +0900)]
bpf-link: introduce bpf_ring_buffer_free() and friends
Then, replace rb_free() in networkd.
Follow-up for
6d9ef22acdeac4b429efb75164341233955484af.
Yu Watanabe [Mon, 16 Sep 2024 00:33:58 +0000 (09:33 +0900)]
network/sysctl: use wrapped free functions
No functional change, just refactoring.
Follow-up for
6d9ef22acdeac4b429efb75164341233955484af.
Yu Watanabe [Mon, 16 Sep 2024 00:19:21 +0000 (09:19 +0900)]
network/sysctl-monitor: fix sanity check in cut_last()
This also adds basic comment about the return code.
Follow-up for
6d9ef22acdeac4b429efb75164341233955484af.
Yu Watanabe [Mon, 16 Sep 2024 02:49:57 +0000 (11:49 +0900)]
Yu Watanabe [Mon, 16 Sep 2024 02:49:02 +0000 (11:49 +0900)]
Yu Watanabe [Mon, 16 Sep 2024 02:47:40 +0000 (11:47 +0900)]
Yu Watanabe [Mon, 16 Sep 2024 01:51:09 +0000 (10:51 +0900)]
Merge pull request #34393 from poettering/tmpfiles-ownership-flag
tmpfiles: introduce an explicit line flag $ for enabling purge logic …
Yu Watanabe [Mon, 16 Sep 2024 01:42:37 +0000 (10:42 +0900)]
Merge pull request #34425 from yuwata/udev-rules-case-insensitive-match
udev-rules: support case insensitive match
Mike Yuan [Sun, 15 Sep 2024 14:04:32 +0000 (16:04 +0200)]
basic/build: also include BTF status
Lennart Poettering [Sun, 15 Sep 2024 14:16:34 +0000 (16:16 +0200)]
coredump: use _cleanup_(iovec_done) where appropriate
Yu Watanabe [Mon, 16 Sep 2024 01:41:24 +0000 (10:41 +0900)]
Merge pull request #34434 from poettering/bootctl-stub-paths
bootctl: expose new stub path efi vars and related
Lennart Poettering [Tue, 16 Jul 2024 09:27:19 +0000 (11:27 +0200)]
bootctl: show whether a PE file is an addon in 'booctl kernel-identify'
Celeste Liu [Sun, 15 Sep 2024 16:31:41 +0000 (00:31 +0800)]
hwdb: add Kensington SlimBlade Pro trackball (Bluetooth mode)
Wired and 2.4G dongle connectivity is covered by general trackball rule,
but with Bluetooth connectivity Kensington SlimBlade Pro uses the name
"SlimBlade Pro" which doesn't contain "[Tt]rack[Bb]all". We need to
process it specially.
Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
Daan De Meyer [Sun, 15 Sep 2024 20:01:16 +0000 (22:01 +0200)]
repart: Fix log messages in partition_populate_directory()
We're not actually populating a filesystem here, we're preparing
to populate a filesystem, so update the log messages accordingly.
Lennart Poettering [Fri, 13 Sep 2024 15:24:20 +0000 (17:24 +0200)]
tmpfiles.d: add $ flag to all lines which are clearly private to our packages, and should be removed on package removal
(This excludes any dirs that contain resources placed there by the user)
(I also didn't bother marking resources belonging to components that are
really not optional for us)
Lennart Poettering [Thu, 12 Sep 2024 16:23:06 +0000 (18:23 +0200)]
tmpfiles: introduce an explicit line flag $ for enabling purge logic for a line
Let's make the risk of accidental misuse, and mark lines that shall be
covered by --purge with an explicit new flag "$".
See: #33349
Lennart Poettering [Tue, 16 Jul 2024 07:49:50 +0000 (09:49 +0200)]
bootctl: also show current/default/oneshot entry literally in output
Lennart Poettering [Mon, 15 Jul 2024 16:21:35 +0000 (18:21 +0200)]
bootctl: add --print-loader-path + --print-stub-path
These are inspired by the existing commands that return the path to the
boot or ESP partitions. However, these new commands show the path to the
boot loader (systemd-boot) or UKI/stub (systemd-stub) that was used on
the current boot. This information is derived from EFI variables.
Lennart Poettering [Mon, 15 Jul 2024 16:18:35 +0000 (18:18 +0200)]
efivars: add helper that reads an fs path from an efi var