1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00
Commit Graph

60698 Commits

Author SHA1 Message Date
Frantisek Sumsal
60fbeb0b14 test: fix keymaps installation on Arch
Where the keymaps live under /usr/share/kbd/keymaps/.

(cherry picked from commit 1edad89399)
2022-11-08 14:59:01 +01:00
Frantisek Sumsal
bc9a97d507 test: fix locale installation when locale-gen is used
locale-gen might merge all compiled locales into a simple archive, so we
need to install it as well if necessary.

(cherry picked from commit 0c416ea01b)
2022-11-08 14:59:01 +01:00
Frantisek Sumsal
639b416c01 test: don't ignore non-existent paths in inst_recursive()
The process substitution in the while loop hides errors raised by the
find utility, which might (and did), in turn, hide errors in test setup.

(cherry picked from commit eb5d7730e1)
2022-11-08 14:59:01 +01:00
Christian Göttsche
7c98589bb1 loop-util: open lock fd read-only
flock(2) works with file descriptors opened with O_RDONLY.

This affects SELinux systems where access to block devices is quite
restricted to avoid bypasses on filesystem objects.

(cherry picked from commit 3e6b7d2626)
2022-11-08 14:59:01 +01:00
Christian Göttsche
2b2845ef6b test: fstab-generator: adjust PATH for fsck
fsck(8) is located in /usr/sib/ on Debian sid:

    stdout:
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-01-dev-nfs.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-02-dhcp.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-03-dhcp6.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-04-nfs.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-05-nfs4.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-06-ipv4.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-07-ipv6.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-08-implicit-nfs.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-09-cifs.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-10-iscsi.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-11-live.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-12-dev-sdx.input
    --- /dev/fd/63  2022-11-04 15:39:13.131532174 +0100
    +++ /dev/fd/62  2022-11-04 15:39:13.131532174 +0100
    @@ -6,3 +6,4 @@
     initrd-usr-fs.target.requires
     initrd-usr-fs.target.requires/sysroot.mount
     sysroot.mount
    +systemd-fsck-root.service
    **** Unexpected output for /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-12-dev-sdx.input
    stderr:
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on CIFS was requested.
    Skipping root directory handling, as root on iSCSI was requested.
    Skipping root directory handling, as root on live image was requested.
    Found entry what=/dev/sdx1 where=/sysroot type=n/a opts=ro
    Checking was requested for /dev/sdx1, but the fsck command does not exist.

(cherry picked from commit a45efc9e4b)
2022-11-08 14:59:01 +01:00
Zbigniew Jędrzejewski-Szmek
dbed9051f7 man: add note that network-generator is not a generator
Also fix indentation.

(cherry picked from commit 2fa6574e83)
2022-11-08 14:59:01 +01:00
Luca Boccassi
30a120e393 kernel-install: skip 50-depmod if depmod is not available
Images might be built without any kernel module, and without
installing depmod as it is not needed. Skip it.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023607
(cherry picked from commit cda4d00dfc)
2022-11-07 22:35:33 +00:00
Antonio Alvarez Feijoo
2ac1203296 kernel-install/90-loaderentry: do not override an existing systemd.machine_id
If the systemd.machine_id command line option is already set, do not override
it.

(cherry picked from commit 802d9219aa)
2022-11-07 22:35:33 +00:00
Frantisek Sumsal
31cfa1cc96 semaphore: remove the Semaphore repositories recursively
The list of disabled repositories was recently converted from a single
file into a directory with separate repository files, so let's adjust
the setup script accordingly.

