1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

65416 Commits

Author SHA1 Message Date
Daan De Meyer
0bb5653530
Merge pull request #27918 from yuwata/chase-filename
chase: handle root path more carefully in chase_and_open()
2023-06-06 15:01:37 +02:00
Daan De Meyer
fab4ef7262 btrfs-util: Add btrfs_subvol_snapshot_at() 2023-06-06 14:44:02 +02:00
Daan De Meyer
cf91b9155c chattr-util: Make chattr_full() an openat() style function 2023-06-06 14:42:03 +02:00
Daan De Meyer
77c66be37b btrfs-util: Add btrfs_subvol_set_read_only_at() 2023-06-06 14:42:03 +02:00
Daan De Meyer
5124aa8c03 rm-rf: Add rm_rf_at() 2023-06-06 14:42:03 +02:00
Daan De Meyer
24dbe6039a btrfs-util: Add btrfs_subvol_remove_at()
We also remove btrfs_subvol_remove_fd() because btrfs_subvol_remove_at()
is more general.
2023-06-06 14:42:03 +02:00
Daan De Meyer
8b85333cda test-chase: Add one more test for chase_and_openat() 2023-06-06 14:42:03 +02:00
Daan De Meyer
3c8f449cc8 chase: Allow passing NULL as the empty path to chaseat()
Per coding style, we should accept NULL as the empty path.
2023-06-06 14:42:03 +02:00
Daan De Meyer
f5dc1adc71 test-chase: Fix comment 2023-06-06 14:42:03 +02:00
Daan De Meyer
8a65b0b2c9 fd-util: Add path_is_root_at()
A generalization of dir_fd_is_root() that allows passing a path
component.
2023-06-06 14:42:03 +02:00
Daan De Meyer
6d2fd8df0a btrfs-util: Add btrfs_is_subvol_at() 2023-06-06 14:42:03 +02:00
Daan De Meyer
b196e17ed4 stat-util: Add is_fs_type_at() 2023-06-06 14:42:03 +02:00
Daan De Meyer
f90c1959db stat-util: Follow coding style in xstatfsat()
Allow passing NULL to indicate the empty path per coding style.
2023-06-06 14:42:03 +02:00
Daan De Meyer
23e3357842 fs-util: Allow passing NULL path to xopenat()
We recently codified in the coding style that for openat() style APIs,
an empty path can be passed both as the empty string and as NULL, so
let's make sure we follow that style in xopenat().
2023-06-06 14:42:03 +02:00
Daan De Meyer
f9f70e062d copy: Merge copy_directory() and copy_directory_fd() into copy_directory_at()
Let's merge these two into a single function that can handle both
variants and more.
2023-06-06 14:42:03 +02:00
Lennart Poettering
a9b837aa34 generators: change TimeoutSec=0 to TimeoutSec=infinity
With these settings we intend to turn off timeouts for possibly
interactive/slow commands. The officially documented way to turn off the
time-outs is to setting them to infinity. So far we set them to zero
here though.

This lead to some confusiong, for example #18224. Let's fix this by
uniformly spelling out TimeoutSec=infinity.

This doesn't change behaviour. It just makes our generated files match
what we document, without relying on historic compat support.

Fixes: #18224
2023-06-06 12:38:16 +01:00
Frantisek Sumsal
6f814d4f5d
Merge pull request #27933 from mrc0mmand/selinux
test: a couple of TEST-06-SELINUX tweaks
2023-06-06 11:18:50 +02:00
Frantisek Sumsal
e87abe8206 man: document OnSuccessJobMode=
Introduced in 294446dcb9.
2023-06-06 10:12:37 +01:00
Luca Boccassi
6aea5ce814 tests: fix shellcheck warnings 2023-06-06 02:37:36 +01:00
Dan Streetman
a47060bb34 tpm2: verify symmetric parms in tpm2_context_new()
This adds tpm2_get_capability_algs(), tpm2_supports_alg(), and
tpm2_test_parms(). These functions allow verifying that the TPM supports
specific algs and parameters.

