Commit Graph
59292 Commits
Author SHA1 Message Date
Luca Boccassi 20e72c2bd4 Merge pull request #24379 from mrc0mmand/llvm-15
ci: build with clang-15; drop clang-12
2022-08-20 23:38:52 +01:00
Daan De Meyer 819a2502f2 mkosi: Install tests in final image 2022-08-20 23:24:19 +02:00
Frantisek Sumsal 3b2b3d2985 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.
```
2022-08-20 21:57:18 +02:00
Frantisek Sumsal 9abe4cfc39 coredump: drop an unused variable 2022-08-20 21:04:24 +02:00
Frantisek Sumsal f8769631e1 network: drop an unused variable 2022-08-20 21:00:14 +02:00
Frantisek Sumsal f7c1808e69 machine: drop an unused variable 2022-08-20 20:47:48 +02:00
Frantisek Sumsal 94510784e1 sd-journal: drop an unused variable 2022-08-20 20:46:23 +02:00
Frantisek Sumsal d7c1024b6b ci: build with clang-15; drop clang-12 2022-08-20 20:12:03 +02:00
Yu Watanabe 645deddbaf Merge pull request #24378 from yuwata/test-network-issue-24377
test-network: add test case for issue #24377
2022-08-20 22:24:53 +09:00
Yu Watanabe b249834bc3 test-network: add test for issue #24377
The issue has been already fixed by
b05e52000b (PR #24020).
2022-08-20 20:50:02 +09:00
Yu Watanabe 5bd2a7c580 test-network: add helper functions for reading logs of networkd 2022-08-20 20:35:18 +09:00
Yu Watanabe 0f27758ae9 Merge pull request #24356 from keszybz/sd-netlink-api
Small improvements to the sd-netlink api
2022-08-20 19:11:02 +09:00
Aryan singh 131298867b 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.
2022-08-20 12:02:54 +02:00
Lennart Poettering 6564591cc3 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.
2022-08-20 09:01:31 +09:00
Yu Watanabe 1af39ef2f6 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.
2022-08-20 09:01:14 +09:00
Frantisek Sumsal bea9d62bdb 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

```
2022-08-19 22:31:32 +01:00
Lennart Poettering c06b6d46fd measure: add json output 2022-08-19 23:26:09 +02:00
Lennart Poettering 82b0039eb0 Merge pull request #24368 from poettering/tpm2-json-pcr-array-rework
tpm2: add helpers for building/parsing JSON arrays of PCR indexes
2022-08-19 21:51:47 +02:00
Luca Boccassi 3093b158bc Merge pull request #24350 from DaanDeMeyer/docs-pkexec
docs: Recommend pkexec over using an askpass program with sudo
2022-08-19 20:43:50 +01:00
Lennart Poettering 222a951fa4 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.
2022-08-19 21:26:26 +02:00
Michal Sekletar 466266c172 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.
2022-08-19 20:13:47 +01:00
Lennart Poettering 98193c39c6 tpm2-util: expose more hash algorithms
swtpm supports them, hence maybe support them in our codebase, too
2022-08-19 20:12:49 +01:00
Lennart Poettering df6c3cbd02 tpm2-util: add TPM2_PCR_MASK_VALID() helper 2022-08-19 20:12:20 +01:00
Zbigniew Jędrzejewski-Szmek 93c0a5eccf sd-netlink: use SD_EVENT_ONESHOT for a time-based callback 2022-08-19 17:43:56 +02:00
Lennart Poettering d8776eed9b TEST-70-TPM2: use "truncate" to generate disk image
Let'se operate on a sparse file here, to reuduce memory use.
2022-08-19 16:34:30 +02:00
Lennart Poettering 1dad9cd766 Merge pull request #24362 from poettering/sha256-tweaks
some tweaks to the sha256 implementation
2022-08-19 16:33:35 +02:00
Lennart Poettering 8de8ec88da tpm2-util: also add helper for parsing PCR arrays 2022-08-19 16:30:37 +02:00
Lennart Poettering 4436081e9d 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.
2022-08-19 16:29:38 +02:00
Lennart Poettering 2ab1fb77e2 tree-wide: pass proper values (not bools) to sd_event_source_set_enabled() 2022-08-19 14:56:26 +02:00
Lennart Poettering 7484c60ec6 Merge pull request #23653 from aafeijoo-suse/ask-for-recovery-key
cryptsetup: improve password prompt text
2022-08-19 14:55:54 +02:00
Rene Hollander d9bdb29bf5 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.
2022-08-19 14:55:31 +02:00
Lennart Poettering be06a84c8d TEST-70-TPM2: actually enable systemd-measure test
A bit emberassing that this never worked.
2022-08-19 14:54:30 +02:00
Lennart Poettering a0789e5fb8 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.
2022-08-19 14:53:54 +02:00
Lennart Poettering d1b2e04328 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.
2022-08-19 14:53:11 +02:00
Lennart Poettering 558d96240b sha256: add sha256_direct()/SHA256_DIRECT() helpers 2022-08-19 12:53:04 +02:00
Lennart Poettering 00b4663813 random-seed: use SHA256_DIGEST_SIZE 2022-08-19 12:53:04 +02:00
Lennart Poettering 3c4d5f2ff5 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.
2022-08-19 12:53:04 +02:00
Zbigniew Jędrzejewski-Szmek f59499085f sd-netlink: group message cons methods together 2022-08-19 11:53:15 +02:00
Zbigniew Jędrzejewski-Szmek 40c864afe0 sd-netlink: simplify error code retention 2022-08-19 11:52:25 +02:00
Zbigniew Jędrzejewski-Szmek 3310e0647c sd-netlink: delete sd_netlink_new_from_fd()
It was somewhat similar to sd_netlink_open_fd(), and unused.
2022-08-19 11:52:25 +02:00
Zbigniew Jędrzejewski-Szmek 24c0f38591 sd-netlink: rename sd_netlink_message_request_dump to sd_netlink_message_set_request_dump 2022-08-19 11:52:25 +02:00
Zbigniew Jędrzejewski-Szmek f4f81a6b35 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.
2022-08-19 11:52:25 +02:00
Zbigniew Jędrzejewski-Szmek b44662fee5 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.
2022-08-19 11:52:21 +02:00
Franck Bui 570fe6f12b Drop the limit on number of inodes for /dev
Follow-up for 4c733d3046.

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.
2022-08-19 11:25:21 +02:00
Antonio Alvarez Feijoo 2b56004001 update TODO 2022-08-19 09:02:17 +02:00
Antonio Alvarez Feijoo b6c0bd11fc 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.
2022-08-19 09:01:56 +02:00
Yu Watanabe 0b755a9809 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>
2022-08-19 14:39:47 +09:00
Yu Watanabe ade100f3b6 Merge pull request #24348 from yuwata/network-ipv4acd-renew
network: fix IPv4ACD issues on DHCP renewal or reconfiguring interface
2022-08-19 14:27:05 +09:00
Alper Nebi Yasak ac3c031e38 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
2022-08-18 21:17:19 +03:00
Alper Nebi Yasak fea267f8c7 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.
2022-08-18 21:17:19 +03:00