]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agosyscalls: update syscall definitions 23009/head
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 12:53:11 +0000 (14:53 +0200)] 
syscalls: update syscall definitions

3 years agovarious: add missing "#pragma once"
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 12:51:55 +0000 (14:51 +0200)] 
various: add missing "#pragma once"

3 years agoMerge parse-socket-bind-item.? into parse-helpers.?
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 12:03:26 +0000 (14:03 +0200)] 
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.

3 years agoMove path_simplify_and_warn() to new shared/parse-helpers.c
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 11:43:18 +0000 (13:43 +0200)] 
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.

3 years agotest-nspawn-util: fix the test to actually find anything
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 10:33:25 +0000 (12:33 +0200)] 
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.

3 years agonspawn: fix comparisons of versions with non-numerical suffixes
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 10:15:04 +0000 (12:15 +0200)] 
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.

3 years agoMove systemd_installation_has_version() to src/nspawn/
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 09:51:52 +0000 (11:51 +0200)] 
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.

3 years agoREADME: add one more kernel-version line
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 09:23:32 +0000 (11:23 +0200)] 
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 ;)

3 years agocore: inline an iterator variable
Zbigniew Jędrzejewski-Szmek [Thu, 7 Apr 2022 09:22:08 +0000 (11:22 +0200)] 
core: inline an iterator variable

3 years agoMerge pull request #22981 from yuwata/udev-node-cleanups
Yu Watanabe [Wed, 6 Apr 2022 10:34:59 +0000 (19:34 +0900)] 
Merge pull request #22981 from yuwata/udev-node-cleanups

udev: cleanups for device node handling

3 years agoMerge pull request #22985 from bluca/semaphore
Frantisek Sumsal [Wed, 6 Apr 2022 10:27:17 +0000 (10:27 +0000)] 
Merge pull request #22985 from bluca/semaphore

Semaphore CI fixes

3 years agoMerge pull request #22968 from keszybz/kernel-4.4
Lennart Poettering [Wed, 6 Apr 2022 10:03:47 +0000 (12:03 +0200)] 
Merge pull request #22968 from keszybz/kernel-4.4

Recommend kernel 4.15 or newer

3 years agoudev/net_id: avoid slot based names only for single function devices
Michal Sekletar [Wed, 23 Mar 2022 16:34:12 +0000 (17:34 +0100)] 
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...

3 years agosemaphoreci: skip boot-and-services test 22985/head
Luca Boccassi [Wed, 6 Apr 2022 00:04:14 +0000 (01:04 +0100)] 
semaphoreci: skip boot-and-services test

It started failing, disable it for now

3 years agosemaphoreci: move runner from Bionic to Focal
Luca Boccassi [Tue, 5 Apr 2022 21:15:42 +0000 (22:15 +0100)] 
semaphoreci: move runner from Bionic to Focal

3 years agotest-network: rename one .netdev to make the file removed after the test
Yu Watanabe [Wed, 6 Apr 2022 05:41:50 +0000 (14:41 +0900)] 
test-network: rename one .netdev to make the file removed after the test

Follow-up for 7809cab71738aa582ac30e7dbc8d1e76c303ff9e.

3 years agoudevadm: lock: fix TOCTOU
Yu Watanabe [Tue, 5 Apr 2022 16:17:23 +0000 (01:17 +0900)] 
udevadm: lock: fix TOCTOU

Fixes CID#1487744.

3 years agoudev: move apply_static_dev_perms() to udev-node.c 22981/head
Yu Watanabe [Tue, 5 Apr 2022 17:31:19 +0000 (02:31 +0900)] 
udev: move apply_static_dev_perms() to udev-node.c

and make it internally use udev_node_apply_permissions_impl().

3 years agoudev: upgrade mode in udev_node_apply_permissions_impl()
Yu Watanabe [Tue, 5 Apr 2022 17:20:11 +0000 (02:20 +0900)] 
udev: upgrade mode in udev_node_apply_permissions_impl()

