1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00
Commit Graph

57230 Commits

Author SHA1 Message Date
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 c6134d3e2f, 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 a2b0cd3f5a. 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
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
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 7809cab717.
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 78e278ad48.
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
Luca Boccassi
9a6260b194 semaphoreci: run dhclient manually on setup
For some reason the guest container stopped having its
network interface configured. Run the dhcp client manually.
2022-04-06 00:24:11 +01:00
Luca Boccassi
93de997d12 semaphoreci: check keys.opengpgp.org first
Always resolves and it's faster than the others

+ for keyserver in "" "keys.gnupg.net" "keys.openpgp.org" "keyserver.ubuntu.com"
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 1
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 4
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 9
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 16
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 25
+ for keyserver in "" "keys.gnupg.net" "keys.openpgp.org" "keyserver.ubuntu.com"
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 1
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 4
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 9
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 16
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.gnupg.net
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: bullseye-amd64: lxccontainer.c: create_run_template: 1617 Failed to create container from template
lxc-create: bullseye-amd64: tools/lxc_create.c: main: 327 Failed to create container bullseye-amd64
+ sleep 25
+ for keyserver in "" "keys.gnupg.net" "keys.openpgp.org" "keyserver.ubuntu.com"
+ for retry in {1..5}
+ sudo lxc-create -n bullseye-amd64 -t download -- -d debian -r bullseye -a amd64 --keyserver keys.openpgp.org
Setting up the GPG keyring
Downloading the image index
Downloading the rootfs
2022-04-05 22:12:17 +01:00
Zbigniew Jędrzejewski-Szmek
99d8cbceff meson: make kernel-install a template file, add --version, add to tests
In --help output, change "$0" → "kernel-install". We generally don't include
the full path in --help output, and let's not do this here either.

kernel-install is now in build/ directly, not in the subdirectory.
2022-04-05 22:18:31 +02:00
Zbigniew Jędrzejewski-Szmek
8f04a1ca2b meson: also allow setting GIT_VERSION via templates
GIT_VERSION is not available as a config.h variable, because it's rendered
into version.h during builds. Let's rework jinja2 rendering to also
parse version.h. No functional change, the new variable is so far unused.

I guess this will make partial rebuilds a bit slower, but it's useful
to be able to use the full version string.
2022-04-05 22:18:31 +02:00
Zbigniew Jędrzejewski-Szmek
3761002eea test: do --help/--version checks for systemd, firstboot, cryptenroll, s-n-w-o
I basically went by the list in systemd.directives for --help/-h.
kernel-install is also listed there, but will be added in a later commit.
2022-04-05 22:18:31 +02:00
Zbigniew Jędrzejewski-Szmek
e16793ee7e firstboot: make --help output fit in 80 columns
A long name of one parameter was making the whole thing very wide.
I think that it's obvious from the context what the argument is,
so a shorter name should be just as good.
2022-04-05 22:18:31 +02:00
Zbigniew Jędrzejewski-Szmek
03b3b55e11 pid1: make --help output fit in 80 columns 2022-04-05 22:18:31 +02:00
Zbigniew Jędrzejewski-Szmek
9f9be6ea28 test/check-help: check that --help and -h are identical 2022-04-05 22:18:31 +02:00
Zbigniew Jędrzejewski-Szmek
ffb7406ba9 tests: add a smoke test for --version option in binaries
This is very similar to (and directly based on) the test for --help. I think
it's nice to do this: the test is very quick, but it'll catch cases where we
forgot to hook up the option, or forgot to exit after printing --version, and
it'll also increase our test coverage a bit.
2022-04-05 22:18:31 +02:00
Yu Watanabe
5674b74c4f hwdb: fix parsing options
Fixes #22976.
2022-04-06 04:03:32 +09:00
Zbigniew Jędrzejewski-Szmek
2c75ef181d manager: fix typo
I guess that we could make an overflow if all the taint flags were set.
2022-04-05 20:31:59 +02:00
Zbigniew Jędrzejewski-Szmek
88a3af9421 README: describe taint flags and how to check them
We should have this somewhere. We talk about versions of things
in the README, so it seems as good a place as any.
2022-04-05 20:31:30 +02:00
Zbigniew Jędrzejewski-Szmek
277f05872f README: say kernel 4.15 is the minimum recommended
After various long discussions
(https://lists.freedesktop.org/archives/systemd-devel/2022-March/047587.html,
https://lwn.net/Articles/889610/), there is no clear answer what the minimum
version should be. Bumping the version above 3.15 doesn't allow us to make any
significant simplifications (unless we went *much* higher). In particular, even
renameat2() is not fully supported with latest kernel versions, e.g. nfs still
doesn't have it. And the bpf stuff is optional anyway. So let's just say that
4.15 is what we recommend, because it provides fairly complete cgroups-v2, but
without any removals of compat in the code.
2022-04-05 20:30:00 +02:00
Lennart Poettering
80b7f7118e
Merge pull request #22975 from poettering/logind-longpress-followup
logind: "long press" follow-up
2022-04-05 18:42:17 +02:00
Yu Watanabe
58dd4999dc core: command argument can be longer than PATH_MAX
Fixes a bug introduced by 0653649202.

Fixes #22957.
2022-04-06 00:39:06 +09:00
Lennart Poettering
30e0343b1c man: split an overly long paragraph in two 2022-04-05 16:10:26 +02:00
Lennart Poettering
acc63800bc logind: also show long press settings in default logind.conf
The configuration options where added back in
a520bb6654 but this was never actually
added to the default logind.conf.

Follow-up-for: a520bb6654
Follow-up-for: #19917
2022-04-05 16:10:21 +02:00
Lennart Poettering
c4db78fce6 logind: expose long press actions on D-Bus
The settings and internal varables were added, but this was never
exposed on the bus. Add that.

Follow-up-for: a520bb6654
Follow-up-for: #19917
2022-04-05 16:09:52 +02:00
Lennart Poettering
c0da575a0e update TODO 2022-04-05 14:36:00 +02:00
Lennart Poettering
197be5324e fix TODO 2022-04-05 14:02:36 +02:00
Lennart Poettering
598e431500 update TODO 2022-04-05 13:59:39 +02:00
Luca Boccassi
18a02561f1
Merge pull request #22953 from yuwata/test-sd-device
test: several fixlets for test-sd-device
2022-04-05 11:10:20 +01:00
Lennart Poettering
3e3c49cbe7 update TODO 2022-04-05 10:44:52 +02:00
Lennart Poettering
2cf120f7cf update TODO 2022-04-05 10:44:04 +02:00
Zbigniew Jędrzejewski-Szmek
42ac3bf1a3
Merge pull request #22956 from yuwata/network-fix-permission-error
network: ignore all errors in loading .network files
2022-04-05 08:59:44 +02:00
Yu Watanabe
c7749367e3 test-sd-device: ignore several errors when running on non-host network namespace
Fixes 93e04eb43b (commitcomment-70387367).
2022-04-05 14:33:19 +09:00
Yu Watanabe
b1d723228e test-sd-device: allow several devices removed during running test
To make the test stabler.
2022-04-05 14:29:52 +09:00
Yu Watanabe
901fa9a4c9 test-sd-device: device ID requires subsystem 2022-04-05 14:29:49 +09:00
Yu Watanabe
04d1fbd564 test-sd-device: log earlier which device is handled
To make debugging the test easier.
2022-04-05 14:29:41 +09:00
Yu Watanabe
20742f92c1
Merge pull request #22951 from keszybz/fix-entry-selection-bootctl-status
Fix entry selection in bootctl status
2022-04-05 13:42:43 +09:00