When creating a new context, this checks if the TPM supports the symmetric algs
we use. If the TPM does not support the symmetric algs and parameters we
require, we log and return error.
2023-06-05 19:58:14 -04:00
Dan Streetman
3a35d6cdd2 tpm2: add tpm2_get_capability(), tpm2_cache_capabilities(), tpm2_capability_pcrs()
This adds a function to query specific capabilities from the TPM. That is then
used in a function to query the allocation of PCRs in the TPM, i.e. which PCR
banks and indexes are available, and caches the PCR allocation when the TPM
context is created.
2023-06-05 18:13:07 -04:00
Frantisek Sumsal
d5ab23aa54 test: a couple of assorted cleanups
- sort binaries
- send stdout/stderr of the autorelabel service to console as well
2023-06-05 23:30:01 +02:00
Frantisek Sumsal
fa5dee77c0 test: load the SELinux module outside of the VM
Turns out we can, apart from just building the module, "shove" it into
the SELinux database in a chroot as well. This brings quite significant
time savings, as the SELinux db rebuild takes 2 - 5 minutes in a VM
without acceleration (and takes currently ~half of the runtime of the test
in the C8S job).
2023-06-05 22:52:38 +02:00
Frantisek Sumsal
8c0ace5739 test: add a reasoning why we don't use the SELinux-provided units 2023-06-05 22:52:38 +02:00
Lennart Poettering
06390e22c9 cgls/cgtop: spell field/column "CGroup" rather than "Control Group"
In the documentation we usually spell the concept "control group".
Internally in code we usually call it "cgroup" or "CGroup". In systemctl output we
called the field "CGroup" so far, i.e. a capitalized version of the
internal name. This is of course very unsystematic. Let's clean this up
a bit: let's now say:

* in docs, continue to spell it out "control groups"
* in brief output call it "CGroup"
* internally call it "cgroup" or "CGroup"

Fixes: #14429
2023-06-06 03:35:28 +09:00
Yu Watanabe
3db7f3c58c
Merge pull request #27912 from mrc0mmand/cryptsetup-tests
test: add a couple more tests for systemd-cryptsetup
2023-06-06 03:34:59 +09:00
Luca Boccassi
9bb4f9f2ff
Merge pull request #27926 from DaanDeMeyer/repart-offline
repart: Add --offline argument
2023-06-05 19:11:41 +01:00
Simon Braunschmidt
99d3dd2ba7 99-systemd.rules.in: guard systemd-backlight udev rules by ENABLE_BACKLIGHT
Linux kernel will, as documented in drivers/video/backlight/backlight.c,
report changes to a backlights brightness as a uevent (ACTION=change).

systemd-udev will consume the uevent, match on this rule and try to
activate the systemd-backlight service for the backlight. BUT when
systemd is not compiled with backlight support, this will lead to
failure that is reported in the journal.

Since the failure to activate systemd-backlight and subsequent failure
log entry happens on every backlight brightness change, we found the
resulting logspam during regular operation excessive and came up with
this patch to mitigate it.

The conditional is also extended to "*kbd_backlight" match, since
even though we did not investigate to see if the logspam would be
similar, the unconditional match to activate systemd-backlight here
would also not make sense when the feature is not compiled in.

Signed-off-by: Simon Braunschmidt <simon.braunschmidt@iba-group.com>
2023-06-05 17:59:04 +01:00
Frantisek Sumsal
d7c1df84d9 test: make sure we unmount /var late during shutdown
To avoid the "mountpoint is busy" error.
2023-06-05 16:54:31 +02:00
Frantisek Sumsal
eb26f34a09 test: add a couple more tests for systemd-cryptsetup 2023-06-05 16:50:13 +02:00
Frantisek Sumsal
71d7f02cc7 test: make check_result_*() set -e friendly 2023-06-05 16:50:13 +02:00
Frantisek Sumsal
e6faf0ee22 test: use check_result_common()
The TEST-24 has been silently timing out for quite a while in the C8S
job, as the check_result_qemu() override lacked some error checks,
whoopsie.
2023-06-05 16:50:13 +02:00
Frantisek Sumsal
cdece7e30a cryptsetup: avoid calling strv_find() on a NULL pointer
When the header= option comes before any other type= defining one, we
trip over an assertion:

Jun 04 15:45:33 H testsuite-24.sh[752]: + systemctl start systemd-cryptsetup@detached.service
Jun 04 15:45:33 H systemd[1]: Starting systemd-cryptsetup@detached.service...
Jun 04 15:45:33 H systemd-cryptsetup[4641]: Assertion 'name' failed at src/basic/strv.c:21, function strv_find(). Aborting.
...
Jun 04 15:45:33 H systemd-coredump[4643]: Process 4641 (systemd-cryptse) of user 0 dumped core.
...
                                          Stack trace of thread 4641:
                                          #0  0x00007ff9256afe5c __pthread_kill_implementation (libc.so.6 + 0x8ce5c)
                                          #1  0x00007ff92565fa76 raise (libc.so.6 + 0x3ca76)
                                          #2  0x00007ff9256497fc abort (libc.so.6 + 0x267fc)
                                          #3  0x00007ff926076047 log_assert_failed (libsystemd-shared-253.so + 0x276047)
                                          #4  0x00007ff9260ab317 strv_find (libsystemd-shared-253.so + 0x2ab317)
                                          #5  0x0000000000405927 parse_one_option (systemd-cryptsetup + 0x5927)
                                          #6  0x0000000000407793 parse_options (systemd-cryptsetup + 0x7793)
                                          #7  0x000000000040fa0c run (systemd-cryptsetup + 0xfa0c)
                                          #8  0x000000000041137f main (systemd-cryptsetup + 0x1137f)
                                          #9  0x00007ff92564a510 __libc_start_call_main (libc.so.6 + 0x27510)
                                          #10 0x00007ff92564a5c9 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x275c9)
                                          #11 0x0000000000403915 _start (systemd-cryptsetup + 0x3915)
                                          ELF object binary architecture: AMD x86-64
