1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-11 20:58:27 +03:00

72585 Commits

Author SHA1 Message Date
Antonio Alvarez Feijoo
1eeae735ad sd-journal: fix check in journal_file_verify_header()
Fixes 6ea51363c8e39fb0924dda972a212936456a2b4f
2024-04-05 13:03:19 +02:00
Frantisek Sumsal
e55db9e792 log: fix comment 2024-04-05 12:14:18 +02:00
Daan De Meyer
aaa872a713 core: Serialize both pid and pidfd to keep downgrades working
Currently, when downgrading from a version with pidfd support to a
version without pidfd support, all information about running processes
is lost as the newer systemd will serialized pidfds which are not recognized
by the older systemd when deserializing.

To improve the situation, let's serialize both the pid and the pidfd.
This is safe because existing versions will either replace the first
deserialized pidref with the second one or discard the second one in
favor of the first one depending on the unit and field. Older versions
that don't support pidfd's will silently discard any fields that contain
a pidfd as those will try to parse the field as a pid and since a pidfd
field will start with '@', those versions will debug error log and ignore
the value.

To make sure we reuse the existing pidfd as much as possible, the pidfd
is serialized first. Both for scopes and service main pids, if the same
pid is seen multiple times, the first pidref is kept. So by serializing
the pidfd first we make sure the original pidfd is used instead of the
new one which is opened when deserializing the first pid field.

For other control units, older versions with pidfd support will discard
the first pidfd and replace it with a new pidfd from the second pid field.
This is a slight regression on downgrades, but we make sure it doesn't
happen for future versions (and older versions when this commit is
backported) by modifying the logic to only use the first successfully
deserialized pidref so that the raw pid without pidfd is discarded instead
of it replacing the existing pidfd.
2024-04-05 12:56:26 +09:00
Luca Boccassi
1ce28e5a24 meson: set -fno-ssa-phiopt when building bpf with gcc
There are bugs in the kernel verifier that cause legitimate code
to be rejected, disabling this optimization makes bpf programs
built with a new enough gcc work again.

