1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-09 12:58:26 +03:00

60135 Commits

Author SHA1 Message Date
Frantisek Sumsal
bb0f817abf test: wait until the unit finishes before checking the log
Otherwise we might read an incomplete log and fail:

```
test_added_after (__main__.ExecutionResumeTest) ... FAIL
test_added_before (__main__.ExecutionResumeTest) ... ok
test_interleaved (__main__.ExecutionResumeTest) ... ok
test_issue_6533 (__main__.ExecutionResumeTest) ... ok
test_no_change (__main__.ExecutionResumeTest) ... ok
test_removal (__main__.ExecutionResumeTest) ... ok
test_swapped (__main__.ExecutionResumeTest) ... ok

======================================================================
FAIL: test_added_after (__main__.ExecutionResumeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/./test/test-exec-deserialization.py", line 152, in test_added_after
    self.check_output(expected_output)
  File "/build/./test/test-exec-deserialization.py", line 107, in check_output
    self.assertEqual(output, expected_output)
AssertionError: 'foo\n' != 'foo\nbar\n'
  foo
+ bar

----------------------------------------------------------------------
Ran 7 tests in 27.470s
```
2022-09-30 18:47:09 +09:00
Frantisek Sumsal
842a9d5f91 test: kill the machine on oops/panic/soft_lockup
Otherwise the machine will hang on the panic until the timeout happens,
which might waste quite a considerable amount of time in certain cases.
2022-09-30 18:46:30 +09:00
Adam Williamson
950aeeb8ff kbd-model-map: correct variants for cz-qwerty to include comma
As explained by @poncovka , the 'xvariant' string should contain
the same number of comma-separated elements as 'xlayout'. When
we have two layouts we need two items in xvariant, in this case
one of them is empty.

