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

57415 Commits

Author SHA1 Message Date
Luca Boccassi
cedf5b1aef core: fix dm-verity auto-discovery in MountImageUnit()
The implementation of MountImageUnit()/systemctl mount-image was
changed to use a /proc/self/fd path as the source, but that causes
the dm-verity files autodiscovery to fail, as it looks for files
in the same directory as the image.

Use the original file path when setting up dm-verity.
2022-04-07 17:31:04 +01:00
Zbigniew Jędrzejewski-Szmek
6eb32c7f2e syscalls: update syscall definitions 2022-04-07 18:25:55 +02:00
Zbigniew Jędrzejewski-Szmek
a7fc59c70b various: add missing "#pragma once" 2022-04-07 18:25:55 +02:00
Zbigniew Jędrzejewski-Szmek
3fb72d6388 Merge parse-socket-bind-item.? into parse-helpers.?
That file only exported one function, and it fits nicely within the scope of
"parse helpers". Let's move it there to reduce the file count a bit.

No functional change.
2022-04-07 18:25:55 +02:00
Zbigniew Jędrzejewski-Szmek
c3eaba2d3d Move path_simplify_and_warn() to new shared/parse-helpers.c
This is a high-level function, and it belongs in libsystemd-shared. This way we
don't end up linking a separate copy into various binaries. It would even end
up in libsystemd, where it is not needed. (Maybe it'd be removed in some
optimization phase, but it's better to not rely on that.)

$ grep -l -r -a 'path is not absolute%s' build/
build/libnss_systemd.so.2
build/pam_systemd_home.so
build/test-dlopen
build/src/basic/libbasic.a.p/path-util.c.o
build/src/basic/libbasic.a
build/src/shared/libsystemd-shared-249.so
build/test-bus-error
build/libnss_mymachines.so.2
build/pam_systemd.so
build/libnss_resolve.so.2
build/libnss_myhostname.so.2
build/libsystemd.so.0.32.0
build/libudev.so.1.7.2

$ grep -l -r -a 'path is not absolute%s' build/
build/src/shared/libsystemd-shared-251.a.p/parse-helpers.c.o
build/src/shared/libsystemd-shared-251.a
build/src/shared/libsystemd-shared-251.so

No functional change.
2022-04-07 18:25:55 +02:00
Zbigniew Jędrzejewski-Szmek
0643001c28 test-nspawn-util: fix the test to actually find anything
We would use a relative path, looking for globs like
'lib/systemd/libsystemd-shared-*.so' under the build directory, and never find
anything.

The test was supposed to find library in the current installation. But we
cannot assume that the right library is installed, so the test only printed the
result for manual inspection. Thus nobody noticed when it broke. I think it
broke in c6134d3e2f1d1d17b32b6e06556cd0c5429bc78a, path-util: get rid of prefix_root().
But that commit doesn't compile because of changes in meson, so this is just
a guess.

Before:
/* test_systemd_installation_has_version */
Current installation has systemd >= 0: no
Current installation has systemd >= 231: no
Current installation has systemd >= 249: no
Current installation has systemd >= 999: no

With the fix:
$ build/test-nspawn-util
/* test_systemd_installation_has_version */
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (OK).
Current installation has systemd >= 0: yes
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (OK).
Current installation has systemd >= 231: yes
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (too old).
Found libsystemd shared at "/lib/systemd/libsystemd-shared-251.so.so", version 251 (OK).
Current installation has systemd >= 251: yes
Found libsystemd shared at "/lib/systemd/libsystemd-shared-245.so.so", version 245 (too old).
Found libsystemd shared at "/lib/systemd/libsystemd-shared-251.so.so", version 251 (too old).
Found libsystemd shared at "/lib/systemd/libsystemd-shared-250.so.so", version 250 (too old).
Found libsystemd shared at "/usr/lib/systemd/libsystemd-shared-245.so.so", version 245 (too old).
Found libsystemd shared at "/usr/lib/systemd/libsystemd-shared-251.so.so", version 251 (too old).
Found libsystemd shared at "/usr/lib/systemd/libsystemd-shared-250.so.so", version 250 (too old).
Current installation has systemd >= 999: no

$ build/test-nspawn-util /var/lib/machines/rawhide
/* test_systemd_installation_has_version */
/* test_systemd_installation_has_version */
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (OK).
/var/lib/machines/rawhide has systemd >= 0: yes
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (OK).
/var/lib/machines/rawhide has systemd >= 231: yes
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (OK).
/var/lib/machines/rawhide has systemd >= 251: yes
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (too old).
Found libsystemd shared at "/var/lib/machines/rawhide/usr/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251 (too old).
/var/lib/machines/rawhide has systemd >= 999: no

While at it, NULSTR_FOREACH → FOREACH_STRING.
2022-04-07 18:25:26 +02:00
Zbigniew Jędrzejewski-Szmek
7e6821ed4e nspawn: fix comparisons of versions with non-numerical suffixes
See a2b0cd3f5ab3f450e74e2085ad20372a05451c74. When -Dshared-lib-tag is used,
libsystemd-shared.so and libsystemd-core.so get a suffix which breaks the
parsing done by systemd_installation_has_version(). We can assume that the
tag will be something like "251-rc1-1.fc37" that is currently used in Fedora.
(Anything that does *not* start with the version would be completely crazy.)
By switching to strverscmp_improved() we simplify the code and fix comparisons
with such versions.

$ build/test-nspawn-util /var/lib/machines/rawhide
...
Found libsystemd shared at "/var/lib/machines/rawhide/lib/systemd/libsystemd-shared-251-rc1-1.fc37.so.so", version 251-rc1-1.fc37 (OK).
/var/lib/machines/rawhide has systemd >= 251: yes
...

I noticed this when I started a systemd-nspawn container with Redora rawhide
and got the message "Not running with unified cgroup hierarchy, LSM BPF is not
supported". I thought the message is in error, but it was actually correct:
nspawn was misdetecting that the container does not sport new-enough systemd
to support cgroups-v2.
2022-04-07 18:19:03 +02:00
Zbigniew Jędrzejewski-Szmek
c9394f4f93 Move systemd_installation_has_version() to src/nspawn/
This function implements a heuristic that is only used by nspawn. It doesn't
belong in basic. I opted for a new file "nspawn-utils.c", because it seems
likely that we'll need some other new utilities like that in the future.

No functional change.
2022-04-07 18:17:20 +02:00
Gibeom Gwon
1e582ede3b calendarspec: fix possibly skips next elapse
If the time unit changes after adding the repetition value, the
timer may skip the next elapse. This patch reset sub time units
to minimum value when upper unit is changed.

Fixes #22665.
2022-04-07 17:44:35 +02:00
Zbigniew Jędrzejewski-Szmek
cbb6068d0f
Merge pull request #21795 from Werkov/bfq-io-weight-2
IODeviceWeight= configures bfq.io.weight  too
2022-04-07 17:23:16 +02:00
Frantisek Sumsal
673d1f4ab9
Merge pull request #23000 from mrc0mmand/coverage__exit
macro: call __gcov_dump() before _exit() w/ coverage enabled
2022-04-07 13:08:55 +00:00
Frantisek Sumsal
1b2e3b8bff test: ignore missing coverage in TEST-02
Since c6552ad we now try to collect coverage even in situations where
it's basically impossible (like in test-mount-util where the whole / is
mounted as read-only). As dealing with this is not worth the trouble,
let's ignore the missing coverage errors thrown by gcov in such cases.
2022-04-07 12:45:13 +02:00
Zbigniew Jędrzejewski-Szmek
be6447b483 README: add one more kernel-version line
I want to add as many as possible to show people that each kernel version
has something nice to entice them to keep moving up ;)
2022-04-07 12:42:23 +02:00
Zbigniew Jędrzejewski-Szmek
32adc3a7ca core: inline an iterator variable 2022-04-07 12:42:23 +02:00
Frantisek Sumsal
c6552ad381 macro: call __gcov_dump() before _exit() w/ coverage enabled
_exit() skips at-exit hooks, causing lost coverage from processes
utilizing it.

