]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
20 months agoMerge pull request #24412 from keszybz/man-similarly
Luca Boccassi [Tue, 23 Aug 2022 12:17:13 +0000 (13:17 +0100)] 
Merge pull request #24412 from keszybz/man-similarly

man: grammar cleanups

20 months agoMerge pull request #23893 from yuwata/core-mount-re-read-mountinfo
Luca Boccassi [Tue, 23 Aug 2022 11:46:39 +0000 (12:46 +0100)] 
Merge pull request #23893 from yuwata/core-mount-re-read-mountinfo

core/mount: adjust deserialized state based on if the corresponding mountinfo entry exists or not

20 months agoman/crypttab: rework formatting in "key acquisition section" 24412/head
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 10:14:23 +0000 (12:14 +0200)] 
man/crypttab: rework formatting in "key acquisition section"

<example> without <title> was rendered as "Example 1.", which did not
look good. While at it, the text is rewored to be, I hope, a bit easier to
read.

20 months agotest: install /etc/default/knot if available as well
Frantisek Sumsal [Mon, 22 Aug 2022 20:04:51 +0000 (22:04 +0200)] 
test: install /etc/default/knot if available as well

The knot.service on Ubuntu Jammy loads an env file which we didn't
install, causing the service to fail:

```
knot.service: Will spawn child (service_enter_start_pre): /usr/sbin/knotc
knot.service: Failed to load environment files: No such file or directory
knot.service: Failed to run 'start-pre' task: No such file or directory
knot.service: Failed with result 'resources'.
knot.service: Service will not restart (restart setting)
```

20 months agoman: similar → similarly
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 10:12:28 +0000 (12:12 +0200)] 
man: similar → similarly

Something *is* similar
Something *works* similarly
Something does something, similarly to how something else does something

See https://sites.ulethbridge.ca/roussel/2017/11/29/similar-and-similarly-are-they-similar/
for a clear explanation.

20 months agoMerge pull request #24352 from DaanDeMeyer/mkosi-opensuse
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 09:05:02 +0000 (11:05 +0200)] 
Merge pull request #24352 from DaanDeMeyer/mkosi-opensuse

mkosi: Update to latest commit

20 months agofix typos
eggfly [Tue, 23 Aug 2022 08:09:59 +0000 (16:09 +0800)] 
fix typos

20 months agofix typo
jiangchuangang [Tue, 23 Aug 2022 03:22:37 +0000 (11:22 +0800)] 
fix typo

20 months agoAllow uneven length BootXXXX variables
Goffredo Baroncelli [Mon, 22 Aug 2022 19:25:45 +0000 (21:25 +0200)] 
Allow uneven length BootXXXX variables

The BootXXXX variables may have an uneven length. Don't return error
in this case.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
20 months agochase-symlinks: refuse more chase_symlink() flags in the open/stat flavours
Lennart Poettering [Mon, 22 Aug 2022 09:33:52 +0000 (11:33 +0200)] 
chase-symlinks: refuse more chase_symlink() flags in the open/stat flavours

These flags make no sense when we try to access the final inode, hence
refuse.

20 months agomeasure: add --current switch for "systemd-measure calculate"
Lennart Poettering [Wed, 17 Aug 2022 16:40:19 +0000 (18:40 +0200)] 
measure: add --current switch for "systemd-measure calculate"

This allows allows shortcutting measurements of the specified files and
use the information from /sys/ instead.

This is not too useful on its own given that "systemd-measure status"
already exists which displays the current, relevant PCR values. The main
difference is how "complete" the information is. "status" will detect if
the measurements make any sense, and show more than PCR 11. "calculate
--current" otoh only reads PCR 11 and uses that, and that's really it.

This is mainly preparation for later work to add PCR signing to the
tool, where usually it makes most sense to sign prepared kernel images,
but for testing it's really useful to shortcut signing to the current
PCR values instead

20 months agotree-wide: use path_join() instead of prefix_roota() in various cases
Lennart Poettering [Mon, 22 Aug 2022 09:38:58 +0000 (11:38 +0200)] 
tree-wide: use path_join() instead of prefix_roota() in various cases

prefix_roota() is something we should stop using. It is bad for three
reasons:

1. As it names suggests it's supposed to be used when working relative
   to some root directory, but given it doesn't follow symlinks (and
   instead just stupidly joins paths) it is not a good choice for that.

2. More often than not it is currently used with inputs under control of
   the user, and that is icky given it typically allocates memory on the
   stack.

3. It's a redundant interface, where chase_symlinks() and path_join()
   already exist as better, safer interfaces.