3 years agoudev: split udev_node_apply_permissions() into two
Yu Watanabe [Tue, 5 Apr 2022 16:51:47 +0000 (01:51 +0900)] 
udev: split udev_node_apply_permissions() into two

3 years agoudev: drop unnecessary code
Yu Watanabe [Tue, 5 Apr 2022 16:35:04 +0000 (01:35 +0900)] 
udev: drop unnecessary code

Follow-up for 78e278ad48e0d2854f950f261804fde70121820e.

3 years agoMerge pull request #22980 from keszybz/test-help-and-version-output
Yu Watanabe [Wed, 6 Apr 2022 04:42:12 +0000 (13:42 +0900)] 
Merge pull request #22980 from keszybz/test-help-and-version-output

Test --help and --version output in more cases

3 years agosemaphoreci: speed up package installation
Luca Boccassi [Tue, 5 Apr 2022 22:45:27 +0000 (23:45 +0100)] 
semaphoreci: speed up package installation

Disable updating the manpage database, and use dpkg's unsafe-io flag

3 years agosemaphoreci: run dhclient manually on setup
Luca Boccassi [Tue, 5 Apr 2022 21:23:49 +0000 (22:23 +0100)] 
semaphoreci: run dhclient manually on setup

For some reason the guest container stopped having its
network interface configured. Run the dhcp client manually.

3 years agosemaphoreci: check keys.opengpgp.org first
Luca Boccassi [Tue, 5 Apr 2022 21:11:55 +0000 (22:11 +0100)] 
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

3 years agomeson: make kernel-install a template file, add --version, add to tests 22980/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 16:18:56 +0000 (18:18 +0200)] 
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.

3 years agomeson: also allow setting GIT_VERSION via templates
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 14:52:44 +0000 (16:52 +0200)] 
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.

3 years agotest: do --help/--version checks for systemd, firstboot, cryptenroll, s-n-w-o
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 12:12:52 +0000 (14:12 +0200)] 
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.

3 years agofirstboot: make --help output fit in 80 columns
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 12:11:42 +0000 (14:11 +0200)] 
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.

3 years agopid1: make --help output fit in 80 columns
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 12:10:04 +0000 (14:10 +0200)] 
pid1: make --help output fit in 80 columns

3 years agotest/check-help: check that --help and -h are identical
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 09:00:59 +0000 (11:00 +0200)] 
test/check-help: check that --help and -h are identical

3 years agotests: add a smoke test for --version option in binaries
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 08:51:21 +0000 (10:51 +0200)] 
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.

3 years agohwdb: fix parsing options
Yu Watanabe [Tue, 5 Apr 2022 16:08:35 +0000 (01:08 +0900)] 
hwdb: fix parsing options

Fixes #22976.

3 years agomanager: fix typo 22968/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 18:31:59 +0000 (20:31 +0200)] 
manager: fix typo

I guess that we could make an overflow if all the taint flags were set.

3 years agoREADME: describe taint flags and how to check them
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 18:31:03 +0000 (20:31 +0200)] 
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.

3 years agoREADME: say kernel 4.15 is the minimum recommended
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 08:24:27 +0000 (10:24 +0200)] 
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.

3 years agoMerge pull request #22975 from poettering/logind-longpress-followup
Lennart Poettering [Tue, 5 Apr 2022 16:42:17 +0000 (18:42 +0200)] 
Merge pull request #22975 from poettering/logind-longpress-followup

logind: "long press" follow-up

3 years agocore: command argument can be longer than PATH_MAX
Yu Watanabe [Tue, 5 Apr 2022 12:47:46 +0000 (21:47 +0900)] 
core: command argument can be longer than PATH_MAX

Fixes a bug introduced by 065364920281e1cf59cab989e17aff21790505c4.

Fixes #22957.

3 years agoman: split an overly long paragraph in two 22975/head
Lennart Poettering [Tue, 5 Apr 2022 13:59:01 +0000 (15:59 +0200)] 
man: split an overly long paragraph in two