```
$ ls -lR /etc/apt/sources.list.d/
/etc/apt/sources.list.d/:
total 36
-rw-r--r-- 1 root root   76 Nov  3 10:28 azure-cli.list
-rw-r--r-- 1 root root   72 Nov  3 10:22 bazel.list
drwxr-xr-x 2 root root 4096 Nov  3 10:31 disabled
-rw-r--r-- 1 root root  113 Nov  3 10:13 docker-source.list
-rw-r--r-- 1 root root  367 Nov  3 10:28 github_git-lfs.list
-rw-r--r-- 1 root root  111 Nov  3 10:25 google-chrome-source.list
-rw-r--r-- 1 root root   64 Nov  3 10:14 google-cloud-sdk.list
-rw-r--r-- 1 root root   54 Nov  3 10:23 helm-stable-debian.list
-rw-r--r-- 1 root root   89 Nov  3 10:29 yarn-source.list

/etc/apt/sources.list.d/disabled:
total 20
-rw-r--r-- 1 root root 100 Nov  3 10:23 devel_kubic_libcontainers_stable.list
-rw-r--r-- 1 root root 103 Nov  3 10:27 git.list
-rw-r--r-- 1 root root 105 Nov  3 10:22 gradle.list
-rw-r--r-- 1 root root 118 Nov  3 10:13 pypy.list
-rw-r--r-- 1 root root 104 Nov  3 10:13 python.list
```

(cherry picked from commit 610eb3f826)
2022-11-07 19:01:47 +00:00
Daan De Meyer
1757446e8b condition: Check that subsystem is enabled in ConditionSecurity=tpm2
Instead of succeeding when either the firmware reports a TPM device
or we find a TPM device, let's check that the firmware reports a TPM
device and the TPM subsystem is enabled in the kernel.

To check whether the subsystem enabled, we check if the relevant
subdirectory in /sys exists at all.

(cherry picked from commit 300bba79c2)
2022-11-07 13:16:26 +00:00
Antonio Alvarez Feijoo
80f91fcb19 kernel-install/90-loaderentry: do not add multiple systemd.machine_id options
Do not unconditionally add a new systemd.machine_id command line option, first
check if it already exists with the expected value.

Fixes #25203

(cherry picked from commit 981502c5cc)
2022-11-04 23:31:28 +00:00
Luca Boccassi
c4131c39c6 tmpfiles.d: do not fail if provision.conf fails
On a read-only filesystem creating /root/.ssh might fail, but that's ok.
Do not fail the run, as this is only needed to add the credential, which
is a separate step.

(cherry picked from commit e0fc9be37e)
2022-11-04 23:31:28 +00:00
Franck Bui
cf23a522b2 tests: minor simplification in test-execute
No functional change.

(cherry picked from commit 09415aef94)
2022-11-04 23:31:28 +00:00
Franck Bui
64036ee871 tests: make test-execute pass on openSUSE
In my understanding user group "3" (aka "sys") is kept for historical reasons
but not really useful these days. That's probably explained why this group
isn't defined on openSUSE.

Hence let's drop reference to this user group, this shouldn't lessen the
revelance of the test since SupplementaryGroups= is still tested with 2 other
groups.

(cherry picked from commit d723b0467d)
2022-11-04 23:31:28 +00:00
Luca Boccassi
a693cba0c3 firstboot: fix segfault when --locale-messages= is passed without --locale=
\#0  __strcmp_evex () at ../sysdeps/x86_64/multiarch/strcmp-evex.S:295
No locals.
\#1  0x0000557444eb172b in process_locale () at ../src/firstboot/firstboot.c:342
        etc_localeconf = 0x7ffd40217b80 "/root/root/etc/locale.conf"
        locales = {0x0, 0x0, 0x0}
        i = 0
        r = <optimized out>
        __PRETTY_FUNCTION__ = "process_locale"
        __func__ = "process_locale"
\#2  0x0000557444eaff93 in run (argv=0x7ffd40217d98, argc=3) at ../src/firstboot/firstboot.c:1401
        loop_device = 0x0
        unlink_dir = 0x0
        r = <optimized out>
        loop_device = <optimized out>
        unlink_dir = <optimized out>
        r = <optimized out>
        __func__ = <optimized out>
        __PRETTY_FUNCTION__ = <optimized out>
        enabled = <optimized out>
        _error = <optimized out>
        _level = <optimized out>
        _e = <optimized out>
        _level = <optimized out>
        _e = <optimized out>
\#3  main (argc=3, argv=0x7ffd40217d98) at ../src/firstboot/firstboot.c:1432
        r = <optimized out>
        __PRETTY_FUNCTION__ = "main"

