Commit Graph
52601 Commits
Author SHA1 Message Date
Lennart Poettering e8b08edcdf tree-wide: use memmem_safe()
Let's be paranoid and do something useful if we operate with empty
haystack/needle. This doesn't actually fix anything, as the places as
far as I can see check for non-emptyness already beforehand, but I will
sleep safer at night, if we don't even allow the trap to be fallen in,
ever, even if the code is changed sooner or later.
2021-08-10 14:55:50 +02:00
Lennart Poettering d8782cc5c2 memory-util: add mempmem_safe()
This is like memmem_safe() but returns a pointer after the needle,
instead to the beginning of the needle.

This is then used at one place. Not much, but it makes me sleep safer at
night, as it avoids the manual counting done so far.
2021-08-10 14:55:50 +02:00
Zbigniew Jędrzejewski-Szmek b2efed520b fstab-generator: put What= before Where=
All units in units/ follow this pattern, as do all other generators that we
provide. The question of the order was raised in
https://github.com/systemd/zram-generator/pull/90#discussion_r684965984,
and I think it's nice to make it consistent everywhere
(What= before Where= matches mount(8) and fstab(5)).
2021-08-10 13:29:08 +02:00
Lennart Poettering a7a04de0ec Merge pull request #19959 from yuwata/udev-reduce-loop
udev: reduce number of times checking event dependency
2021-08-10 13:28:48 +02:00
Yu Watanabe 76b34df91f Merge pull request #20410 from yuwata/network-ndisc-cleanups
network: several NDisc cleanups
2021-08-10 19:44:39 +09:00
Yu Watanabe 8fd9920273 Merge pull request #19939 from yuwata/network-dhcp-client-use-request-queue
network: use request queue to configure DHCP clients
2021-08-10 19:44:14 +09:00
Yu Watanabe 5e739f7eed Merge pull request #19901 from yuwata/network-reconfigure-after-sleep
network: reconfigure interface after coming back from sleep
2021-08-10 19:43:54 +09:00
Yu Watanabe c6f78234d1 udev: skip event when its dependency cannot be checked 2021-08-10 15:35:57 +09:00
Yu Watanabe 044ac33c35 udev: do not try to find blocker again when no blocker found previously 2021-08-10 15:35:01 +09:00
Yu Watanabe bd335c961f list: introduce LIST_FOREACH_BACKWARDS() macro and drop LIST_FOREACH_AFTER/BEFORE() 2021-08-10 15:32:27 +09:00
Yu Watanabe a1fa99d841 udev: rename is_device_busy() -> event_is_blocked()
Also this rename delaying_seqnum -> blocker_seqnum.
2021-08-10 15:19:41 +09:00
Yu Watanabe 5f4bca9dcc udev: do not try to process events if there is no free worker 2021-08-10 15:19:41 +09:00
Yu Watanabe f2a5412bf2 udev: propagate error on spawning a worker 2021-08-10 15:19:41 +09:00
Yu Watanabe 92fd70addf udev: add usec_add() at one more place 2021-08-10 15:19:41 +09:00
Yu Watanabe 0744e74c52 udev: make event_queue_start() return negative errno on error 2021-08-10 15:19:27 +09:00
Yu Watanabe 5393c52897 udev: make event_free() return NULL 2021-08-10 15:16:56 +09:00
Yu Watanabe 6be97d67c8 udev: update log message to clarify that the error is ignored 2021-08-10 15:16:56 +09:00
Yu Watanabe 419ec63135 udev: move several functions
No functional chage.
2021-08-10 15:16:56 +09:00
Yu Watanabe e0d61dac33 udev: also rename struct udev_ctrl -> UdevCtrl 2021-08-10 15:16:56 +09:00
Yu Watanabe d9239923c1 udev: rename type name e.g. struct worker -> Worker 2021-08-10 15:16:56 +09:00
Yu Watanabe 4c2c2a1256 network: use usec_add() at several more places 2021-08-10 15:12:24 +09:00
Yu Watanabe ae48d2d142 network: make IPv6Token private, and ipv6token_new() static 2021-08-10 15:12:24 +09:00
Yu Watanabe f784681a3e network: ndisc: update a log message
Also slightly rename functions.
2021-08-10 15:12:24 +09:00
Yu Watanabe b378b150b7 network: adjust log messages
Follow-up for #19944.
2021-08-10 15:04:04 +09:00
Yu Watanabe 8716018664 network: DHCP[46] -> DHCPv[46] in log messages 2021-08-10 15:02:35 +09:00
Yu Watanabe ccffa166d8 network: use request queue to configure DHCP{4,6} clients
Previously, when UUID is requested for DUID, then the clients are
configured in callback of bus methods.
But now, 'request queue' was implemented, so we can use it to wait until
the product UUID is obtained.
2021-08-10 14:55:34 +09:00
Yu Watanabe 6211b7362a network: do not request UUID frequently on failure
If many interfaces request UUID, and networkd cannot get it for some
reasons, then previously we call the DBus method so frequently.
2021-08-10 14:48:18 +09:00
Yu Watanabe bc8bd68db8 network: downgrade log level in dhcp6_configure()
And make the callers warn about failures.
2021-08-10 14:48:18 +09:00
Yu Watanabe 5aebe9c898 network: downgrade log level in dhcp4_configure()
And make the callers warn about failures.
2021-08-10 14:48:18 +09:00
Yu Watanabe 3bad5487e9 test-network: add a testcase to enter unmanaged state on reconfiguring 2021-08-10 14:44:47 +09:00
Yu Watanabe cb71e9c606 network: drop configurations in the previous .network file when entering unmanaged state
When reconfiguring an interface and it will enter unmanaged state,
let's drop configurations from the previously assigned .network file.
2021-08-10 14:44:39 +09:00
Yu Watanabe 5e3bb5da98 network: do not drop foreign configs for loopback and critical interfaces on carrier lost 2021-08-10 14:43:54 +09:00
Yu Watanabe 6bfa06fc39 network: do not drop foreign configs based on the previous .network file
`link_drop_foreign_config()` will be called later in link_configure().
2021-08-10 14:43:54 +09:00
Yu Watanabe f85499108f network: start/stop LLDP client on carrier gained/lost
Then, link_acquire_dynamic_conf() matches link_stop_engines().
Previously, LLDP client is started on interface is up, and stopped
on both down and carrier loss.
2021-08-10 14:43:54 +09:00
Yu Watanabe d09a179e69 network: reconfigure link after coming back from sleep
Previously, link was reconfigured with `link_carrier_reset()`, but it
just re-request to configure static addresses, routes, etc, and restart
engines (e.g. DHCP client).
However, after coming back from sleep, several link information may be
changed, especially the wifi access point may be different. So, we may
need to reconfigure the interface.
2021-08-10 14:43:34 +09:00
Tianlu Shao 63c00743f4 Update traditional Chinese Translation
Fix the wrong translation and fill in the new translation.
2021-08-10 14:39:16 +09:00
svonohr 65e5bf7511 hwdb: Add Lenovo Thinkpad P14s Gen1/2 rule 2021-08-10 13:28:18 +09:00
Frantisek Sumsal 46db176f8c test: use a correct kernel binary on ppc64le machines
Ubuntu calls the kernel binary as `vmlinux-*`, but RHEL/CentOS uses
the "standard" `vmlinuz-` prefix.