Hopefully resolves systemd/systemd-centos-ci#482
2022-04-07 10:06:44 +02:00
Yu Watanabe
239adf0384 sd-ipv4acd: actually drop the arp packet from one of the host interface
Fixes a bug in 7f77917c0effe92d5fed52503bceddabcb4667ba.

Fixes #23001.
2022-04-07 15:02:21 +09:00
Luca Boccassi
219ff0cb1e semaphoreci: re-enable rebooting tests
Fixed by 5738b62f55

Fixes https://github.com/systemd/systemd/issues/22991
2022-04-07 14:53:49 +09:00
Anita Zhang
3d935cea2c
Merge pull request #22965 from enr0n/oomd-used-memory-calc
oomd: calculate 'used' memory with MemAvailable instead of MemFree
2022-04-06 16:42:46 -07:00
Mariusz Tkaczyk
3a3b022d2c shutdown: get only active md arrays.
Current md_list_get() implementation filters all block devices, started from
"md*". This is ambiguous because list could contain:
- partitions created upon md device (mdXpY)
- external metadata container- specific type of md array.

For partitions there is no issue, because they aren't handle STOP_ARRAY
ioctl sent later. It generates misleading errors only.

Second case is more problematic because containers are not locked in kernel.
They are stopped even if container member array is active. For that reason
reboot or shutdown flow could be blocked because metadata manager cannot be
restarted after switch root on shutdown.