3 years agologind: also show long press settings in default logind.conf
Lennart Poettering [Tue, 5 Apr 2022 13:52:49 +0000 (15:52 +0200)] 
logind: also show long press settings in default logind.conf

The configuration options where added back in
a520bb665417af7aa98dcb983f3583659bbab807 but this was never actually
added to the default logind.conf.

Follow-up-for: a520bb665417af7aa98dcb983f3583659bbab807
Follow-up-for: #19917

3 years agologind: expose long press actions on D-Bus
Lennart Poettering [Tue, 5 Apr 2022 13:50:56 +0000 (15:50 +0200)] 
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: a520bb665417af7aa98dcb983f3583659bbab807
Follow-up-for: #19917

3 years agoupdate TODO
Lennart Poettering [Tue, 5 Apr 2022 12:36:00 +0000 (14:36 +0200)] 
update TODO

3 years agofix TODO
Lennart Poettering [Tue, 5 Apr 2022 12:02:36 +0000 (14:02 +0200)] 
fix TODO

3 years agoupdate TODO
Lennart Poettering [Tue, 5 Apr 2022 11:59:39 +0000 (13:59 +0200)] 
update TODO

3 years agoMerge pull request #22953 from yuwata/test-sd-device
Luca Boccassi [Tue, 5 Apr 2022 10:10:20 +0000 (11:10 +0100)] 
Merge pull request #22953 from yuwata/test-sd-device

test: several fixlets for test-sd-device

3 years agoupdate TODO
Lennart Poettering [Tue, 5 Apr 2022 08:44:52 +0000 (10:44 +0200)] 
update TODO

3 years agoupdate TODO
Lennart Poettering [Tue, 5 Apr 2022 08:16:45 +0000 (10:16 +0200)] 
update TODO

3 years agoMerge pull request #22956 from yuwata/network-fix-permission-error
Zbigniew Jędrzejewski-Szmek [Tue, 5 Apr 2022 06:59:44 +0000 (08:59 +0200)] 
Merge pull request #22956 from yuwata/network-fix-permission-error

network: ignore all errors in loading .network files

3 years agotest-sd-device: ignore several errors when running on non-host network namespace 22953/head
Yu Watanabe [Tue, 5 Apr 2022 05:28:20 +0000 (14:28 +0900)] 
test-sd-device: ignore several errors when running on non-host network namespace

Fixes https://github.com/systemd/systemd/commit/93e04eb43bed6cd1cea344f8fb1002b62155fae2#commitcomment-70387367.

3 years agotest-sd-device: allow several devices removed during running test
Yu Watanabe [Mon, 4 Apr 2022 09:39:38 +0000 (18:39 +0900)] 
test-sd-device: allow several devices removed during running test

To make the test stabler.

3 years agotest-sd-device: device ID requires subsystem
Yu Watanabe [Mon, 4 Apr 2022 09:25:49 +0000 (18:25 +0900)] 
test-sd-device: device ID requires subsystem

3 years agotest-sd-device: log earlier which device is handled
Yu Watanabe [Mon, 4 Apr 2022 09:42:29 +0000 (18:42 +0900)] 
test-sd-device: log earlier which device is handled

To make debugging the test easier.

3 years agoMerge pull request #22951 from keszybz/fix-entry-selection-bootctl-status
Yu Watanabe [Tue, 5 Apr 2022 04:42:43 +0000 (13:42 +0900)] 
Merge pull request #22951 from keszybz/fix-entry-selection-bootctl-status

Fix entry selection in bootctl status

3 years agoMerge pull request #22964 from yuwata/udevadm-lock-follow-ups
Yu Watanabe [Tue, 5 Apr 2022 04:13:06 +0000 (13:13 +0900)] 
Merge pull request #22964 from yuwata/udevadm-lock-follow-ups

udevadm lock follow ups

3 years agotest: use udevadm wait and lock 22964/head
Yu Watanabe [Mon, 4 Apr 2022 18:31:58 +0000 (03:31 +0900)] 
test: use udevadm wait and lock

Hopefully fixes #22911.