Follow-up to eaa602cb14.
2021-08-09 22:12:18 +01:00
Dimitry Ishenko 33e82f3ef3 timesync: add option to periodically save time 2021-08-09 21:06:28 +02:00
Albert Brox 8a513eee30 pid1: add support for cgroup.kill 2021-08-09 12:14:26 +02:00
longpanda 2846007ecf Fix the "Failed to open random seed ..." message.
When boot ArchLinux from Ventoy, it always print `Failed to open random seed file: write protected.`
As Ventoy emulate the ISO file as a read-only CDROM, I didn't test with a real physical CDROM drive, but maybe it also has such problem.
As we use `EFI_FILE_MODE_WRITE`  to open the `loader\random-seed` file, so I think it's better to check the result with both  `EFI_WRITE_PROTECTED` and `EFI_NOT_FOUND`.
2021-08-09 10:56:01 +02:00
Yu Watanabe 5865dc1493 network: use monotonic instead of boot time to handle address creation/update timestamp
Follow-up for 25db3aeaf3 and 899034ba81.

Fixes another issue in #20244.
2021-08-09 10:33:49 +02:00
StefanBruens bd73806888 Update 60-autosuspend-fingerprint-reader.hwdb to libfprint-1.92.1 2021-08-09 10:17:55 +02:00
GnunuX c5f62204ee man systemd-sysusers: fix password to passwd 2021-08-09 10:17:05 +02:00
Zbigniew Jędrzejewski-Szmek cb18d4e5d9 Merge pull request #20395 from takaswie/topic/correct-ieee1394-hwdb-entries
hwdb: ieee1394-unit-function: correct entries for some models
2021-08-09 10:12:11 +02:00
Zbigniew Jędrzejewski-Szmek 4f11590f9b Merge pull request #20399 from mrc0mmand/test-tweaks
test: yet another fix for ASan detection
2021-08-09 10:06:23 +02:00
Frantisek Sumsal 6476676b84 test: skip a harmless ldd error when installing test libs
Skip a harmless error when running the tests on a system with a significantly
older systemd version (ldd tries to resolve the unprefixed RPATH for libsystemd.so.0,
which is in this case older than the already installed libsystemd.so.0 in $initdir).
The issue is triggered by installing test dependencies in install_missing_libraries().