Add filters to remove partitions and containers from md_list. Partitions
can be excluded by DEVTYPE. Containers are determined by MD_LEVEL
property, we are excluding all with "container" value.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
2022-04-06 21:56:40 +01:00
Luca Boccassi
31cd2dd906 core: taint if /usr is unmerged
9afd5e7b975e8051c011ff9c07c95e80bd954469 introduced a build-time
taint, introduce a runtime one as well, in preparation for
removing support for unmerged-usr in a future release
2022-04-06 21:54:14 +01:00
Frantisek Sumsal
124d293268
Merge pull request #22996 from yuwata/test-sfdisk-lock
test: use "udevadm lock" more
2022-04-06 20:47:12 +00:00
Yu Watanabe
70a3ce51f3 test: drop unnecessary use of loop device
To avoid inferences with udevd.
2022-04-07 01:44:39 +09:00
Yu Watanabe
bc6bd62c0e test: use udevadm lock when partitioning block devices
We can use `sfdisk --lock` for these cases, but some CI environments
have old sfdisk which does not support `--lock` option.
2022-04-07 01:42:44 +09:00
Lennart Poettering
5645b4976e update TODO 2022-04-06 18:37:51 +02:00
Yu Watanabe
3452ae90ea test: --initialized=yes is the default for udevadm wait 2022-04-07 00:40:33 +09:00
Yu Watanabe
76b53bf54b
Merge pull request #22993 from keszybz/refactor-manager_taint_string()
Refactor manager_taint_string()
2022-04-07 00:36:45 +09:00
Zbigniew Jędrzejewski-Szmek
adbe000e3d hwdb: drop boilerplate about match patterns being unstable
We've had this text since the beginning, but in fact the patterns must be
stable in order for people to create local hwdb entries. And we support that
and can't change the match patterns without being very careful. So let's just
drop the text.
2022-04-06 23:16:39 +09:00
Daan De Meyer
cae7c28272 analyze: Fix verify exit status regression
Previously, systemd-analyze verify would return 0 even if warnings
were raised during analysis of the specified units or their
dependencies. With 3cc3dc7, verify was changed to return 1 when
warnings were raised.