3 years agoshell-completion: update for udevadm
Yu Watanabe [Mon, 4 Apr 2022 18:17:48 +0000 (03:17 +0900)] 
shell-completion: update for udevadm

3 years agofix typo
Yu Watanabe [Mon, 4 Apr 2022 18:56:10 +0000 (03:56 +0900)] 
fix typo

3 years agoman: add annotated example for bootctl status & list 22951/head
Zbigniew Jędrzejewski-Szmek [Mon, 4 Apr 2022 08:45:47 +0000 (10:45 +0200)] 
man: add annotated example for bootctl status & list

This is based on the output on my laptop, with various manual adjustments.
If people have other types of entries, it'd be useful to add them here. In
particular, some dual-boot entries would be nice.

3 years agoman: fix tag syntax
Zbigniew Jędrzejewski-Szmek [Mon, 4 Apr 2022 08:13:16 +0000 (10:13 +0200)] 
man: fix tag syntax

Strangely enough, having <varlistenetry>s outside of <variablelist> wasn't
causing visual problems. But having two <listitem>s in one <varlistentry>
resulted in the paragraphs running together in the rendered man page.

3 years agobootctl: unify boot entry loading for "status" and "list"
Zbigniew Jędrzejewski-Szmek [Fri, 1 Apr 2022 10:08:17 +0000 (12:08 +0200)] 
bootctl: unify boot entry loading for "status" and "list"

We must be consistent in the two listings, so let's split out the loading code
and call it from both verb_status() and verb_list(). This effectively makes
verb_status() also call efi_loader_get_entries().

There is still some code duplicated, but that's hard to avoid. Error messages
are made identical for the same errors in various places.

Fixes #22580.

3 years agoMerge pull request #22963 from poettering/udevadm-diskseq-fix
Yu Watanabe [Mon, 4 Apr 2022 18:57:24 +0000 (03:57 +0900)] 
Merge pull request #22963 from poettering/udevadm-diskseq-fix

sd-device diskseq fix + udevadm info improvements

3 years agoMerge pull request #22867 from poettering/lockdev-util
Yu Watanabe [Mon, 4 Apr 2022 18:04:23 +0000 (03:04 +0900)] 
Merge pull request #22867 from poettering/lockdev-util

add small "udevadm lock" tool for locking a block device

3 years agoMerge pull request #22960 from mrc0mmand/use-udevadm-wait
Luca Boccassi [Mon, 4 Apr 2022 17:39:59 +0000 (18:39 +0100)] 
Merge pull request #22960 from mrc0mmand/use-udevadm-wait

test: use the new `udevadm wait` verb to wait for the loop device

3 years agotree-wide: use 'Architecture' type consistently across the tree
Lennart Poettering [Mon, 4 Apr 2022 10:46:03 +0000 (12:46 +0200)] 
tree-wide: use 'Architecture' type consistently across the tree

Some parts of our tree used 'Architecture' for storing architectures,
others used ints. Let's unify on the former.

Inspired by #22952's rework of the 'Virtualization' enum.

3 years agoudev/net: always log error in link_load_one() 22956/head
Yu Watanabe [Mon, 4 Apr 2022 17:03:22 +0000 (02:03 +0900)] 
udev/net: always log error in link_load_one()

3 years agonetwork: always log error in network_load_one() and netdev_load_one()
Yu Watanabe [Mon, 4 Apr 2022 16:58:37 +0000 (01:58 +0900)] 
network: always log error in network_load_one() and netdev_load_one()

3 years agonetwork: ignore all errors in loading .network files
Yu Watanabe [Mon, 4 Apr 2022 16:57:03 +0000 (01:57 +0900)] 
network: ignore all errors in loading .network files

This partially reverts 9202b567bcdd0c1f6a1fc2a5f36602e619960813.

Fixes #22954.

3 years agoman: document various sd_device_get_xyz() functions 22963/head
Lennart Poettering [Mon, 4 Apr 2022 13:35:01 +0000 (15:35 +0200)] 
man: document various sd_device_get_xyz() functions