Spotted on CentOS 8.

```
$ ldd /var/tmp/systemd-test.nZO11F/root/lib/systemd/tests/test-sd-device-thread
/var/tmp/systemd-test.nZO11F/root/lib/systemd/tests/test-sd-device-thread: /lib64/libsystemd.so.0: version `LIBSYSTEMD_240' not found (required by /var/tmp/systemd-test.nZO11F/root/lib/systemd/tests/test-sd-device-thread)
        linux-vdso64.so.1 (0x00007fffb79d0000)
        libclang_rt.asan-powerpc64le.so => /usr/lib64/clang/11.0.0/lib/linux/libclang_rt.asan-powerpc64le.so (0x00007fffb6ef0000)
        libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007fffb6d20000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fffb6cd0000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fffb6ab0000)

$ LD_LIBRARY_PATH=/var/tmp/systemd-test.nZO11F/root/lib64/ ldd /var/tmp/systemd-test.nZO11F/root/lib/systemd/tests/test-sd-device-thread
        linux-vdso64.so.1 (0x00007fffaba80000)
        libclang_rt.asan-powerpc64le.so => /usr/lib64/clang/11.0.0/lib/linux/libclang_rt.asan-powerpc64le.so (0x00007fffaafa0000)
        libsystemd.so.0 => /var/tmp/systemd-test.nZO11F/root/lib64/libsystemd.so.0 (0x00007fffaa5f0000)
        libpthread.so.0 => /var/tmp/systemd-test.nZO11F/root/lib64/libpthread.so.0 (0x00007fffaa5a0000)
        libc.so.6 => /var/tmp/systemd-test.nZO11F/root/lib64/libc.so.6 (0x00007fffaa380000)

```
2021-08-09 10:04:40 +02:00
Frantisek Sumsal 25e399948b test: make busybox TEST-13-only dependency
to make running other tests a bit easier on distributions which don't have
busybox in repositories (CentOS).
2021-08-08 19:43:23 +02:00
Frantisek Sumsal 2d50e3c7bc test: yet another fix for ASan detection
This time for ppc64le:

```
100737c4:	5d 55 f9 4b 	bl      10008d20 <00000024.plt_call.__asan_report_load8>
100737f4:	4d 55 f9 4b 	bl      10008d40 <00000024.plt_call.__asan_handle_no_return>
10073884:	5d 50 f9 4b 	bl      100088e0 <00000024.plt_call.__asan_init>
1007388c:	75 54 f9 4b 	bl      10008d00 <00000024.plt_call.__asan_version_mismatch_check_v8>
100738a0:	41 36 f9 4b 	bl      10006ee0 <00000024.plt_call.__asan_register_globals>
100738f0:	71 4c f9 4b 	bl      10008560 <00000024.plt_call.__asan_unregister_globals>
```
2021-08-08 19:33:10 +02:00
Frantisek Sumsal 84817bfdb3 test: attempt to install only kernel modules for each subsystem
When `linux-headers` is installed on Arch Linux, it stores the module
source tree in the kernel module directory, which is then picked up by
`find` and we get a lot of harmless but annoying errors:

```
...
modprobe: FATAL: Module Kconfig.iosched not found in directory /lib/modules/5.13.7-arch1-1
modprobe: FATAL: Module Kconfig not found in directory /lib/modules/5.13.7-arch1-1
modprobe: FATAL: Module Kconfig not found in directory /lib/modules/5.13.7-arch1-1
modprobe: FATAL: Module dm-mpath.h not found in directory /lib/modules/5.13.7-arch1-1
modprobe: FATAL: Module dm-bio-prison-v2.h not found in directory /lib/modules/5.13.7-arch1-1
modprobe: FATAL: Module raid0.h not found in directory /lib/modules/5.13.7-arch1-1
...
```

Let's fix this by trying to install only kernel modules (*.ko files with
an optional compression).
2021-08-08 16:06:41 +01:00