Fixes https://github.com/systemd/systemd/issues/25249

(cherry picked from commit 4c4a73ce06)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
85cf0a962e test: introduce sanity coverage for auxiliary utils
(cherry picked from commit d1020334fd)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
52db431bdf test: cover a couple of previously missed analyze code paths
(cherry picked from commit 8b1879bcd0)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
9a94348ee8 test: cover legacy/deprecated systemd-analyze verbs
They're no longer documented since 26e1e97345 but still work.

(cherry picked from commit 926d95cd4c)
2022-11-04 23:31:28 +00:00
Yu Watanabe
46a301accd udev: add safe guard for setting by-id symlink
The ID_BUS property is necessary for creating by-id symlinks.

(cherry picked from commit 5286da064c)
2022-11-04 23:31:28 +00:00
Yu Watanabe
3d2f0c5b8a udev: drop redundant call of usb_id and assignment of ID_USB_INTERFACE_NUM
The usb_id builtin command is already called in the above, and the
command sets the ID_USB_INTERFACE_NUM property.

(cherry picked from commit b2e53f5a0f)
2022-11-04 23:31:28 +00:00
Yu Watanabe
dafd73367b udev: first set properties based on usb subsystem
After 479da1107a, the usb_id builtin
command does not set ID_SERIAL if ID_BUS is already set.
Before the commit, all properties set based on pci bus were overwritten
by the usb_id, hence now it is sufficient setting them only when ID_BUS is
not set yet.

Fixes #25238.

(cherry picked from commit 01e704eba9)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
91d83b6e4e test: add a sanity coverage for systemd-analyze verbs
(cherry picked from commit 6c83054c01)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
30ec52a92a test: further extend systemctl's sanity coverage
Also, fix a race condition introduced by d16684fe13:
```
[   16.904218] H testsuite-26.sh[394]: + systemd-run --unit failed.service /bin/false
[   16.964783] H systemd[845]: failed.service: Executing: /bin/false
[   16.965062] H systemd[1]: Started failed.service.
[   16.965462] H testsuite-26.sh[844]: Running as unit: failed.service
[   16.966390] H testsuite-26.sh[394]: + systemctl is-failed failed.service
[   16.977970] H testsuite-26.sh[846]: active
[   16.978403] H systemd[1]: failed.service: Main process exited, code=exited, status=1/FAILURE
[   16.978478] H systemd[1]: failed.service: Failed with result 'exit-code'.
```

(cherry picked from commit 23f3a6f5ff)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
35e19c1a50 man: use the correct 'Markers' property name for marking units
Follow-up to c9615f7352 and 70666e28a1.

(cherry picked from commit 1ca1bb03de)
2022-11-04 23:31:28 +00:00
Yu Watanabe
132fed3dcd core: fix memleak in GetUnitFileLinks method
(cherry picked from commit a12ba535fa)
2022-11-04 23:31:28 +00:00
Luca Boccassi
0b9201866c docs: DPS and BLS have moved to uapi-group.org
(cherry picked from commit 729a492881)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
77860d006d test: add a couple of sanity tests for systemctl
(cherry picked from commit d16684fe13)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
bcf30f9170 test: rename TEST-26-SETENV to TEST-26-SYSTEMCTL
(cherry picked from commit c5c258ae0a)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
86d031095e test: add a couple of sanity tests for loginctl
(cherry picked from commit 70e9066bc2)
2022-11-04 23:31:28 +00:00
Daan De Meyer
077a1d54b3 namespace: Add hidepid/subset support check
Using fsopen()/fsconfig(), we can check if hidepid/subset are supported to
avoid the noisy logs from the kernel if they aren't supported. This works
on centos/redhat 8 as well since they've backported fsopen()/fsconfig().

(cherry picked from commit 1c265fcd59)
2022-11-04 23:31:28 +00:00
Jan Janssen
bb1ae9bcd3 coverage: Mark _coverage__exit as noreturn
../src/basic/coverage.h:15:48: warning: function '_coverage__exit' could
be declared with attribute 'noreturn' [-Wmissing-noreturn]