3 years agoudevadm: if invalid devices are specified on "info" verb, continue
Lennart Poettering [Mon, 4 Apr 2022 14:01:25 +0000 (16:01 +0200)] 
udevadm: if invalid devices are specified on "info" verb, continue

If multiple devices are specified on "udevadm info", then show data
about them all even if one is missing. Return first encountered error
though.

3 years agoudevadm: add a dash of color to "udevadm info"
Lennart Poettering [Mon, 4 Apr 2022 14:00:25 +0000 (16:00 +0200)] 
udevadm: add a dash of color to "udevadm info"

Let's make it easier to discern the "header" of device records from the
"body", i.e. non-property data from property data, by using some
conservative coloring.

3 years agoudevadm: show more fields of sd_device objects in "udevadm info"
Lennart Poettering [Mon, 4 Apr 2022 13:25:01 +0000 (15:25 +0200)] 
udevadm: show more fields of sd_device objects in "udevadm info"

Let's make things easier to debug, and show a more comprehensive set of
fields, extending on the existing output syntax that starts with one
marker character followed by a colon and a space.

3 years agosd-device: actually read diskseq if told so
Lennart Poettering [Mon, 4 Apr 2022 13:18:57 +0000 (15:18 +0200)] 
sd-device: actually read diskseq if told so

sd_device_get_diskseq() actually called device_read_uevent_file() but
that function didn't actually parse DISKSEQ= so far. Fix that.

3 years agosd-device: rename return parameter of sd_device_get_devpath() to ret
Lennart Poettering [Mon, 4 Apr 2022 13:20:01 +0000 (15:20 +0200)] 
sd-device: rename return parameter of sd_device_get_devpath() to ret

3 years agoman: properly conditionalize kernel-install man page
Lennart Poettering [Mon, 4 Apr 2022 13:38:33 +0000 (15:38 +0200)] 
man: properly conditionalize kernel-install man page

Change f887eab1da85d0053321d43228042d90720eb77e conditionalized the
building of ther kenel-install man page in the generated meson output,
instead of the source in the XML markup. Thus, whenever the rules file
is updated the conditionalization is lost. Correct that.

Follow-up for: f887eab1da85d0053321d43228042d90720eb77e

3 years agojournald: make use of CLAMP() in cache_space_refresh()
Franck Bui [Fri, 18 Mar 2022 07:12:48 +0000 (08:12 +0100)] 
journald: make use of CLAMP() in cache_space_refresh()

3 years agojournald: make sure journal_file_open() doesn't leave a corrupted file around after...
Franck Bui [Fri, 18 Mar 2022 07:12:06 +0000 (08:12 +0100)] 
journald: make sure journal_file_open() doesn't leave a corrupted file around after failing

This can be problematic especially when there's no more free disk
space. Consider the following:.

When disk space becomes sparse, writting to the system journal can lead to
error. In this case journald attempts to make room by rotating the journals,
which consists in archiving online journals and opening new ones.

However opening new files is likely to fail too and in this case
journal_file_open() leaves half initialized file around but in online
state. Then the error is propagated and journald switches into volatile mode.

Next time a new message is received by journald, it tries to open the
persistent system journal file to switch automatically back to persistent
mode.

When opening the system journal, journal_file_open(), called by
managed_journal_file_open_reliably(), finds the persistent system journal left
previously and assumes that it was uncleanly closed and considers it as
corrupted. The error is reported to managed_journal_file_open_reliably(), which
backs the file up and attempts to create a new system file, which fails and
leaves a corrupted system file again.

Since this is done for each message received by journald, /var/log/message can
be filled with backup files pretty quickly.

To prevent this, the patch makes sure to delete the newly created file in case
of error.

3 years agoman: document new udevadm lock tool 22867/head
Lennart Poettering [Mon, 28 Mar 2022 13:10:56 +0000 (15:10 +0200)] 
man: document new udevadm lock tool

3 years agoudevadm: add new "lock" verb for locking block devices
Lennart Poettering [Fri, 1 Apr 2022 12:27:45 +0000 (14:27 +0200)] 
udevadm: add new "lock" verb for locking block devices

