]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoMerge pull request #22983 from yuwata/login-use-symlinks-under-static_node-tags
Yu Watanabe [Wed, 6 Apr 2022 14:11:56 +0000 (23:11 +0900)] 
Merge pull request #22983 from yuwata/login-use-symlinks-under-static_node-tags

login: shorten code a bit

2 years agoudev: add a brief comment about the origin of the filters
Yu Watanabe [Wed, 6 Apr 2022 11:18:51 +0000 (20:18 +0900)] 
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.

2 years agologin: shorten code a bit 22983/head
Yu Watanabe [Tue, 5 Apr 2022 18:51:54 +0000 (03:51 +0900)] 
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.

2 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

2 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

2 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

2 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...

2 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

2 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

2 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.

2 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.

2 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().

2 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()

2 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

2 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.

2 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

2 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

2 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.

2 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

2 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.

2 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.

2 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.

2 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.

2 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

2 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

2 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.

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

Fixes #22976.

2 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.

2 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.

2 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.

2 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

2 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.

2 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

2 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

2 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

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

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

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

2 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

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

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

2 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

2 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.

2 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.

2 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

2 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.

2 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

2 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

2 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.

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

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

2 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.

2 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.

2 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.

2 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

2 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

2 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

2 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.

2 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()

2 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()

2 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.

2 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

2 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.

2 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.

2 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.

2 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.

2 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

2 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

2 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()

2 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.

2 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

2 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

2 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.

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

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

2 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
 ```

2 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

2 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

2 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

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

2 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

2 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.

2 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

2 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.

2 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.

2 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

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

2 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

2 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.

2 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"

2 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>
2 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>
2 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>
2 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>
2 years agobuild(deps): bump github/super-linter from 4.8.5 to 4.9.1
dependabot[bot] [Fri, 1 Apr 2022 09:04:17 +0000 (09:04 +0000)] 
build(deps): bump github/super-linter from 4.8.5 to 4.9.1

Bumps [github/super-linter](https://github.com/github/super-linter) from 4.8.5 to 4.9.1.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/b8641364ca9a79b3cf07f3c4c59a82709cd39094...3792fe5373cf2f5b22d590fcbbc4533d735c573e)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoveritysetup: fix memory corruption
Lennart Poettering [Fri, 1 Apr 2022 15:01:29 +0000 (17:01 +0200)] 
veritysetup: fix memory corruption

We must copy the option string, since in one case we are called with a
pointer into dynamic memory that will be freed by the caller.

As discussed here: https://github.com/systemd/systemd/pull/22908/files#r839394490

Follow-up for: #22908

2 years agoMerge pull request #22939 from yuwata/tree-wide-space
Yu Watanabe [Fri, 1 Apr 2022 16:32:26 +0000 (01:32 +0900)] 
Merge pull request #22939 from yuwata/tree-wide-space

tree-wide: add space after if, switch, for, and while

2 years agotree-wide: fix typo
Yu Watanabe [Fri, 1 Apr 2022 15:34:27 +0000 (00:34 +0900)] 
tree-wide: fix typo

2 years agoudev: add /dev/disk/by-diskseq symlink for block devices
Lennart Poettering [Thu, 31 Mar 2022 08:10:37 +0000 (10:10 +0200)] 
udev: add /dev/disk/by-diskseq symlink for block devices

This adds another symlink for block devices:

    /dev/disk/by-diskseq/<number>

where the number is the diskseq number as exposed by the kernel. It's
useful for apps because they can use it to open a device by diskseq, in
a way that is safe against device node reuse. I.e. if a device node path
like this is passed to an app it could open the device node via the
symlink and also parse the diskseq from the path. Once the device is
opened it could compare the parsed diskseq with the one returned by
BLKGETDISKSEQ on the open node, and if it matches they know they are
talking to the right device.

Fixes: #22906
2 years agoMerge pull request #22926 from bluca/analyze_offline_filter
Yu Watanabe [Fri, 1 Apr 2022 14:43:18 +0000 (23:43 +0900)] 
Merge pull request #22926 from bluca/analyze_offline_filter

analyze: fix offline checks for syscall filter and 'native' architecture