2023-06-05 16:50:13 +02:00
Frantisek Sumsal
168ccb879f test: clean up the test cleanup a bit 2023-06-05 16:50:13 +02:00
Frantisek Sumsal
00c2676972 test: minor cleanup
No functional change.
2023-06-05 16:50:13 +02:00
Frantisek Sumsal
b7e913841b test: make the data partition larger for the cryptsetup test
As we use it for /var and with the default 100 MiB there's not enough
space for the journal.
2023-06-05 16:50:13 +02:00
Frantisek Sumsal
0334afe4d0 test: make the root/data partition size configurable per test 2023-06-05 16:50:13 +02:00
Frantisek Sumsal
70bdf6e661 test: introduce test_require_bin() and use it
No functional change.
2023-06-05 16:50:13 +02:00
Frantisek Sumsal
97d7af86b5 test: fix indentation 2023-06-05 16:50:13 +02:00
Frantisek Sumsal
18fa5c8283 test: move TPM2-related setup stuff into test-functions
And hide it all behind $TEST_SETUP_SWTPM.
2023-06-05 16:50:13 +02:00
Zbigniew Jędrzejewski-Szmek
c4fc25463e ukify: make code pylint clean
The linter is imperfect, but it is useful as a very quick
check for typos and other silly mistakes. Add a few annotations
and do one small change to make it think the code is perfect.
2023-06-05 16:07:52 +02:00
Zbigniew Jędrzejewski-Szmek
1ab32e8aaf
Merge pull request #27871 from yuwata/udevadm-verify-downgrade-style-issues
udevadm-verify: downgrade log level about style issues
2023-06-05 16:07:19 +02:00
Zbigniew Jędrzejewski-Szmek
7dc3c94245
Merge pull request #27924 from poettering/low-battery-tool
ac-power: expose low battery state via systemd-ac-power
2023-06-05 16:03:57 +02:00
Frantisek Sumsal
0efa27bd4b test: allow running only specified subtests/testcases
Useful when debugging, e.g.:

make -C test/TEST-74-AUX-UTILS clean setup run TEST_MATCH_SUBTEST=run

Resolves: #27914
2023-06-05 15:58:37 +02:00
Daan De Meyer
94d74c9cd7 test: Test --offline= in TEST-58-REPART
Instead of using a privileged and unprivileged user to test the
offline and online logic of systemd-repart, let's always run repart
as root and use the --offline= argument to specify repart to use
either the offline or online logic.
2023-06-05 15:29:47 +02:00
Lennart Poettering
24945c28db man: parition → partition typo fix
Follow-up for: #27848
2023-06-05 14:05:49 +02:00
Daan De Meyer
fc10b158ef repart: Add --offline argument
This allows the user to explicit configure whether loop devices
should be used to build the image or not.
2023-06-05 13:56:49 +02:00
Lennart Poettering
7f1520c6a1 ac-power: add --low switch to systemd-ac-power tool
This allows checking from shell scripts whether the system is in a low
battery state. It just exposed the code we anyway have in a directly
accessible way.

This is also very useful for testing things.
2023-06-05 12:21:28 +02:00
Lennart Poettering
c41e3605ec battery-util: be more careful when determining whether we are in a low battery state
Let's avoid assuming a low battery battery state if in doubt. That
means, handle errors reading battery state gracefully.
2023-06-05 12:20:41 +02:00
Lennart Poettering
319c46483e battery-util: move battery_is_discharging_and_low() to battery-util.[ch]
This moves a first batch of functions from sleep-config.[ch] over to
battery-util.[ch].

In the long run we should probably move even more stuff over, i.e.
anything that deals with the battery sysfs driver interface.

No code change.
2023-06-05 12:19:32 +02:00