3 years agohash-funcs: tweak odering in devt_compare_func()
Lennart Poettering [Fri, 1 Apr 2022 12:21:44 +0000 (14:21 +0200)] 
hash-funcs: tweak odering in devt_compare_func()

Let's order dev_t's by their major first, minor secondary. The binary
encoding of the two fields is weirdly interleaved and different in
kernel and glibc, hence let's focus on the generic part that works like
users would expect it.

So far the function is only used to compare for equality, not for
sorting, hence this has no immediate effect.

3 years agoTODO
Lennart Poettering [Mon, 4 Apr 2022 13:20:19 +0000 (15:20 +0200)] 
TODO

3 years agopartition: use `udevadm wait` 22960/head
Frantisek Sumsal [Mon, 4 Apr 2022 13:56:00 +0000 (15:56 +0200)] 
partition: use `udevadm wait`

3 years agotest: use the new `udevadm wait` verb to wait for the loop device
Frantisek Sumsal [Mon, 4 Apr 2022 13:58:03 +0000 (15:58 +0200)] 
test: use the new `udevadm wait` verb to wait for the loop device

 The original workaround didn't work, as `systemd-repart` kept failing
 even when the `/dev/loopX` device was present:

 ```
 [   13.959419] H testsuite-58.sh[280]: + LOOP=/dev/loop1
 [   13.959636] H testsuite-58.sh[280]: + :
 [   13.959764] H testsuite-58.sh[280]: + test -e /dev/loop1
 [   13.959895] H testsuite-58.sh[280]: + break
 [   13.960023] H testsuite-58.sh[280]: + systemd-repart --pretty=yes --definitions=/tmp/testsuite-58-sector/ --seed=750b6cd5c4ae4012a15e7be3c29e6a47 --empty=require --dry-run=no /dev/loop1
 [   13.970538] H testsuite-58.sh[363]: Device '/dev/loop1' has no dm-crypt/dm-verity device, no need to look for underlying block device.
 [   13.970538] H testsuite-58.sh[363]: Failed to determine canonical path for '/dev/loop1': No such file or directory
 [   13.970538] H testsuite-58.sh[363]: Failed to open file or determine backing device of /dev/loop1: No such file or directory
 ```

3 years agoMerge pull request #22943 from yuwata/dhcp6-client-requet-options
Yu Watanabe [Mon, 4 Apr 2022 13:55:02 +0000 (22:55 +0900)] 
Merge pull request #22943 from yuwata/dhcp6-client-requet-options

sd-dhcp6-client: requet options

3 years agoMerge pull request #22952 from poettering/rework-kvm-hyperv
Yu Watanabe [Mon, 4 Apr 2022 13:53:56 +0000 (22:53 +0900)] 
Merge pull request #22952 from poettering/rework-kvm-hyperv

virt: tweak kvm with hyperv enlightenments

3 years agogpt: introduce common implementation of type uuid search loop
Lennart Poettering [Mon, 4 Apr 2022 10:55:12 +0000 (12:55 +0200)] 
gpt: introduce common implementation of type uuid search loop

3 years agoupdate TODO
Lennart Poettering [Mon, 4 Apr 2022 10:45:21 +0000 (12:45 +0200)] 
update TODO

3 years agovirt: move array iterators to smaller scope, and use right type 22952/head
Lennart Poettering [Mon, 4 Apr 2022 09:27:58 +0000 (11:27 +0200)] 
virt: move array iterators to smaller scope, and use right type

3 years agovirt: make virtualization enum a named type
Lennart Poettering [Mon, 4 Apr 2022 09:19:44 +0000 (11:19 +0200)] 
virt: make virtualization enum a named type

These days we have a mechanism for safely returning errnos in enum
types, via definining -ERRNO_MAX as one special enu value. Let's use
that for Virtualization.

No change in behaviour, just some typesafety improvement.