Hence, let's start moving things from prefix_roota() to path_join() for
the cases where that's appropriate.

20 months agoMerge pull request #24392 from poettering/chase-symlinks-more-stuff
Lennart Poettering [Mon, 22 Aug 2022 16:41:14 +0000 (18:41 +0200)] 
Merge pull request #24392 from poettering/chase-symlinks-more-stuff

some tweaks to chase_symlinks() and port some code from prefix_roota() over

20 months agotest: make TEST-58-REPART support nspawn
Yu Watanabe [Fri, 19 Aug 2022 19:59:03 +0000 (04:59 +0900)] 
test: make TEST-58-REPART support nspawn

20 months agotest: merge test-repart.sh and TEST-58-REPART
Yu Watanabe [Fri, 19 Aug 2022 19:37:00 +0000 (04:37 +0900)] 
test: merge test-repart.sh and TEST-58-REPART

20 months agotest: modernize TEST-58-REPART
Yu Watanabe [Fri, 19 Aug 2022 07:33:09 +0000 (16:33 +0900)] 
test: modernize TEST-58-REPART

20 months agogpt: fix alignment
Yu Watanabe [Sat, 20 Aug 2022 01:56:57 +0000 (10:56 +0900)] 
gpt: fix alignment

20 months agogpt: fix native uuids for s390x
Yu Watanabe [Sat, 20 Aug 2022 01:52:39 +0000 (10:52 +0900)] 
gpt: fix native uuids for s390x

__s390__ is defined for both s390 and s390x. Hence, we need to define
the native uuids for s390x at first.

20 months agoudev: fix inversed inequality for timeout of retrying event
Yu Watanabe [Fri, 19 Aug 2022 12:25:03 +0000 (21:25 +0900)] 
udev: fix inversed inequality for timeout of retrying event

Follow-up for 5d354e525a56955ae7f68062e283dda85ab07794.

20 months agorepart: drop doubled space
Yu Watanabe [Fri, 19 Aug 2022 19:40:38 +0000 (04:40 +0900)] 
repart: drop doubled space

20 months agobash-completion: add systemd-sysext support
Antonio Alvarez Feijoo [Mon, 22 Aug 2022 13:05:53 +0000 (15:05 +0200)] 
bash-completion: add systemd-sysext support

20 months agosysext: add missing COMMAND to the help output and man synopsis
Antonio Alvarez Feijoo [Mon, 22 Aug 2022 12:23:57 +0000 (14:23 +0200)] 
sysext: add missing COMMAND to the help output and man synopsis

20 months agoMerge pull request #24385 from yuwata/hostname-chassis
Luca Boccassi [Mon, 22 Aug 2022 14:40:38 +0000 (15:40 +0100)] 
Merge pull request #24385 from yuwata/hostname-chassis

hostname: fix fallback chassis type

21 months agoci: Drop `actions/setup-node` - unused
Jan Macku [Mon, 22 Aug 2022 10:45:12 +0000 (12:45 +0200)] 
ci: Drop `actions/setup-node` - unused

In `issue_labeler.yml` is no need for node.js runtime (`actions/setup-node`). It was accidentally added by `copy & paste` from another workflow.

21 months agoconf-files: port conf_files_list() over to chase_symlinks() from prefix_roota() 24392/head
Lennart Poettering [Mon, 22 Aug 2022 12:07:27 +0000 (14:07 +0200)] 
conf-files: port conf_files_list() over to chase_symlinks() from prefix_roota()

21 months agohwdb-test: don't rely on --root= quirk
Lennart Poettering [Mon, 22 Aug 2022 12:06:10 +0000 (14:06 +0200)] 
hwdb-test: don't rely on --root= quirk

Previously, the test would rely on the fact that systemd-hwdb would
follow symlinks outside of the --root= hierarchy. That's a bug however,
and systemd-hwdb shouldn't do that. Hence let's remove the fact that the
test relies on it, so that we can then fix systemd-hwdb (specifically:
conf_files_list()) accordingly.

21 months agobootctl: port some more code over to chase_symlinks() from prefix_roota()
Lennart Poettering [Mon, 22 Aug 2022 12:06:49 +0000 (14:06 +0200)] 
bootctl: port some more code over to chase_symlinks() from prefix_roota()

This is far from complete, but let's start moving this way.

21 months agochase-symlinks: add chase_symlinks_and_access() helper
Lennart Poettering [Mon, 22 Aug 2022 09:36:12 +0000 (11:36 +0200)] 
chase-symlinks: add chase_symlinks_and_access() helper