(cherry picked from commit 0bab5534b3)
2022-11-04 23:31:28 +00:00
Youfu Zhang
95595e2842 resolved: fix typo in feature level table
(cherry picked from commit 2ab0042854)
2022-11-04 23:31:28 +00:00
Yu Watanabe
dda23814f0 parse_hwdb: allow negative value for EVDEV_ABS_ properties
(cherry picked from commit f0b75cda5a)
2022-11-04 23:31:28 +00:00
Luca Boccassi
e8a17df063 test: add +x to assert.sh
The script has a shebang and .sh extension, so make it executable

W: systemd-tests: script-not-executable [usr/lib/systemd/tests/testdata/units/assert.sh]
(cherry picked from commit fb4f7271d9)
2022-11-04 23:31:28 +00:00
Luca Boccassi
8aaa4e05a3 man: fix typo found by Lintian
(cherry picked from commit 84033dd405)
2022-11-04 23:31:28 +00:00
Frantisek Sumsal
0508cd3b00 test: add a couple of sanity tests for journalctl
(cherry picked from commit ca46781c5f)
2022-11-04 23:31:28 +00:00
Yu Watanabe
2851146817 macro: fix indentation
(cherry picked from commit e967926b09)
2022-11-04 23:31:28 +00:00
Jan Janssen
243c76d6cf macro: Simply case macros for IN_SET
The CASE param would normally provide the operation for the compiler to
do in this macro magic. But in this case CASE_F_1 was hardcoding the
operation, making the parameter moot.
This just removes the somewhat pointless parameter instead of fixing
the one case. These macros are used for IN_SET case labels only and
not named generically anyways.

(cherry picked from commit 790f4dda74)
2022-11-04 23:31:28 +00:00
Jan Janssen
4ef0b45a8a macro: Use more correct type in IN_SET
This will now catch mistakes like this:
    struct s {
            int i:2;
    } s = { 1 };
    assert_se(IN_SET(s.i, ULLONG_MAX));

> warning: implicit conversion from 'unsigned long long' to
> 'typeof (+s.i)' (aka 'int') changes value from 18446744073709551615
> to -1 [-Wconstant-conversion]

(cherry picked from commit 0bc4ac526d)
2022-11-04 23:31:28 +00:00
Release o'Lantern
e8dc52766e Finalise 👻 SpOoOky 👻 NEWS for v252 2022-10-31 18:59:18 +00:00
Luca Boccassi
6f96359dfc Disable code freeze banner 2022-10-31 18:57:13 +00:00
Luca Boccassi
eabbb24a9f
Merge pull request #25202 from poettering/measure-phase-fix
measure: honour phases when signing
2022-10-31 19:50:31 +01:00
Luca Boccassi
b13f0d0d0d
Merge pull request #25200 from bluca/news
Update NEWS, hwdb
2022-10-31 16:53:10 +01:00
Lennart Poettering
2e6a0579cc measure: honour phases when signing 2022-10-31 16:52:00 +01:00
Lennart Poettering
28acd1e6c3 measure: banks and phases list are always non-empty
When parsing parameters, we populate these lists with defaults when
empty, hence we can rely that there's at least one bank and one phase
defined.
2022-10-31 16:51:12 +01:00
Lennart Poettering
6032283b2f resolved: fix copypasta in resolved varlink API
As reported by @holtmann
2022-10-31 14:57:35 +01:00
Luca Boccassi
1ba770a659 Update hwdb
ninja -C build update-hwdb
2022-10-31 12:15:16 +00:00
Luca Boccassi
ea3e581d39 Update NEWS with latest changes 2022-10-31 12:15:16 +00:00
Luca Boccassi
f3e70c8ae5 NEWS: update contributors list 2022-10-31 11:59:57 +00:00
Luca Boccassi
38c6289d6b
Merge pull request #25197 from weblate/weblate-systemd-master
Translations update from Fedora Weblate
2022-10-31 12:54:24 +01:00