3 years agovirt: rework kvm with hyperv enlightenment checks a bit
Lennart Poettering [Mon, 4 Apr 2022 08:29:40 +0000 (10:29 +0200)] 
virt: rework kvm with hyperv enlightenment checks a bit

Let's avoid extending the virtualization with an "alias" entry that has
the same string assigned as another.

The only reason this was done was to make the patch small that added a
second CPUID vendor string for kvm to the vm_table[] array. Let's
instead rework the array to use struct elements that match up strings
with ids. Given the array was previously mostly sparse this should be a
general improvement.

Fixes: #22950
Follow-up for: #22945

3 years agobootctl: do not call acquire_esp() twice
Zbigniew Jędrzejewski-Szmek [Mon, 4 Apr 2022 07:36:44 +0000 (09:36 +0200)] 
bootctl: do not call acquire_esp() twice

That function is nasty because it modifies global state. We should call it just
once in each call path.

Also drop 'return 1' which doesn't seem to have any use.

3 years agosd-dhcp6-client: request several options 22943/head
Yu Watanabe [Fri, 11 Feb 2022 05:59:53 +0000 (14:59 +0900)] 
sd-dhcp6-client: request several options

Even though these options are not currently used by sd-dhcp6-client,
RFC 8415 states these options MUST be requested.

3 years agonetwork: dhcp6: request DNS servers or friends only when they will be used
Yu Watanabe [Sun, 3 Apr 2022 10:34:40 +0000 (19:34 +0900)] 
network: dhcp6: request DNS servers or friends only when they will be used

3 years agodhcp: make option names singular
Yu Watanabe [Sun, 3 Apr 2022 10:44:04 +0000 (19:44 +0900)] 
dhcp: make option names singular

3 years agosd-dhcp6-client: sort requesting options
Yu Watanabe [Fri, 1 Apr 2022 16:13:24 +0000 (01:13 +0900)] 
sd-dhcp6-client: sort requesting options

3 years agosd-dhcp6-client: rename req_opts_len -> n_req_opts
Yu Watanabe [Fri, 1 Apr 2022 16:11:32 +0000 (01:11 +0900)] 
sd-dhcp6-client: rename req_opts_len -> n_req_opts

As 'len' is confusing and we may misunderstand it as the size of
the buffer instead of the number of options.

3 years agoIdentify kvm + hv_passthrough as "kvm"
Brett Holman [Thu, 31 Mar 2022 20:04:57 +0000 (14:04 -0600)] 
Identify kvm + hv_passthrough as "kvm"

3 years agobuild(deps): bump meson from 0.61.2 to 0.62.0 in /.github/workflows
dependabot[bot] [Fri, 1 Apr 2022 09:04:31 +0000 (09:04 +0000)] 
build(deps): bump meson from 0.61.2 to 0.62.0 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 0.61.2 to 0.62.0.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/0.61.2...0.62.0)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump actions/labeler from 3.1.0 to 4
dependabot[bot] [Fri, 1 Apr 2022 09:04:12 +0000 (09:04 +0000)] 
build(deps): bump actions/labeler from 3.1.0 to 4

Bumps [actions/labeler](https://github.com/actions/labeler) from 3.1.0 to 4.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/3d612d72e6784a1a65365cc6d33b5a001c12bf10...9fd24f1f9d6ceb64ba34d181b329ee72f99978a0)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump actions/checkout from 2.4.0 to 3
dependabot[bot] [Fri, 1 Apr 2022 09:04:08 +0000 (09:04 +0000)] 
build(deps): bump actions/checkout from 2.4.0 to 3

Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/ec3a7ce113134d7a93b817d10a8272cb61118579...a12a3943b4bdde767164f792f33f40b04645d846)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump github/codeql-action from 1.1.3 to 2.1.6
dependabot[bot] [Fri, 1 Apr 2022 09:04:02 +0000 (09:04 +0000)] 
build(deps): bump github/codeql-action from 1.1.3 to 2.1.6

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.1.3 to 2.1.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/75f07e7ab2ee63cba88752d8c696324e4df67466...28eead240834b314f7def40f6fcba65d100d99b1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>