Fixes https://github.com/systemd/systemd/issues/31888
2024-04-05 12:55:53 +09:00
Kirk
57cd604fde
hwdb: fix missing colon (#32108)
Missing colon prevents this from working correctly on the Chuwi UBook X and UBook X Pro.
2024-04-05 10:18:59 +09:00
Luca Boccassi
360f486cc6
Merge pull request #32085 from yuwata/udev-check-processing
udev: check ID_PROCESSING udev property more
2024-04-04 23:46:26 +01:00
Yu Watanabe
9dcdf16b25 test-network: add test cases for Redirect and Neighbor Advertisement message handling 2024-04-05 06:22:42 +09:00
Yu Watanabe
447fe37ee3 test: introduce a test executable to send NDisc message 2024-04-05 06:22:19 +09:00
Yu Watanabe
6df0059441 network/ndisc: add basic support for Redirect message
Closes #31438.
2024-04-05 05:57:54 +09:00
Yu Watanabe
44e8cf303b sd-ndisc: add basic support of Redirect message
This makes sd-ndisc support Redirect message defined in RFC 4861.
2024-04-05 05:57:14 +09:00
Yu Watanabe
b03d7291d5 network/ndisc: remember the latest RA from the default router
The remembered RA will be used later. Preparation for later commits.
2024-04-05 05:55:06 +09:00
Yu Watanabe
36ca167220
Merge pull request #31373 from yuwata/network-neighbor-advertisement
network: add basic support of neighbor advertisement
2024-04-05 05:54:12 +09:00
Yu Watanabe
e17e438ede udevadm-test: also show security labels if specified
Follow-up for 03b6879f4d45c49264708aef872fd05af30ddcf0.
2024-04-04 21:30:26 +01:00
Yu Watanabe
9990552f9a backlight: fix detection of multiple graphic cards
Follow-up for e0504dd011189d97a1ea813aabfe1e696742bcf5.

Hopefully, devices in PCI subsystem have some properties, thus have
their udev database file. But, that may not be true. Here, we only read
sysattrs of enumerated devices, hence it is not necessary to check if
the device is initialized or not.
2024-04-04 21:29:57 +01:00
Yu Watanabe
f7cb6801a2 udev: do not update sysattr and sysctl value on testing
Follow-up for 089bef66316e5bdc91b9984148e5a6455449c1da.
2024-04-04 21:29:30 +01:00
Luca Boccassi
9a937ea2a6
Merge pull request #32102 from YHNdnzj/efi-var-consistent
Trivial follow-up for hibernate-resume
2024-04-04 21:21:10 +01:00
Mike Yuan
05d2a63139
man/kernel-command-line: document resume_offset= too 2024-04-05 03:03:09 +08:00
Mike Yuan
166ad35fa8
hibernate-util: say "HibernateLocation EFI variable" consistently 2024-04-05 02:59:59 +08:00
Yu Watanabe
6a363a838a udevadm-test: insert missing line break
Addresses post-merge comment:
03b6879f4d (r140587790)
2024-04-04 20:10:28 +02:00
Zbigniew Jędrzejewski-Szmek
cdba129b71 TEST-50: add tests for riscv{32,64}
Requested for the testing of F40 riscv bringup. Numbers copied from
https://uapi-group.org/specifications/specs/discoverable_partitions_specification/.

It'd be nice to do the same in TEST-58, but the code there is rather involved
and I don't have a system to test on. We can probably try that later on when F40
is available.
2024-04-04 20:07:57 +02:00
mkubiak
ad248d522b Fixed resolution for pen and touchpad 2024-04-05 02:26:54 +09:00
Yu Watanabe
87a33c0740 netowrk/ndisc: drop NDisc configurations when received NA without Router flag
Closes #28421.
2024-04-05 02:16:03 +09:00
Yu Watanabe
ecab9b6040 test-ndisc: add basic tests for Neighbor Advertisement handling 2024-04-05 02:16:03 +09:00
Yu Watanabe
696eb2b8de sd-ndisc: add basic support of Neighbor Advertisement message
This adds basic support of receiving and parsing Neighbor Advertisement
message defined in RFC 4861.
2024-04-05 02:16:03 +09:00
Antonio Alvarez Feijoo
ce18410a54 cryptsetup-tokens: fix argument order mismatch in function
The order of the arguments of the function `acquire_luks2_key()` in
`luks2-tpm2.h` is wrong, `pcrlock_path` and `pin` are swapped.

Fixes 404aea7815595c1324947ed7f2a7502b17d3cc01
2024-04-05 01:12:42 +08:00
Yu Watanabe
405be62f05 tree-wide: refuse enumerated device with ID_PROCESSING=1
When enumerated devices are being processed by udevd, we will receive
corresponding uevents later. So, we should not process devices in that
case.
2024-04-05 01:49:20 +09:00
Yu Watanabe
54e6172550 tree-wide: use device_is_processed() more 2024-04-05 01:49:20 +09:00
Yu Watanabe
3df2b4557a udev-util: rename device_is_processing() -> device_is_processed()
And make it also check the existence of the udev database.
2024-04-05 01:48:59 +09:00
Luca Boccassi
2aef0ac819
Merge pull request #32097 from keszybz/sd-notify-cleanups
Small cleanups to sd_notify docs
2024-04-04 17:44:12 +01:00
Daan De Meyer
7b62a246a6
Merge pull request #32033 from DaanDeMeyer/unit-creds
debug-generator: Add unit and drop-in credentials
2024-04-04 18:27:20 +02:00
Lennart Poettering
a0ff536ac5 update TODO 2024-04-04 18:16:45 +02:00
Lennart Poettering
1d98716ef7 libkmod: turn into dlopen() dependency
As it turns out libkmod has quite a bunch of deps, including various
compressing libs and similar. By turning this into a dlopen()
dependency, we can make our depchain during install time quite a bit
smaller. In particular as inside of containers kmod doesn't help anyway
as CAP_SYS_MODULE is not available anyway.

While we are at it, also share the code that sets up logging/kmod
context.

After:

$ lddtree ./build/systemd
systemd => ./build/systemd (interpreter => /lib64/ld-linux-x86-64.so.2)
    libsystemd-core-255.so => ./build/src/core/libsystemd-core-255.so
        libaudit.so.1 => /lib64/libaudit.so.1
            libcap-ng.so.0 => /lib64/libcap-ng.so.0
                ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
        libm.so.6 => /lib64/libm.so.6
        libmount.so.1 => /lib64/libmount.so.1
            libblkid.so.1 => /lib64/libblkid.so.1
        libseccomp.so.2 => /lib64/libseccomp.so.2
        libselinux.so.1 => /lib64/libselinux.so.1
            libpcre2-8.so.0 => /lib64/libpcre2-8.so.0
    libsystemd-shared-255.so => /home/lennart/projects/systemd/build/src/shared/libsystemd-shared-255.so
        libacl.so.1 => /lib64/libacl.so.1
            libattr.so.1 => /lib64/libattr.so.1
        libcap.so.2 => /lib64/libcap.so.2
        libcrypt.so.2 => /lib64/libcrypt.so.2
        libgcrypt.so.20 => /lib64/libgcrypt.so.20
            libgpg-error.so.0 => /lib64/libgpg-error.so.0
        liblz4.so.1 => /lib64/liblz4.so.1
        libcrypto.so.3 => /lib64/libcrypto.so.3
            libz.so.1 => /lib64/libz.so.1
        libpam.so.0 => /lib64/libpam.so.0
            libeconf.so.0 => /lib64/libeconf.so.0
        liblzma.so.5 => /lib64/liblzma.so.5
        libzstd.so.1 => /lib64/libzstd.so.1
    libc.so.6 => /lib64/libc.so.6

Before:

$ lddtree ./build/systemd
systemd => ./build/systemd (interpreter => /lib64/ld-linux-x86-64.so.2)
    libsystemd-core-255.so => ./build/src/core/libsystemd-core-255.so
        libaudit.so.1 => /lib64/libaudit.so.1
            libcap-ng.so.0 => /lib64/libcap-ng.so.0
                ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
        libkmod.so.2 => /lib64/libkmod.so.2
            libzstd.so.1 => /lib64/libzstd.so.1
            liblzma.so.5 => /lib64/liblzma.so.5
            libz.so.1 => /lib64/libz.so.1
            libcrypto.so.3 => /lib64/libcrypto.so.3
            libgcc_s.so.1 => /lib64/libgcc_s.so.1
        libm.so.6 => /lib64/libm.so.6
        libmount.so.1 => /lib64/libmount.so.1
            libblkid.so.1 => /lib64/libblkid.so.1
        libseccomp.so.2 => /lib64/libseccomp.so.2
        libselinux.so.1 => /lib64/libselinux.so.1
            libpcre2-8.so.0 => /lib64/libpcre2-8.so.0
    libsystemd-shared-255.so => /home/lennart/projects/systemd/build/src/shared/libsystemd-shared-255.so
        libacl.so.1 => /lib64/libacl.so.1
            libattr.so.1 => /lib64/libattr.so.1
        libcap.so.2 => /lib64/libcap.so.2
        libcrypt.so.2 => /lib64/libcrypt.so.2
        libgcrypt.so.20 => /lib64/libgcrypt.so.20
            libgpg-error.so.0 => /lib64/libgpg-error.so.0
        liblz4.so.1 => /lib64/liblz4.so.1
        libpam.so.0 => /lib64/libpam.so.0
            libeconf.so.0 => /lib64/libeconf.so.0
    libc.so.6 => /lib64/libc.so.6
2024-04-04 18:16:45 +02:00
Lennart Poettering
99a1ef8c9c watchdog: clarify that we set the *watchdog* timeout
This makes sure we mention the word "watchdog" in every log message
related to the watchdog.

Also, this uses the expression "hardware timeout" when referring to the
primary timeout of the watchdog, as opposed to the "pretimeout".

(Not ideal wording I know, but it's preexisting to some point, I just
continued it. I think it's OK though, in particular to underline the
difference to the software watchdog logic we implement via WATCHDOG= in
sd_notify().)

Fixes: #31662
2024-04-04 17:53:38 +02:00
Daan De Meyer
8595f578fe debug-generator: Add unit and drop-in credentials
These allow adding extra units and drop-ins via credentials.
2024-04-04 16:17:38 +02:00
Daan De Meyer
3cb618084a network-generator: Add logging
We stick to debug logging because in some cases network-generator
will fall back to trying another parsing function if one fails, so
if we return an error it's not necessarily a failure.
2024-04-04 14:46:40 +02:00
Zbigniew Jędrzejewski-Szmek
3a9259d93c man: align strings in sd_notify() examples
I think this way it's easier to see that they are part of the same argument.
2024-04-04 14:41:56 +02:00
Zbigniew Jędrzejewski-Szmek
4cbf560edf man/notify-selfcontained-example: check argument first
This is just good style. In this particular case, if the argument is incorrect and
the function is not tested with $NOTIFY_SOCKET set, the user could not get the
proper error until running for real.

Also, remove mention of systemd. The protocol is fully generic on purpose.
2024-04-04 12:18:30 +02:00
Zbigniew Jędrzejewski-Szmek
a1887f8b48 man: regenerate rules
Fixup for dfad86b83807fa8696ca94982a5ba591b6d86a80.
2024-04-04 12:18:30 +02:00
Zbigniew Jędrzejewski-Szmek
19e980eb92 man: update fedora example to F40
F40 will be out soon, so we can update the man page already. The example should
already work.

The cloud link was dropped in fd571c9df0ba86636401582c4ea0a8cb608e1216, so
drop the unused variable too.
2024-04-04 09:19:24 +01:00
Julius Alexandre
f8bfea5433
core/exec-invoke: replace basename() with path_extract_filename() (#32076) 2024-04-04 06:44:51 +09:00
Yu Watanabe
8c27f1ba4a vmspawn: fix error code 2024-04-04 04:42:55 +09:00
Daan De Meyer
50ad7cf934 mkosi: More package updates
- Install individual asan libraries instead of gcc
- Drop duplicate qrencode package from arch config
- Install dbus-user-session which provides default-dbus-session-bus
- Explicitly install dbus-broker on Arch Linux
2024-04-03 21:05:03 +02:00
Lennart Poettering
dca15bd905 sysupdate: use log_syntax() when logging about a configuration file
All code around this does this too, hence do it here as well.

Also fix plural verb form.

Follow-up for: #32018
2024-04-04 04:04:14 +09:00
Yu Watanabe
94ad70989f man/example: also build example code with C90
Unfortunately, sd-bus-vtable.h, sd-journal.h, and sd-id128.h
have variadic macro and inline initialization of sub-object, these are
not supported in C90. So, we need to silence some errors.
2024-04-04 03:23:20 +09:00
Daan De Meyer
56e6bf9e04 mkosi: Install selinux tools in main image instead of initramfs
Also install setools-console and policycoreutils instead of setools
which pulls in the kitchen sink. Also install selinux-policy-targeted
to make sure the right policy is installed.
2024-04-03 20:09:04 +02:00
Daan De Meyer
5ed030a7ac mkosi: Install git-core where possible
This avoids pulling in the perl kitchen sink.
2024-04-03 20:09:04 +02:00
Lennart Poettering
4d619806d1 Revert "kernel-install: Add kernel version to title (#31581)"
This reverts commit 85b774de49caff8be819f021740dd680ba76ab77.
2024-04-04 02:45:39 +09:00
Yu Watanabe
2893a1089e
Merge pull request #32072 from YHNdnzj/no-ellipsize
core/manager: use cellescape and don't be too aggressive
2024-04-04 02:44:59 +09:00
Lennart Poettering
56efc39fbc resolved: return ExpectedMore error if we require "more" varlink flag on method call
Fixes: #32066
2024-04-04 02:43:20 +09:00
Yu Watanabe
3a6bee0510
Merge pull request #32043 from YHNdnzj/resume-clear-efi
units: introduce systemd-hibernate-clear.service that clears stale HibernateLocation EFI variable
2024-04-04 02:43:00 +09:00