This is similar to chase_symlinks_and_access() but wraps access() rather
than stat()

21 months agochase-symlinks: fix shortcut condition
Lennart Poettering [Mon, 22 Aug 2022 09:35:43 +0000 (11:35 +0200)] 
chase-symlinks: fix shortcut condition

21 months agochase-symlinks: honour CHASE_NOFOLLOW flag properly in some cases
Lennart Poettering [Mon, 22 Aug 2022 09:34:40 +0000 (11:34 +0200)] 
chase-symlinks: honour CHASE_NOFOLLOW flag properly in some cases

21 months agotest: add test case for chassis type 24385/head
Yu Watanabe [Mon, 22 Aug 2022 05:05:22 +0000 (14:05 +0900)] 
test: add test case for chassis type

21 months agoAdd support for Fn+PrtSc on Thinkpads
Tomáš Hnyk [Sun, 21 Aug 2022 11:34:20 +0000 (13:34 +0200)] 
Add support for Fn+PrtSc on Thinkpads

This adds support for Fn+PrtSc on my Lenovo Thinkpad Extreme gen 2. Judging by the picture on the key, it should probably instead of prog2 be "selective_screenshot" (that is a possible value from judging this list https://gist.githubusercontent.com/samvel1024/02e5675e04f9d84f098e98bcd0e1ea12/raw/e18d950ce571b4ff5c832cc06406e9a6afece132/keynames.txt ) but that does not register with evtest at all. With this change, evtest reports:

```
Event: time 1661081631.027773, type 1 (EV_KEY), code 149 (KEY_PROG2), value 1
Event: time 1661081631.027773, -------------- SYN_REPORT ------------
Event: time 1661081631.027886, type 1 (EV_KEY), code 149 (KEY_PROG2), value 0
Event: time 1661081631.027886, -------------- SYN_REPORT ------------
```

I am not sure if systemd is the right place to add this, if not, please refer me somewhere else.

21 months agotake jointly mounted controllers into account when migrate cgroups, otherwise "CGroup...
jiangchuangang [Mon, 22 Aug 2022 03:13:51 +0000 (11:13 +0800)] 
take jointly mounted controllers into account when migrate cgroups, otherwise "CGroupMask done" seems to be redundant.

21 months agohostname: make chassis type actually obtained from ACPI when nothing from DMI
Yu Watanabe [Mon, 22 Aug 2022 04:36:54 +0000 (13:36 +0900)] 
hostname: make chassis type actually obtained from ACPI when nothing from DMI

Fixes a bug introduced by 8c8b1800e90d4307397300ef32b0f6d95efad057.

Fixes #24384.

21 months agoMerge pull request #24379 from mrc0mmand/llvm-15 23803/head
Luca Boccassi [Sat, 20 Aug 2022 22:38:52 +0000 (23:38 +0100)] 
Merge pull request #24379 from mrc0mmand/llvm-15

ci: build with clang-15; drop clang-12

21 months agomkosi: Install tests in final image
Daan De Meyer [Tue, 16 Aug 2022 10:50:29 +0000 (12:50 +0200)] 
mkosi: Install tests in final image

21 months agohashmap: use assert_se() to make clang happy 24379/head
Frantisek Sumsal [Sat, 20 Aug 2022 19:57:18 +0000 (21:57 +0200)] 
hashmap: use assert_se() to make clang happy

Otherwise it complains about a set but unused variable:

```
../src/basic/hashmap.c:1070:48: error: variable 'n_rehashed' set but not used [-Werror,-Wunused-but-set-variable]
        unsigned old_n_buckets, new_n_buckets, n_rehashed, new_n_entries;
                                                       ^
                                                       1 error generated.
```

21 months agocoredump: drop an unused variable
Frantisek Sumsal [Sat, 20 Aug 2022 19:04:24 +0000 (21:04 +0200)] 
coredump: drop an unused variable

21 months agonetwork: drop an unused variable
Frantisek Sumsal [Sat, 20 Aug 2022 19:00:14 +0000 (21:00 +0200)] 
network: drop an unused variable

21 months agomachine: drop an unused variable
Frantisek Sumsal [Sat, 20 Aug 2022 18:45:27 +0000 (20:45 +0200)] 
machine: drop an unused variable

21 months agosd-journal: drop an unused variable
Frantisek Sumsal [Sat, 20 Aug 2022 18:38:17 +0000 (20:38 +0200)] 
sd-journal: drop an unused variable

21 months agoci: build with clang-15; drop clang-12
Frantisek Sumsal [Sat, 20 Aug 2022 18:11:32 +0000 (20:11 +0200)] 
ci: build with clang-15; drop clang-12

21 months agoMerge pull request #24378 from yuwata/test-network-issue-24377
Yu Watanabe [Sat, 20 Aug 2022 13:24:53 +0000 (22:24 +0900)] 
Merge pull request #24378 from yuwata/test-network-issue-24377

test-network: add test case for issue #24377

21 months agotest-network: add test for issue #24377 24378/head
Yu Watanabe [Sat, 20 Aug 2022 11:36:12 +0000 (20:36 +0900)] 
test-network: add test for issue #24377

The issue has been already fixed by
b05e52000b4eee764b383cc3031da0a3739e996e (PR #24020).

21 months agotest-network: add helper functions for reading logs of networkd
Yu Watanabe [Sat, 20 Aug 2022 11:35:18 +0000 (20:35 +0900)] 
test-network: add helper functions for reading logs of networkd

21 months agoMerge pull request #24356 from keszybz/sd-netlink-api
Yu Watanabe [Sat, 20 Aug 2022 10:11:02 +0000 (19:11 +0900)] 
Merge pull request #24356 from keszybz/sd-netlink-api

Small improvements to the sd-netlink api

21 months agohwdb: Add Avita Liber NS13A2 (#24376)
Aryan singh [Sat, 20 Aug 2022 10:02:54 +0000 (15:32 +0530)] 
hwdb: Add Avita Liber NS13A2 (#24376)

This fixes the discrepancies in the coordinate ranges for the touchpad, touchpad in this device(NS13A2) is generic and the same one is used in most models.

21 months agomeasure: store bank name in PcrState structure
Lennart Poettering [Wed, 17 Aug 2022 15:10:53 +0000 (17:10 +0200)] 
measure: store bank name in PcrState structure

Let's not query/strdup()ascii_strlower() it all the time, but just cache
it once and use it.

21 months agotest: wait for whole block device instead of partition
Yu Watanabe [Fri, 19 Aug 2022 22:09:21 +0000 (07:09 +0900)] 
test: wait for whole block device instead of partition

In 'udevadm lock' the device /dev/loopX is locked instead of
/dev/loopXp1. Hence, 'udevadm wait' should wait for /dev/loopX.

For some reasons, the kernel sometimes does not emit uevent for
partitions, and 'udevadm wait' for partitions may fail.

Fixes #24360.

21 months agotest: correctly process multiline strings in $KERNEL_APPEND
Frantisek Sumsal [Fri, 19 Aug 2022 14:30:24 +0000 (16:30 +0200)] 
test: correctly process multiline strings in $KERNEL_APPEND

Some tests (like TEST-02) set a multiline string to $KERNEL_APPEND
(which is a valid thing to do), unfortunately we'd use only the first
line of it and throw the rest away, e.g:

```
$ printf "%s" "$x"
hello

this is a multiline

kernel command line
$ read -ra out <<< "$x"
$ printf "%s" "${out[@]}"
hello
```

Let's use readarray/mapfile instead to avoid this:

```
$ readarray out <<< "$x"
$ printf "%s" "${out[@]}"
hello

this is a multiline

kernel command line

```

21 months agomeasure: add json output
Lennart Poettering [Fri, 12 Aug 2022 13:23:44 +0000 (15:23 +0200)] 
measure: add json output

21 months agoMerge pull request #24368 from poettering/tpm2-json-pcr-array-rework
Lennart Poettering [Fri, 19 Aug 2022 19:51:47 +0000 (21:51 +0200)] 
Merge pull request #24368 from poettering/tpm2-json-pcr-array-rework

tpm2: add helpers for building/parsing JSON arrays of PCR indexes

21 months agoMerge pull request #24350 from DaanDeMeyer/docs-pkexec
Luca Boccassi [Fri, 19 Aug 2022 19:43:50 +0000 (20:43 +0100)] 
Merge pull request #24350 from DaanDeMeyer/docs-pkexec

docs: Recommend pkexec over using an askpass program with sudo

21 months agotpm2-util: introduce tpm2_parse_pcr_argument() helper
Lennart Poettering [Wed, 17 Aug 2022 15:00:27 +0000 (17:00 +0200)] 
tpm2-util: introduce tpm2_parse_pcr_argument() helper

Add a new tpm2_parse_pcr_argument() helper that unifies how we merge PCR
masks in a single function, we can use all over the place. Previously we
had basically the same code for this at 4 places.

21 months agorules: import previous SYSTEMD_READY state for suspended DM devices and skip other...
Michal Sekletar [Tue, 2 Aug 2022 10:38:30 +0000 (12:38 +0200)] 
rules: import previous SYSTEMD_READY state for suspended DM devices and skip other rules

We can't get any FS meta-data from a suspended device. Hence defer
making any plugged/unplugged decisions, i.e. we just import whatever was
previous state and skip processing all other rules.

Thanks Lennart Poettering <lennart@poettering.net> for suggesting this
solution.

21 months agotpm2-util: expose more hash algorithms
Lennart Poettering [Wed, 17 Aug 2022 15:30:29 +0000 (17:30 +0200)] 
tpm2-util: expose more hash algorithms

swtpm supports them, hence maybe support them in our codebase, too

21 months agotpm2-util: add TPM2_PCR_MASK_VALID() helper
Lennart Poettering [Wed, 17 Aug 2022 14:49:14 +0000 (16:49 +0200)] 
tpm2-util: add TPM2_PCR_MASK_VALID() helper

21 months agosd-netlink: use SD_EVENT_ONESHOT for a time-based callback 24356/head
Zbigniew Jędrzejewski-Szmek [Fri, 19 Aug 2022 15:43:56 +0000 (17:43 +0200)] 
sd-netlink: use SD_EVENT_ONESHOT for a time-based callback

21 months agomkosi: Drop workarounds 24352/head
Daan De Meyer [Thu, 18 Aug 2022 18:42:04 +0000 (20:42 +0200)] 
mkosi: Drop workarounds

None of these should be necessary anymore with recent versions of
mkosi.

21 months agomkosi: Update to latest commit
Daan De Meyer [Thu, 18 Aug 2022 17:32:23 +0000 (19:32 +0200)] 
mkosi: Update to latest commit

Fixes #1128

21 months agoTEST-70-TPM2: use "truncate" to generate disk image
Lennart Poettering [Fri, 19 Aug 2022 09:19:59 +0000 (11:19 +0200)] 
TEST-70-TPM2: use "truncate" to generate disk image

Let'se operate on a sparse file here, to reuduce memory use.

21 months agoMerge pull request #24362 from poettering/sha256-tweaks
Lennart Poettering [Fri, 19 Aug 2022 14:33:35 +0000 (16:33 +0200)] 
Merge pull request #24362 from poettering/sha256-tweaks

some tweaks to the sha256 implementation

21 months agotpm2-util: also add helper for parsing PCR arrays 24368/head
Lennart Poettering [Fri, 19 Aug 2022 14:16:03 +0000 (16:16 +0200)] 
tpm2-util: also add helper for parsing PCR arrays

21 months agotpm2-util: split out helpers which format a PCR mask as a JSON array
Lennart Poettering [Fri, 19 Aug 2022 14:09:51 +0000 (16:09 +0200)] 
tpm2-util: split out helpers which format a PCR mask as a JSON array

This makes the code easier to read, and is something we can reuse later
on.

21 months agotree-wide: pass proper values (not bools) to sd_event_source_set_enabled()
Lennart Poettering [Fri, 19 Aug 2022 10:40:24 +0000 (12:40 +0200)] 
tree-wide: pass proper values (not bools) to sd_event_source_set_enabled()

21 months agoMerge pull request #23653 from aafeijoo-suse/ask-for-recovery-key
Lennart Poettering [Fri, 19 Aug 2022 12:55:54 +0000 (14:55 +0200)] 
Merge pull request #23653 from aafeijoo-suse/ask-for-recovery-key

cryptsetup: improve password prompt text

21 months agoAdd --efi-boot-option-description argument to bootctl to control the name of the...
Rene Hollander [Sat, 13 Aug 2022 19:38:02 +0000 (21:38 +0200)] 
Add --efi-boot-option-description argument to bootctl to control the name of the boot
entry.

By default an entry named "Linux Boot Manager" is created (which is the
previous behavior). With the flag the name of the entry can be
controlled, which is useful when installing systemd-boot to multiple ESP
partitions and having uniquely named entries.

Fixes #17044.

21 months agoTEST-70-TPM2: actually enable systemd-measure test
Lennart Poettering [Fri, 19 Aug 2022 09:23:45 +0000 (11:23 +0200)] 
TEST-70-TPM2: actually enable systemd-measure test

A bit emberassing that this never worked.

21 months agocryptsetup: make sure all token-based codepaths are effected by SYSTEMD_CRYPTSETUP_US...
Lennart Poettering [Fri, 19 Aug 2022 09:33:41 +0000 (11:33 +0200)] 
cryptsetup: make sure all token-based codepaths are effected by SYSTEMD_CRYPTSETUP_USE_TOKEN_MODULE env var

Previously the env var was only checked when conditionalizing use of our
own libcryptsetup loadable token modules.  But let's also use it for any
other kind of token module, including possible internal ones by
libcryptsetup.

21 months agocryptsetup: use right internal helper when checking whether to use tokens
Lennart Poettering [Fri, 19 Aug 2022 09:32:07 +0000 (11:32 +0200)] 
cryptsetup: use right internal helper when checking whether to use tokens

The other codepaths get this right, the TPM2 one currently does not. Fix
that.

21 months agosha256: add sha256_direct()/SHA256_DIRECT() helpers 24362/head
Lennart Poettering [Wed, 17 Aug 2022 09:32:38 +0000 (11:32 +0200)] 
sha256: add sha256_direct()/SHA256_DIRECT() helpers

21 months agorandom-seed: use SHA256_DIGEST_SIZE
Lennart Poettering [Wed, 17 Aug 2022 09:31:45 +0000 (11:31 +0200)] 
random-seed: use SHA256_DIGEST_SIZE

21 months agosha256: change digest buffer type to uint8_t[]
Lennart Poettering [Wed, 17 Aug 2022 09:24:24 +0000 (11:24 +0200)] 
sha256: change digest buffer type to uint8_t[]

This way we can specify a size with "static". All users use uint8_t
already, hence this comes at no price.

21 months agosd-netlink: group message cons methods together
Zbigniew Jędrzejewski-Szmek [Fri, 19 Aug 2022 08:39:37 +0000 (10:39 +0200)] 
sd-netlink: group message cons methods together

21 months agosd-netlink: simplify error code retention
Zbigniew Jędrzejewski-Szmek [Thu, 18 Aug 2022 13:06:00 +0000 (15:06 +0200)] 
sd-netlink: simplify error code retention

21 months agosd-netlink: delete sd_netlink_new_from_fd()
Zbigniew Jędrzejewski-Szmek [Thu, 18 Aug 2022 12:24:14 +0000 (14:24 +0200)] 
sd-netlink: delete sd_netlink_new_from_fd()

It was somewhat similar to sd_netlink_open_fd(), and unused.

21 months agosd-netlink: rename sd_netlink_message_request_dump to sd_netlink_message_set_request_dump
Zbigniew Jędrzejewski-Szmek [Thu, 18 Aug 2022 09:08:44 +0000 (11:08 +0200)] 
sd-netlink: rename sd_netlink_message_request_dump to sd_netlink_message_set_request_dump

21 months agosd-netlink: constify parameters in public api and adjust pointer formatting
Zbigniew Jędrzejewski-Szmek [Thu, 18 Aug 2022 09:04:16 +0000 (11:04 +0200)] 
sd-netlink: constify parameters in public api and adjust pointer formatting

In the internal api, 'char* const*' is used instead of 'const char* const*'
because otherwise we'd get a mismatch with the various strv apis.

21 months agosd-netlink: prefix output param names with 'ret'
Zbigniew Jędrzejewski-Szmek [Thu, 18 Aug 2022 08:50:41 +0000 (10:50 +0200)] 
sd-netlink: prefix output param names with 'ret'

In some places, the code was already using that, so only the header file needed
to be adjusted.

We use 'nl' for the sd_netlink* when it's passed in as input. I was considering
renaming to 'netlink', but that'd add a lot of verbosity and also we have
'sd_journal *j' in sd-journal, so the short name matches in style.

21 months agoDrop the limit on number of inodes for /dev
Franck Bui [Mon, 6 Dec 2021 14:00:12 +0000 (15:00 +0100)] 
Drop the limit on number of inodes for /dev

Follow-up for 4c733d3046942984c5f73b40c3af39cc218c103f.

Finding a suitable limit that would fit any use cases out there is pretty hard
and since /dev is only writeable by root anyway, let's simply drop the limit.

21 months agoupdate TODO 23653/head
Antonio Alvarez Feijoo [Fri, 19 Aug 2022 07:02:17 +0000 (09:02 +0200)] 
update TODO

21 months agocryptsetup: improve password prompt text
Antonio Alvarez Feijoo [Fri, 19 Aug 2022 07:01:56 +0000 (09:01 +0200)] 
cryptsetup: improve password prompt text

Instead of always asking for passphrase, if the device has LUKS2 header check:
- If only regular passphrases are registered, ask for passphrase.
- If only recovery keys are registered, ask for recovery key.
- If both regular passphrases and recovery keys are registered, ask for
passphrase or recovery key.

21 months agoMerge pull request #24353 from alpernebbi/hwdb-cros-ec-accel-base
Yu Watanabe [Fri, 19 Aug 2022 05:39:47 +0000 (14:39 +0900)] 
Merge pull request #24353 from alpernebbi/hwdb-cros-ec-accel-base

udev: hwdb: Add orientation quirk for base-mounted accelerometers on Chromebooks

Reviewed-by: Alexandru Stan <amstan@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
21 months agoMerge pull request #24348 from yuwata/network-ipv4acd-renew
Yu Watanabe [Fri, 19 Aug 2022 05:27:05 +0000 (14:27 +0900)] 
Merge pull request #24348 from yuwata/network-ipv4acd-renew

network: fix IPv4ACD issues on DHCP renewal or reconfiguring interface

21 months agoudev: hwdb: Add rules to match cros-ec-accel by 'location' sysfs file 24353/head
Alper Nebi Yasak [Thu, 18 Aug 2022 16:56:13 +0000 (19:56 +0300)] 
udev: hwdb: Add rules to match cros-ec-accel by 'location' sysfs file

The cros-ec-accel devices report their mounting location by the 'label'
sysfs file only since Linux v6.0. With earlier kernels, a nonstandard
'location' file reports this, but slightly differently (lid instead of
display) [1].

Add udev rules to import the correct hwdb entries based on this
'location' file for cros-ec-accel devices, so that the base-mounted
accel matrix has the correct value for older kernels as well.

[1] https://kernel.org/doc/Documentation/ABI/testing/sysfs-bus-iio-cros-ec

21 months agohwdb: Add Chromebook accel orientation quirks based on sysfs label
Alper Nebi Yasak [Thu, 18 Aug 2022 15:24:05 +0000 (18:24 +0300)] 
hwdb: Add Chromebook accel orientation quirks based on sysfs label

The base-mounted accelerometer on Chromebooks return values same as the
display when the lid angle is 180 degrees, instead of when the lid is
closed. To match userspace expectations we must further rotate the
existing accelerometer mounting matrix by 180 degrees around the X axis:

    [[-1,  0,  0],    [[ 1,  0,  0],    [[-1,  0,  0],
     [ 0, -1,  0],  X  [ 0, -1,  0],  =  [ 0,  1,  0],
     [ 0,  0, -1]]     [ 0,  0, -1]]     [ 0,  0,  1]]

A previous commit lets us distinguish between the two cros-ec-accel
devices on these boards by their 'label' sysfs file. Add hwdb entries
that make base-mounted accelerometers use this correct matrix, and
display-mounted ones use the existing one.

Note that the cros-ec-accel drivers use 'label' only since Linux v6.0.
The old match strings are not removed to support older kernels, even
though they are only correct for the display-mounted sensor.

21 months agoudev: hwdb: Match iio sensors based on their label
Alper Nebi Yasak [Thu, 18 Aug 2022 14:27:22 +0000 (17:27 +0300)] 
udev: hwdb: Match iio sensors based on their label

The IIO subsystem exposes a 'label' sysfs file to help userspace better
identify its devices [1]. Standardized labels include the sensor type
along with its location, including 'accel-base' and 'accel-display'.

Most Chrome OS boards have two accelerometers that are indistinguishable
except for this label (or a 'location' sysfs file before Linux v6.0),
and need different mounting matrix corrections based on their location.

Add a udev rule that matches hwdb entries using this label, so we can
correct both accelerometers on these devices with hwdb entries. The
existing rules and hwdb entries are not modified to keep potential
out-of-tree entries working, but new entries in this form will override
existing ones. Also add currently standardized labels to parse-hwdb.py.

[1] https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-iio

21 months agoMerge pull request #24054 from keszybz/initrd-no-reload
Frantisek Sumsal [Thu, 18 Aug 2022 13:15:14 +0000 (13:15 +0000)] 
Merge pull request #24054 from keszybz/initrd-no-reload

Don't do daemon-reload in the initrd

21 months agodocs: Add guide to debug binaries in vscode that need to run as root 24350/head
Daan De Meyer [Thu, 18 Aug 2022 12:38:19 +0000 (14:38 +0200)] 
docs: Add guide to debug binaries in vscode that need to run as root

21 months agodocs: Recommend pkexec over using an askpass program with sudo
Daan De Meyer [Thu, 18 Aug 2022 12:16:08 +0000 (14:16 +0200)] 
docs: Recommend pkexec over using an askpass program with sudo

Less configuration required than downloading and configuring an
askpass program.

21 months agobash-completion: autocomplete cgroup names in systemd-cgtop
Luca Boccassi [Tue, 16 Aug 2022 22:04:40 +0000 (23:04 +0100)] 
bash-completion: autocomplete cgroup names in systemd-cgtop

21 months agoinitrd-parse-etc: override argv[0] to avoid dracut issue 24054/head
Zbigniew Jędrzejewski-Szmek [Sat, 13 Aug 2022 13:51:14 +0000 (15:51 +0200)] 
initrd-parse-etc: override argv[0] to avoid dracut issue

Quoting https://github.com/systemd/systemd/pull/24054#issuecomment-1210501631:
> this would need a patch in dracut, specifically adding the
> systemd-sysroot-fstab-check to the list of installed stuff:
> https://github.com/dracutdevs/dracut/blob/fe8fa2b0cadbb33e27c8dd8b5851548dcd65835c/modules.d/00systemd/module-setup.sh#L47.
>
> I could do this manually in the CI (and I guess I'd have to do it anyway even
> if the patch lands in upstream, since it won't be available in C8S), but it
> should get there first before merging this PR, otherwise it's going to break
> Rawhide.

21 months agotest-network: add tests for IPv4ACD and renewing DHCP address 24348/head
Yu Watanabe [Thu, 18 Aug 2022 06:16:27 +0000 (15:16 +0900)] 
test-network: add tests for IPv4ACD and renewing DHCP address

21 months agotest-network: drop unused .network file
Yu Watanabe [Thu, 18 Aug 2022 05:49:42 +0000 (14:49 +0900)] 
test-network: drop unused .network file

21 months agonetwork: unref existing sd_ipv4acd object when not necessary
Yu Watanabe [Thu, 18 Aug 2022 06:39:22 +0000 (15:39 +0900)] 
network: unref existing sd_ipv4acd object when not necessary

On reconfiguring an interface, the new setting may not enable IPv4ACD
for an existing address anymore. Hence, we need to unref it. Otherwise,
newly requested addresses may never be ready for (re-)configuring.

21 months agonetwork: update setting for IPv4ACD or IPv6DAD in existing Address objects
Yu Watanabe [Thu, 18 Aug 2022 05:32:47 +0000 (14:32 +0900)] 
network: update setting for IPv4ACD or IPv6DAD in existing Address objects

Otherwise, if the setting is changed on reconfigure, the new setting
is not applied to the existing addresses.

21 months agonetwork: fix DHCPv4 address renewal with IPv4ACD
Yu Watanabe [Thu, 18 Aug 2022 05:15:23 +0000 (14:15 +0900)] 
network: fix DHCPv4 address renewal with IPv4ACD

Previously, when a DHCP address is renewed and if the IPv4ACD for the
address is enabled, the address will never drop the probing flag, thus
the lifetime of the address will never be updated.

This drops NETWORK_CONFIG_STATE_PROBING, and the IPv4ACD status is
managed another bit, Address.acd_bound. And, the flag is updated only
when the IPv4ACD announced the address or detects conflict.

21 months agotest: expect libdevmapper failure in TEST-50-DISSECT
Luca Boccassi [Wed, 17 Aug 2022 18:43:01 +0000 (19:43 +0100)] 
test: expect libdevmapper failure in TEST-50-DISSECT

libdevmapper/device mapper driver can return semi-random failures when
opening verity devices, and we have fallback code to deal with it.
But the test was not expecting the fallback path, so it became unreliable.

Fixes https://github.com/systemd/systemd/issues/23866

21 months agosd-messages: rename newly added constants
Zbigniew Jędrzejewski-Szmek [Wed, 17 Aug 2022 11:09:49 +0000 (13:09 +0200)] 
sd-messages: rename newly added constants

This hasn't been through a release yet, so we are free to change the name.

Closes #24270.
C.f. https://github.com/systemd/systemd/commit/907506695549c689710cd267583f6fd439711dcf#r80812414

21 months agosd-messages: make the table wider
Zbigniew Jędrzejewski-Szmek [Wed, 17 Aug 2022 11:04:49 +0000 (13:04 +0200)] 
sd-messages: make the table wider

For whatever reason, nowadays we add entries that are quite long, so
we were using line continuation for most of new entries. This is hard
to read and edit. So let's just make the table wide enough to accomodate
all the names without line splits.