This commit changes the default mode to _RECURSIVE_ERRORS_INVALID
so that verify returns zero again by default when warnings are
raised.
2022-04-06 23:16:02 +09:00
Yu Watanabe
2f88f2936c README: rawhide -> Rawhide 2022-04-06 23:14:21 +09:00
Yu Watanabe
588453b8b4
README: add rawhide SELinux build status (#22997)
Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
2022-04-06 14:13:10 +00:00
Yu Watanabe
2eeabd4489
Merge pull request #22983 from yuwata/login-use-symlinks-under-static_node-tags
login: shorten code a bit
2022-04-06 23:11:56 +09:00
Yu Watanabe
a9e832092a udev: add a brief comment about the origin of the filters
I am not sure whether the original discussions are correct or not.
This is just for adding references for future verification for the
filters.
2022-04-06 15:28:44 +02:00
Zbigniew Jędrzejewski-Szmek
e5f2d77b48 basic/strv: fix typos and confusion whether we are escaping or unescaping 2022-04-06 15:26:05 +02:00
Zbigniew Jędrzejewski-Szmek
226281b36d Add new test-manager.c and "test" manager_taint_string()
It seems it doesn't fit well anywhere else.
2022-04-06 15:26:05 +02:00
Zbigniew Jędrzejewski-Szmek
83fe5d8a78 manager: rework manager_taint_string()
When I see stpcpy, my brain bleeds. This function was too complicated
for it's own good.
2022-04-06 12:55:57 +02:00
Yu Watanabe
e992fd18a8 login: shorten code a bit
The symlinks under /run/udev/static_node-tags are pointing to the
corresponding device nodes. Let's read the symlinks.
2022-04-06 19:38:27 +09:00
Yu Watanabe
8dc3c2f197
Merge pull request #22981 from yuwata/udev-node-cleanups
udev: cleanups for device node handling
2022-04-06 19:34:59 +09:00
Frantisek Sumsal
467ba161af
Merge pull request #22985 from bluca/semaphore
Semaphore CI fixes
2022-04-06 10:27:17 +00:00
Lennart Poettering
39ff521c99
Merge pull request #22968 from keszybz/kernel-4.4
Recommend kernel 4.15 or newer
2022-04-06 12:03:47 +02:00
Michal Sekletar
66425daf2c udev/net_id: avoid slot based names only for single function devices
If we have two or more devices that share the same slot but they are
also multifunction then it is OK to use the slot information even if it
is the same for all of them. Name conflict will be avoided because we
will append function number and form names like, ens1f1, ens1f2...
2022-04-06 11:51:03 +02:00
Luca Boccassi
8821518b00 semaphoreci: skip boot-and-services test
It started failing, disable it for now
2022-04-06 10:41:46 +01:00
Luca Boccassi
16ae198485 semaphoreci: move runner from Bionic to Focal 2022-04-06 10:41:46 +01:00
Yu Watanabe
f7ad162879 test-network: rename one .netdev to make the file removed after the test
Follow-up for 7809cab71738aa582ac30e7dbc8d1e76c303ff9e.
2022-04-06 18:14:45 +09:00
Yu Watanabe
190ed66edc udevadm: lock: fix TOCTOU
Fixes CID#1487744.
2022-04-06 08:58:23 +01:00
Yu Watanabe
26dd37f6d5 udev: move apply_static_dev_perms() to udev-node.c
and make it internally use udev_node_apply_permissions_impl().
2022-04-06 14:52:36 +09:00
Yu Watanabe
e5ddfe3ec5 udev: upgrade mode in udev_node_apply_permissions_impl() 2022-04-06 14:46:13 +09:00
Yu Watanabe
a782f2a3fc udev: split udev_node_apply_permissions() into two 2022-04-06 14:46:13 +09:00
Yu Watanabe
f14aa5ad42 udev: drop unnecessary code
Follow-up for 78e278ad48e0d2854f950f261804fde70121820e.
2022-04-06 14:46:13 +09:00
Yu Watanabe
bab34bc12e
Merge pull request #22980 from keszybz/test-help-and-version-output
Test --help and --version output in more cases
2022-04-06 13:42:12 +09:00
Luca Boccassi
b6529646e7 semaphoreci: speed up package installation
Disable updating the manpage database, and use dpkg's unsafe-io flag
2022-04-06 00:24:11 +01:00