See https://github.com/rhinstaller/anaconda/pull/4355#pullrequestreview-1119913870
for @poncovka's full explanation.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2022-09-29 23:53:26 +01:00
Frantisek Sumsal
9b2e40a885
Merge pull request #24865 from yuwata/udevadm-tweaks
udevadm: fix misleading error message
2022-09-30 00:01:48 +02:00
JeroenHD
792c779f7d
Add special keyboard combos for Thinkpad P1 Gen 3 (#24862)
* Add special keyboard combos for Thinkpad P1 Gen 3

These are based on the key codes I've found with evtest. See issue
https://github.com/systemd/systemd/issues/24814 for more details.

I'm not entirely sure what some of these keys are supposed to do,
notably Fn+RShift; this doesn't seem to do anything in Windows on
my machine. Binding them to prog# makes them available to desktop
managers' key bindings at least, in case someone wishes to make
use of this extra keybind possibility.
2022-09-29 21:23:42 +01:00
Yu Watanabe
ad8c442a0b test-64-udev-storage: use wait command instead of hackish "udevadm lock true"
Otherwise, "udevadm lock true" may lock a block device earlier than
"udevadm lock sfdisk &".
2022-09-30 03:42:05 +09:00
Yu Watanabe
4273a041f1 udevadm: do not try to find device unit when a path like string is provided
Otherwise, we provide misleading error message.
Before:
---
$ udevadm info /sys/class/foo
Bad argument "/sys/class/foo", expected an absolute path in /dev/ or /sys/ or a unit name: Invalid argument
---
After:
---
$ udevadm info /sys/class/foo
Unknown device "/sys/class/foo": No such device
---
2022-09-30 02:05:09 +09:00
Zbigniew Jędrzejewski-Szmek
3efadceb9e docs/CONTRIBUTING: explain various labels and add link to "reviewable" PRs
The linked filter gives an up-to-date list of pull requests that need review.
(Yes, there's too many.) We used to set 'needs-review' label, but that is
not available to non-members, and also every pull requests which is not labeled
'reviewed/needs-rework'/'ci-fails/needs-rework'/'needs-rebase' can and should
be reviewed.

If this is merged, I'll drop the 'needs-review' label.
2022-09-30 01:23:30 +09:00
Frantisek Sumsal
fa21a2cf9f test: bump the reattach timeout when running w/ plain QEMU
As it might sometimes take slightly longer without the acceleration:

```
[  176.805681] testsuite-29.sh[534]: + cp /usr/share/app1.raw /tmp/app1_2.raw
[  176.885365] testsuite-29.sh[534]: + timeout 30 portablectl reattach --now --runtime --extension /tmp/app1_2.raw /usr/share/minimal_1.raw app1
[  177.053358] portablectl[993]: (Matching unit files with prefixes 'app1'.)
[  177.138770] kernel: loop0: detected capacity change from 0 to 2965504
[  177.343137] kernel: loop1: detected capacity change from 0 to 4096
...
[  201.932062] systemd[1]: app1.service: Deactivated successfully.
[  202.009310] systemd[1]: Stopped app1.service.
[  202.053776] systemd[1]: app1.service: Consumed 2.183s CPU time.
[  202.125061] systemd[1]: Stopping app1.service...
[  202.611760] systemd[1]: Starting modprobe@dm_mod.service...
[  202.851031] systemd[1]: Starting modprobe@dm_verity.service...
[  202.909352] systemd[1]: Starting modprobe@loop.service...
[  203.198918] systemd[1]: Starting app1.service...
[  207.145494] kernel: audit: type=1130 audit(1663770336.105:428): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=testsuite-29 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
[  207.652545] systemd[1]: testsuite-29.service: Main process exited, code=exited, status=124/n/a
[  207.665088] systemd[1]: testsuite-29.service: Failed with result 'exit-code'.
[  207.830522] systemd[1]: Failed to start testsuite-29.service.
...
[  208.889449] script1.sh[1035]: ID="centos"
[  208.889449] script1.sh[1035]: VERSION_ID="8"
[  208.889449] script1.sh[1035]: SYSEXT_SCOPE=portable
[  208.889449] script1.sh[1035]: PORTABLE_PREFIXES=app1
...
[  214.155097] systemd[1]: app1.service: Deactivated successfully.
```

Spotted in Ubuntu CI and CentOS CI.

Follow-up to 706c9a30ac.
2022-09-30 00:16:45 +09:00
Jan Janssen
957dfcc96d stub: Remove unused function parameter 2022-09-29 10:30:37 +02:00
Lennart Poettering
1aefb25f37 resolved: paranoia: restrict socket mode as much as we can 2022-09-29 00:42:14 +01:00
Frantisek Sumsal
5ad1513845 test: wrap ls and stat to make it work w/ sanitizers in specific cases
When `/etc/nsswitch.conf` uses `systemd` together with `[SUCCESS=merge]`,
`ls -l` will pull in `libnss_systemd` causing `SIGABRT`, as `ls` is not
instrumented (by default):

```
-bash-5.1# strace -f -e %file ls -l /dev
execve("/usr/bin/ls", ["ls", "-l", "/dev"], 0x7ffc3bb211c8 /* 24 vars*/) = 0
...
openat(AT_FDCWD, "/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=1896, ...}, AT_EMPTY_PATH) = 0
newfstatat(AT_FDCWD, "/etc/nsswitch.conf", {st_mode=S_IFREG|0644, st_size=359, ...}, 0) = 0
openat(AT_FDCWD, "/etc/group", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=965, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=10779, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/usr/lib/libnss_systemd.so.2", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=16195176, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/usr/lib/libasan.so.8", O_RDONLY|O_CLOEXEC) = 3
...
readlink("/proc/self/exe", "/usr/bin/ls", 4096) = 11
open("/proc/self/cmdline", O_RDONLY)    = 3
open("/proc/self/environ", O_RDONLY)    = 3
==620==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=620, si_uid=0} ---
+++ killed by SIGABRT (core dumped) +++
Aborted (core dumped)
```

This also happens with `stat`. Let's add both `ls` and `stat` to the "wrap list"
to work around this.

Spotted on Arch Linux.
2022-09-28 22:39:18 +01:00
Lennart Poettering
5cf4b2e597 resolvectl: add line breaks for readability 2022-09-28 23:03:58 +02:00
Lennart Poettering
411d095d79 resolved: don't access sshfp fields from tlsa printer 2022-09-28 22:52:05 +02:00
Lennart Poettering
43bd70d584 resolved: return regular varlink invalid parameter error if more is not specified on monitor call
No point in returning EINVAL if we can just return a proper varlink
invalid parameter error
2022-09-28 22:51:51 +02:00
Lennart Poettering
63fe457c1b resolved: fix parameter reuse in DNS_ANSWER_FOREACH_ITEM() iterator macro 2022-09-28 22:51:36 +02:00
Frantisek Sumsal
07faa4990f test: fix a copy-paste error 2022-09-28 14:03:03 +02:00
Daan De Meyer
4c35aed7f0
Merge pull request #24837 from yuwata/kernel-install
kernel-install: two fixlets
2022-09-28 10:50:55 +02:00
Yu Watanabe
c5654483dc fuzz: tighten acceptable data size
Fixes oss-fuzz#51887 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51887).
Fixes #24833.
2022-09-28 09:12:36 +02:00
Sarah Brofeldt
f8151a707c docs/NETWORK_ONLINE: systemd.network hyperlink fix 2022-09-28 15:48:39 +09:00
Yu Watanabe
c561c78063 kernel-install: do not fail if a plugin exits with 77 2022-09-28 13:36:38 +09:00
Yu Watanabe
46f347ada3 kernel-install: do not fail if $layout is not "bls"
Fixes #24836.
2022-09-28 13:36:29 +09:00
msizanoen1
b49e029a99 resolve: persist DNSOverTLS configuration in state file
Currently, NetworkManager will set DNSOverTLS according to its
`connection.dnsovertls` configuration only once during connection,
instead of every single restart of systemd-resolved, causing resolved to
lose the configuration on restart.

Fix this by persisting DNSOverTLS in the runtime state file, which will
also make it more consistent with other interface-specific settings.
2022-09-28 08:09:06 +09:00
Edson Juliano Drosdeck
f58ab54a2b
hwdb: fix Positivo-vaio FE14 V2 key toggle touchpad #24822 (#24825) 2022-09-28 08:06:34 +09:00
Luca Boccassi
0e26016e3d resolved notifications: follow-up fixes
Further review comments from: https://github.com/systemd/systemd/pull/22845
2022-09-27 22:34:17 +01:00
Yu Watanabe
a13231a904
Merge pull request #24832 from mrc0mmand/more-TEST-64-tweaks
A couple of performance tweaks for TEST-64 under QEMU
2022-09-28 02:26:55 +09:00
Frantisek Sumsal
998fb5c5e3 test: use fewer partitions/LVs when running with plain QEMU 2022-09-27 15:10:18 +02:00
Frantisek Sumsal
90743af65d test: make the symlink helpers a bit more quiet
and show only errors/warnings.
2022-09-27 15:10:18 +02:00
Frantisek Sumsal
d6ef4ebbda test: ignore tty* devices when checking device units
This lower the runtime of `check_device_units()` in a plain QEMU VM from
~45 seconds to ~25 seconds.
2022-09-27 15:10:18 +02:00
Frantisek Sumsal
dd2b99ee7f test: lower the # of iterations when running with plain QEMU 2022-09-27 15:10:18 +02:00
Frantisek Sumsal
d9e1cb288f test: support open-iscsi >= 2.1.2
Since open-iscsi 2.1.2 [0] the initiator name should be generated via
a one-time service instead of distro package's post-install scripts.
However, some distros still use this approach even after this patch,
so prefer the already existing initiatorname.iscsi file if it exists.

[0] f37d5b653f
2022-09-27 13:24:32 +02:00
Lennart Poettering
dd51b0f952
Merge pull request #24805 from yuwata/sd-network
sd-network: several cleanups
2022-09-27 11:28:25 +02:00
Richard Phibel
8aa3894eae systemctl: add support for --image option
All tools that support --root= should also learn --image=
so that they can operate on disk images directly.
2022-09-27 09:47:01 +02:00
Yu Watanabe
b577d5569d
Merge pull request #24812 from yuwata/udev-drop-netlink
udev: drop workaround for slow read of phys_port_name sysattr
2022-09-27 14:10:02 +09:00
Yu Watanabe
e05dd7718d sd-network: make sd_network_link_get_dns() or friends return -ENODATA
To make them consistent with other functions.
2022-09-27 10:42:31 +09:00
Yu Watanabe
778e3da95e sd-network: drop fallback values
This drops spurious lines in `networkctl status` for unmanaged interfaces.
Before:
```
$ networkctl status --lines 0 lo
● 1: lo
                     Link File: n/a
                  Network File: n/a
                          Type: loopback
                         State: carrier (unmanaged)
                  Online state: unknown
                    HW Address: 00:00:00:00:00:00
                           MTU: 65536
                         QDisc: noqueue
  IPv6 Address Generation Mode: eui64
          Queue Length (Tx/Rx): 1/1
                       Address: 127.0.0.1
                                ::1
             Activation Policy: up
           Required For Online: yes
```
After:
```
$ networkctl status --lines 0 lo
● 1: lo
                     Link File: n/a
                  Network File: n/a
                         State: carrier (unmanaged)
                  Online state: unknown
                          Type: loopback
              Hardware Address: 00:00:00:00:00:00
                           MTU: 65536
                         QDisc: noqueue
  IPv6 Address Generation Mode: eui64
      Number of Queues (Tx/Rx): 1/1
                       Address: 127.0.0.1
                                ::1
```

That is, the lines for Activation Policy and Required For Online are
dropped.
2022-09-27 10:42:31 +09:00
Yu Watanabe
c9d22489ca sd-network: introduce network_link_get_boolean() helper function 2022-09-27 10:42:31 +09:00
Yu Watanabe
27b13df45a sd-network: accept all space-like separators 2022-09-27 10:42:31 +09:00
Yu Watanabe
ce2e75021c sd-network: propagate -ENOENT
On -ENOENT, it suggests that network-manager is not running, and
interfaces are not unmanaged. Such information may be useful for
callers.
2022-09-27 10:42:31 +09:00
Yu Watanabe
e7c1b3f73a sd-network: rename function arguments for storing return value 2022-09-27 10:42:27 +09:00
Yu Watanabe
f1d07d83ab networkctl: use table_add_string_line() at one more place 2022-09-27 10:41:21 +09:00
Yu Watanabe
8f60c998ab networkctl: handle all errors in sd_network_link_get_setup_state() as "unmanaged"
We have already ignored all errors in other fields.
2022-09-27 10:41:13 +09:00
Yu Watanabe
5bbcfbaa11 udev: drop workaround for slow read of phys_port_name sysattr
TL;DR
This effectively reverts 8327fd1b11c5fb6529d46dfb40e2af981ffa8545,
eaba9bb3e69635d2c490c5e1b0d262b763753e1d, and its follow-ups, as the
original issue was already fixed by the kernel side.

The original issue that the above commits tried to 'fix' is that reading
phys_port_name triggers a lock in the kernel, hence processing multiple
interfaces at the same time causes extreme slow down.
To workaround the issue, the above commits made several necessary
information retrieved through netlink instead of sysfs attributes.

A patch set for the kernel was proposed as a fix for the issue:
https://lore.kernel.org/all/20210928125500.167943-1-atenart@kernel.org/
and some of them were merged to v5.16:
146e5e7333,
It has been already backported to 5.4.160, 5.10.80, 5.14.19, and 5.15.3.

When these commits were proposed, it is already claimed that such issue
should be fixed by the kernel side, and udevd should not workaround it.
Neverthless the feature was introduced, as these have theoretical
performance improvement, even if phys_port_name sysattr does not have the
above issue, as in that way udevd can obtain multiple information about
the interface with a single netlink socket operation. See the discussion
in #20744.

However, in reality, only `iflink`, `type`, `address`, and `phys_port_name`
attributes from netlink are used in the udev net_id builtin command. Hence,
after the original issue being fixed in the kernel side, there should be
almost no performance improvement for udevd.
Furthermore, combining attributes from netlink and sysfs makes hard to
test net_id builtin. See #21725.

Let's drop mostly meaningless code, and make net_id builtin easily testable.

Closes #21725.
2022-09-27 10:01:46 +09:00
Lennart Poettering
fc70944301 man: document that setting Storage= in namespaces journald menas LogDirectory= in unit file needs setting too
Replaces: #24789
2022-09-26 19:29:49 +01:00
Lennart Poettering
d57e43ad28
Merge pull request #24757 from yuwata/sd-device-get-child-first
sd-device: introduce sd_device_get_child_first() and _next()
2022-09-26 19:03:15 +02:00
Lennart Poettering
09d2ab7e1b
Merge pull request #24808 from medhefgo/fuzz
fuzz: Add fuzzer for some efi string functions
2022-09-26 18:37:08 +02:00
Topi Miettinen
75723d31a6 units: udev: partially emulate ProtectClock=
Drop CAP_SYS_TIME and CAP_WAKE_ALARM capabilities and block clock-related
system calls. Update TODO.
2022-09-26 11:40:28 +02:00
Lennart Poettering
eb8817db6e update TODO 2022-09-26 10:06:11 +02:00
Jan Janssen
af4b8cef38 boot: Make efi_fnmatch non-backtracking 2022-09-25 14:26:00 +02:00
Jan Janssen
ac37f132a1 fuzz: Add fuzzer for some efi string functions 2022-09-25 14:26:00 +02:00