]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoudev-manager: fix log message 30052/head
David Tardon [Tue, 14 Nov 2023 18:20:01 +0000 (19:20 +0100)] 
udev-manager: fix log message

2 years agotest: read from the right device
David Tardon [Wed, 15 Nov 2023 07:15:59 +0000 (08:15 +0100)] 
test: read from the right device

2 years agoMerge pull request #30043 from mrc0mmand/more-assert_return
Yu Watanabe [Thu, 16 Nov 2023 02:28:33 +0000 (11:28 +0900)] 
Merge pull request #30043 from mrc0mmand/more-assert_return

More `assert_return()` shenanigans

2 years agoMerge pull request #30045 from poettering/discover-image-tweaklets
Yu Watanabe [Thu, 16 Nov 2023 02:28:04 +0000 (11:28 +0900)] 
Merge pull request #30045 from poettering/discover-image-tweaklets

discover-image: tiny tweaklets

2 years agoMerge pull request #30044 from poettering/dissect-tool-tweaklets
Yu Watanabe [Thu, 16 Nov 2023 02:27:47 +0000 (11:27 +0900)] 
Merge pull request #30044 from poettering/dissect-tool-tweaklets

systemd-dissect --discover tweaklets

2 years agosd-dhcp: use CMSG_FIND_AND_COPY_DATA to avoid build failures on x32 architectures
Luca Boccassi [Wed, 15 Nov 2023 21:08:30 +0000 (21:08 +0000)] 
sd-dhcp: use CMSG_FIND_AND_COPY_DATA to avoid build failures on x32 architectures

On architectures where timeval is 64bit but size_t is 32bit
we have to use CMSG_FIND_AND_COPY_DATA. This affects x32 and riscv32.

Follow-up for 905d0ea7b0080dd

2 years agodiscover-image: use TAKE_PTR() where appropriate 30045/head
Lennart Poettering [Wed, 15 Nov 2023 17:36:59 +0000 (18:36 +0100)] 
discover-image: use TAKE_PTR() where appropriate

2 years agodiscover-image: reindent string table
Lennart Poettering [Wed, 15 Nov 2023 17:36:39 +0000 (18:36 +0100)] 
discover-image: reindent string table

2 years agodissect: set dash as ersatz string 30044/head
Lennart Poettering [Wed, 15 Nov 2023 21:36:41 +0000 (22:36 +0100)] 
dissect: set dash as ersatz string

2 years agodissect: right-align size column in --discover table
Lennart Poettering [Wed, 15 Nov 2023 21:14:36 +0000 (22:14 +0100)] 
dissect: right-align size column in --discover table

2 years agologin: mark the Display property as "emits change" 30043/head
Frantisek Sumsal [Wed, 15 Nov 2023 21:21:16 +0000 (22:21 +0100)] 
login: mark the Display property as "emits change"

With the introduction of SetDisplay() method in 4885d7490b2 the Display
property emits a "properties changed" message every time the display is
changed using this method, so mark it appropriately.

Caught by systemd/systemd#30029:

systemd-logind[1366]: Got message type=method_call sender=:1.165 destination=org.freedesktop.login1 path=/org/freedesktop/login1/session/_310 interface=org.freedesktop.login1.Session member=SetDisplay  cookie=8 reply_cookie=0 signature=s error-name=n/a error-message=n/a
systemd-logind[1366]: Assertion 'v->vtable->flags & SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE || v->vtable->flags & SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION' failed at src/libsystemd/sd-bus/bus-objects.c:2141, function emit_properties_changed_on_interface(). Ignoring.

Follow-up to 4885d7490b2.

2 years agosd-journal: don't assert on invalid field
Frantisek Sumsal [Wed, 15 Nov 2023 20:44:33 +0000 (21:44 +0100)] 
sd-journal: don't assert on invalid field

Also, field_is_valid(field) already does isempty(field), so drop that as
well.

$ SYSTEMD_LOG_LEVEL=debug journalctl -o verbose -F foo-bar-baz
...
Assertion 'field_is_valid(field)' failed at src/libsystemd/sd-journal/sd-journal.c:2789, function sd_journal_query_unique(). Ignoring.
Failed to query unique data objects: Invalid argument

2 years agoMerge pull request #30040 from yuwata/assert-return-fixes
Frantisek Sumsal [Wed, 15 Nov 2023 21:05:06 +0000 (21:05 +0000)] 
Merge pull request #30040 from yuwata/assert-return-fixes

several assert_return() fixes

2 years agorepart: Fix compilation warning when tpm2 is disabled
Krzesimir Nowak [Wed, 15 Nov 2023 16:39:10 +0000 (17:39 +0100)] 
repart: Fix compilation warning when tpm2 is disabled

The warning is about unused variable "flags":

```
../src/partition/repart.c: In function ‘partition_encrypt’:
../src/partition/repart.c:3690:19: warning: unused variable ‘flags’ [-Wunused-variable]
 3690 |         TPM2Flags flags = 0;
      |                   ^~~~~
```

Move the flags variable into the scope where it is actually used, which happens
to be inside the HAVE_TPM2 block.

2 years agosd-device: do not trigger assertion by a bad udev rules 30040/head
Yu Watanabe [Wed, 15 Nov 2023 17:27:19 +0000 (02:27 +0900)] 
sd-device: do not trigger assertion by a bad udev rules

The assertion can be triggered by bad `$attr{[<subsys>/<sysname>]<attribute>}`
formatting. That's not a programmer's error, but a runtime error.

Prompted by #30029.

2 years agodhcp: do not trigger assertion by malformed messages
Yu Watanabe [Wed, 15 Nov 2023 17:17:22 +0000 (02:17 +0900)] 
dhcp: do not trigger assertion by malformed messages

This also changes error code from -ENODATA -> -EBADMSG,
as we received bad message in that case.

Prompted by #30029.

2 years agonetwork: do not try to create netdev from tests
Yu Watanabe [Wed, 15 Nov 2023 17:12:09 +0000 (02:12 +0900)] 
network: do not try to create netdev from tests

Prompted by #30029.

2 years agoNEWS: finalize for v255-rc2 v255-rc2
Luca Boccassi [Wed, 15 Nov 2023 16:31:53 +0000 (16:31 +0000)] 
NEWS: finalize for v255-rc2

2 years agoMerge pull request #30033 from mrc0mmand/assert_return-tweaks
Luca Boccassi [Wed, 15 Nov 2023 16:24:48 +0000 (16:24 +0000)] 
Merge pull request #30033 from mrc0mmand/assert_return-tweaks

Dial back a couple of `assert_return()` uses

2 years agoMerge pull request #30035 from keszybz/buid-sys-cleanups
Luca Boccassi [Wed, 15 Nov 2023 16:05:29 +0000 (16:05 +0000)] 
Merge pull request #30035 from keszybz/buid-sys-cleanups

Build system cleanups

2 years agoman/systemd-creds: fix a typo
Mike Yuan [Wed, 15 Nov 2023 14:28:52 +0000 (22:28 +0800)] 
man/systemd-creds: fix a typo

2 years agohwdb/acpi-update.py: streamline python code 30035/head
Zbigniew Jędrzejewski-Szmek [Wed, 15 Nov 2023 14:24:34 +0000 (15:24 +0100)] 
hwdb/acpi-update.py: streamline python code

Use f-strings and simplify the code a bit.

When I call 'acpi-update.py' after those changes, the resulting .hwdb files are
the same except for two additions that appeared in the meantime. I don't think
it makes sense to update them again, because the ma-*.txt files changed and we
don't want to store big blobs unnecessarilly.

2 years agohwdb: rename .html=>.csv
Zbigniew Jędrzejewski-Szmek [Wed, 15 Nov 2023 14:21:26 +0000 (15:21 +0100)] 
hwdb: rename .html=>.csv

The old suffix is now confusing.

2 years agotest: update Ubuntu CI instructions
Frantisek Sumsal [Wed, 15 Nov 2023 13:57:48 +0000 (14:57 +0100)] 
test: update Ubuntu CI instructions

2 years agoMerge pull request #30030 from poettering/gpt-growfs-root-fix
Luca Boccassi [Wed, 15 Nov 2023 13:57:28 +0000 (13:57 +0000)] 
Merge pull request #30030 from poettering/gpt-growfs-root-fix

make gpt flag 59 (growfs) actually work on the root fs

2 years agomeson: use ternary op for brevity
Zbigniew Jędrzejewski-Szmek [Wed, 15 Nov 2023 13:47:17 +0000 (14:47 +0100)] 
meson: use ternary op for brevity

2 years agoNEWS: adjust indentation
Zbigniew Jędrzejewski-Szmek [Wed, 15 Nov 2023 13:52:36 +0000 (14:52 +0100)] 
NEWS: adjust indentation

A non-breaking space is used between "PCR" and the number. I did
search&replace on the whole file, so that when people select&paste
later, they are more likely to use the same format.

2 years agosd-bus: don't treat invalid user/machine as a programming error 30033/head
Frantisek Sumsal [Wed, 15 Nov 2023 12:56:50 +0000 (13:56 +0100)] 
sd-bus: don't treat invalid user/machine as a programming error

$ SYSTEMD_LOG_LEVEL=debug machinectl status --machine=@
Assertion 'r > 0' failed at src/libsystemd/sd-bus/sd-bus.c:1694, function sd_bus_open_system_machine(). Ignoring.

2 years agomount: don't call sd_device_get_property_value() with a NULL pointer
Frantisek Sumsal [Wed, 15 Nov 2023 12:46:09 +0000 (13:46 +0100)] 
mount: don't call sd_device_get_property_value() with a NULL pointer

Otherwise bad thing would've happened is this was a hard assert:

+ systemd-mount --umount /dev/loop0
Assertion 'device' failed at src/libsystemd/sd-device/sd-device.c:2202, function sd_device_get_property_value(). Ignoring.

2 years agosd-journal: don't treat invalid match as a programming error
Frantisek Sumsal [Wed, 15 Nov 2023 12:38:02 +0000 (13:38 +0100)] 
sd-journal: don't treat invalid match as a programming error

Don't use assert_runtime() when we get an invalid match string, since
that's a runtime error:

$ SYSTEMD_LOG_LEVEL=debug coredumpctl info =
...
Adding match: =
Assertion 'match_is_valid(data, size)' failed at src/libsystemd/sd-journal/sd-journal.c:240, function sd_journal_add_match(). Ignoring.
Failed to add match "=": Invalid argument

2 years agoboot: measure config first, only then parse
Lennart Poettering [Wed, 15 Nov 2023 11:11:08 +0000 (12:11 +0100)] 
boot: measure config first, only then parse

Fixes: #30026
2 years agogpt-auto-generator: hook in "growfs" for the root fs if the GPT flag 59 says so 30030/head
Lennart Poettering [Wed, 15 Nov 2023 10:14:39 +0000 (11:14 +0100)] 
gpt-auto-generator: hook in "growfs" for the root fs if the GPT flag 59 says so

Fixes: #29791
2 years agogpt-auto-generator: don't eat up errors of generator_enable_remount_fs_service()
Lennart Poettering [Wed, 15 Nov 2023 12:17:31 +0000 (13:17 +0100)] 
gpt-auto-generator: don't eat up errors of generator_enable_remount_fs_service()

I cannot see a reason why we should ignore this error, so let's not. We
use RET_GATHER() on the returns anyway, i.e. collect errors but
continue, so it makes sense to collect this one too.

2 years agogpt-auto-generator: add comment + assert() explaining mode of invocation
Lennart Poettering [Wed, 15 Nov 2023 10:14:11 +0000 (11:14 +0100)] 
gpt-auto-generator: add comment + assert() explaining mode of invocation

We are not invoked in the initrd, and that deserves a comment.

2 years agogpt-auto-generator: drop in_initrd() check in add_partition_root_rw()
Lennart Poettering [Wed, 15 Nov 2023 10:12:38 +0000 (11:12 +0100)] 
gpt-auto-generator: drop in_initrd() check in add_partition_root_rw()

This call is never called in the initrd, hence we can drop the extra
check, as it is redundant. Let's keep it as an assert() though, as a
form of code-enforced documentation.

2 years agofuzz: don't panic without a C++ compiler
Frantisek Sumsal [Wed, 15 Nov 2023 10:41:45 +0000 (11:41 +0100)] 
fuzz: don't panic without a C++ compiler

meson's `cpp_args` option is defined only if it detects a C++ compiler,
otherwise we get an error:

../test/fuzz/meson.build:56:28: ERROR: Tried to access unknown option 'cpp_args'.

2 years agoNEWS fixes
Lennart Poettering [Wed, 15 Nov 2023 10:52:27 +0000 (11:52 +0100)] 
NEWS fixes

2 years agoMerge pull request #30028 from yuwata/duid-fix-size
Luca Boccassi [Wed, 15 Nov 2023 09:49:46 +0000 (09:49 +0000)] 
Merge pull request #30028 from yuwata/duid-fix-size

dhcp: fix DUID size

2 years agosd-dhcp6-client: fix DUID data length passed to hexmem() 30028/head
Yu Watanabe [Wed, 15 Nov 2023 04:46:31 +0000 (13:46 +0900)] 
sd-dhcp6-client: fix DUID data length passed to hexmem()

Fixes a bug introduced by 6b7d5b6eaf9029b88771ae0ba3cf3c95adb3c24d.

2 years agodhcp: fix maximum DUID size
Yu Watanabe [Wed, 15 Nov 2023 04:26:57 +0000 (13:26 +0900)] 
dhcp: fix maximum DUID size

This effectively reverts 92914960113b9ed21570f4329e2b2b2bf3e84629.

This fixes the maximum length of DUID.
See RFC 8415 section 11.1.

2 years agodhcp: drop unused prototype
Yu Watanabe [Tue, 14 Nov 2023 08:00:34 +0000 (17:00 +0900)] 
dhcp: drop unused prototype

Follow-up for 53488ea352b658e37eef06f958c3f8ca062a64d9.

2 years agoMerge pull request #30027 from bluca/news
Yu Watanabe [Wed, 15 Nov 2023 01:17:19 +0000 (10:17 +0900)] 
Merge pull request #30027 from bluca/news

Update syscalls/hwdb/po

2 years agoUpdate po files 30027/head
Luca Boccassi [Tue, 14 Nov 2023 21:26:10 +0000 (21:26 +0000)] 
Update po files

These are all newline breaks, but some meson tool changed at some
point that causes all of these changes to happen, and they have
started to appear when Weblate sends translations update, making
them very hard to review as they are mostly adding these breaks.
Update all files once and for all so that new translations PRs are
easier to review.

2 years agoUpdate hwdb
Luca Boccassi [Tue, 14 Nov 2023 21:20:45 +0000 (21:20 +0000)] 
Update hwdb

2 years agohwdb: PNP/ACPI lists on uefi.org are now in CSV format
Luca Boccassi [Tue, 14 Nov 2023 20:46:12 +0000 (20:46 +0000)] 
hwdb: PNP/ACPI lists on uefi.org are now in CSV format

Adjust the parsing as it's no longer HTML files. Some IDs end with
whitespace, without being quoted, which seems like a mistake as they
weren't before, so strip the ID columns before applying them.

2 years agodocs/RELEASE.md: retain systemd.io in IRC topic update
Luca Boccassi [Tue, 14 Nov 2023 20:18:50 +0000 (20:18 +0000)] 
docs/RELEASE.md: retain systemd.io in IRC topic update

2 years agoUpdate syscalls list
Luca Boccassi [Tue, 14 Nov 2023 20:17:48 +0000 (20:17 +0000)] 
Update syscalls list

2 years agoNEWS: update contributors list
Luca Boccassi [Tue, 14 Nov 2023 20:11:56 +0000 (20:11 +0000)] 
NEWS: update contributors list

2 years agoNEWS: update for latest features
Luca Boccassi [Tue, 14 Nov 2023 20:11:01 +0000 (20:11 +0000)] 
NEWS: update for latest features

2 years agoMerge pull request #30023 from mrc0mmand/selinux
Luca Boccassi [Tue, 14 Nov 2023 19:04:35 +0000 (19:04 +0000)] 
Merge pull request #30023 from mrc0mmand/selinux

test: make TEST-06-SELINUX work with the refpolicy and beef it up a bit

2 years agotest: make TEST-06-SELINUX work with the refpolicy and beef it up a bit 30023/head
Frantisek Sumsal [Tue, 14 Nov 2023 11:53:51 +0000 (12:53 +0100)] 
test: make TEST-06-SELINUX work with the refpolicy and beef it up a bit

Currently the test works only with policy shipped by Fedora, which makes
it pretty much useless in most of our CIs. Let's drop the custom module
and make the test more generic, so it works with the refpolicy as well,
which should allow us to run it on Arch and probably even in Ubuntu CI.

2 years agoMerge pull request #29930 from yuwata/meson-default-network-fix-install-path
Zbigniew Jędrzejewski-Szmek [Tue, 14 Nov 2023 16:33:42 +0000 (17:33 +0100)] 
Merge pull request #29930 from yuwata/meson-default-network-fix-install-path

meson: fix install path of example .network files

2 years agoMerge pull request #29928 from yuwata/meson-default-network
Zbigniew Jędrzejewski-Szmek [Tue, 14 Nov 2023 16:33:03 +0000 (17:33 +0100)] 
Merge pull request #29928 from yuwata/meson-default-network

meson: follow-ups for -Ddefault-network=

2 years agotest: switch SELinux to permissive in the config file
Frantisek Sumsal [Tue, 14 Nov 2023 09:52:24 +0000 (10:52 +0100)] 
test: switch SELinux to permissive in the config file

The config file has (unfortunately) precedence over the kernel command
line, so let's tweak the config file if necessary.

2 years agodoc: some trivial cleanups to MEMORY_PRESSURE.md
Vito Caputo [Tue, 14 Nov 2023 08:48:00 +0000 (00:48 -0800)] 
doc: some trivial cleanups to MEMORY_PRESSURE.md

2 years agostoragetm: use path to device node instead of devpath
Yu Watanabe [Tue, 14 Nov 2023 02:58:22 +0000 (11:58 +0900)] 
storagetm: use path to device node instead of devpath

To make the generated IDs equivalent when
- sd_device object is not provided,
- sd_device object is provided, but it does not have ID_SERIAL.

Follow-up for abc19a6ffaa94893ffc40cc000e5bb4437f67656.

This also fixes missing voidification.

Fixes CID#1524253.

2 years agoselinux: fix loading policy at early boot
Luca Boccassi [Mon, 13 Nov 2023 19:26:33 +0000 (19:26 +0000)] 
selinux: fix loading policy at early boot

First, check for the cached enabled/disabled, as that's what all the
label functions used to do. Then, if initialization is not done yet,
do not cause the label functions to bail out, as it's expected to
happen at early boot.

Among other things, fixes:

systemd[1]: Failed to compute init label, ignoring.

Follow-up for: 0617da2edb91669a

2 years agoMerge pull request #30007 from YHNdnzj/memory-attr-followup
Luca Boccassi [Mon, 13 Nov 2023 21:12:06 +0000 (21:12 +0000)] 
Merge pull request #30007 from YHNdnzj/memory-attr-followup

core: generalize memory accounting attribute handling

2 years agoMerge pull request #30018 from mrc0mmand/TEST-70
Luca Boccassi [Mon, 13 Nov 2023 20:58:43 +0000 (20:58 +0000)] 
Merge pull request #30018 from mrc0mmand/TEST-70

test: skip --tpm2-device-key= tests with older OpenSSL

2 years agotree-wide: unify OpenSSL spelling in log messages 30018/head
Frantisek Sumsal [Mon, 13 Nov 2023 19:47:17 +0000 (20:47 +0100)] 
tree-wide: unify OpenSSL spelling in log messages

Seeing three different spellings of OpenSSL in one log file triggers
some inner OCD I didn't even know I have.

2 years agotest: skip --tpm2-device-key= tests with older OpenSSL
Frantisek Sumsal [Mon, 13 Nov 2023 19:35:29 +0000 (20:35 +0100)] 
test: skip --tpm2-device-key= tests with older OpenSSL

--tpm2-device-key= requires OpenSSL >= 3 with KDF-SS, so let's skip the
test if we're running with older OpenSSL.

+ systemd-cryptenroll --tpm2-device-key=/tmp/srk.pub --tpm2-pcrs=12:sha256=F5A5FD42D16A20302798EF6ED309979B43003D2320D9F0E8EA9831A92759FB4B /tmp/systemd-cryptsetup-H8y.IMAGE
Failed to find TPM2 pcrlock policy file 'pcrlock.json': No such file or directory
Allocating context for crypt device /tmp/systemd-cryptsetup-H8y.IMAGE.
Trying to open and read device /tmp/systemd-cryptsetup-H8y.IMAGE with direct-io.
Trying to open device /tmp/systemd-cryptsetup-H8y.IMAGE without direct-io.
Initialising device-mapper backend library.
Trying to load LUKS2 crypt type from device /tmp/systemd-cryptsetup-H8y.IMAGE.
Crypto backend (OpenSSL 1.1.1k  FIPS 25 Mar 2021) initialized in cryptsetup library version 2.3.7.
Detected kernel Linux 4.18.0-521.el8.ppc64le ppc64le.
...
Failed to find TPM PCR public key file 'tpm2-pcr-public-key.pem': No such file or directory
Failed to read TPM2 PCR public key, proceeding without: No such file or directory
Can't find symbol Esys_TR_GetTpmHandle: /lib64/libtss2-esys.so.0: undefined symbol: Esys_TR_GetTpmHandle
libtss2-esys too old, does not include Esys_TR_GetTpmHandle.
Can't find symbol Esys_TR_GetTpmHandle: /lib64/libtss2-esys.so.0: undefined symbol: Esys_TR_GetTpmHandle
libtss2-esys too old, does not include Esys_TR_GetTpmHandle.
PolicyPCR calculated digest: 9a1f511fb94f030eb21d0332ef2739727bf0ead4ec26a204d15b09cdeb4b2555
Calculating sealed object.
Calculating encrypted seed for sealed object.
Calculating encrypted seed for ECC sealed object.
Calculating KDFe().
KDF-SS requires openssl >= 3.
Could not calculate KDFe: Operation not supported
Could not calculate encrypted seed: Operation not supported
Failed to seal to TPM2: Operation not supported

2 years agostoragetm: expose more useful metadata for nvme block devices
Lennart Poettering [Fri, 10 Nov 2023 15:11:12 +0000 (16:11 +0100)] 
storagetm: expose more useful metadata for nvme block devices

don't let the devices to be announced just as model "Linux". Let's instead
propagate the underlying block device's model. Also do something
reasonably smart for the serial and firmware version fields.

2 years agoMerge pull request #30016 from dtardon/udevadm-control-p-test
Luca Boccassi [Mon, 13 Nov 2023 19:29:53 +0000 (19:29 +0000)] 
Merge pull request #30016 from dtardon/udevadm-control-p-test

Add test for udevadm control -p

2 years agotests: add test for udevadm control -p 30016/head
David Tardon [Thu, 9 Nov 2023 14:09:33 +0000 (15:09 +0100)] 
tests: add test for udevadm control -p

Follow-up for e1593039dbb64e47e3ec81d2c913e7730d94a727 .

2 years agoudev: allow global properties in assignments
David Tardon [Mon, 13 Nov 2023 15:23:37 +0000 (16:23 +0100)] 
udev: allow global properties in assignments

Before, handling of global properties (set on systemd-udevd by `udevadm
control -p FOO=foo`) was inconsistent. They were honored in ENV matches,
but not in any assignment. This meant that any use of $env{FOO} (where
FOO was a global property) expanded to an empty string.

2 years agoudev-rules: use udev_get_property_value()
David Tardon [Mon, 13 Nov 2023 15:20:09 +0000 (16:20 +0100)] 
udev-rules: use udev_get_property_value()

2 years agoudev-util: add wrapper for sd_device_get_property_value()
David Tardon [Mon, 13 Nov 2023 15:11:41 +0000 (16:11 +0100)] 
udev-util: add wrapper for sd_device_get_property_value()

... that allows to pass additional properties to fall back to.

2 years agoMerge pull request #30005 from poettering/storagetm-plymout
Yu Watanabe [Mon, 13 Nov 2023 17:39:17 +0000 (02:39 +0900)] 
Merge pull request #30005 from poettering/storagetm-plymout

storagetm: plymouth hookup

2 years agoMerge pull request #30015 from poettering/tpm2-slow-tests
Yu Watanabe [Mon, 13 Nov 2023 17:38:33 +0000 (02:38 +0900)] 
Merge pull request #30015 from poettering/tpm2-slow-tests

tests: skip slow tpm2 tests if slow tests aren't enabled

2 years agoMerge pull request #30010 from poettering/mount-tool-tweakles
Yu Watanabe [Mon, 13 Nov 2023 17:38:09 +0000 (02:38 +0900)] 
Merge pull request #30010 from poettering/mount-tool-tweakles

mount-tool: trivial tweaklets

2 years agoMerge pull request #30003 from poettering/vendor-model-unify
Yu Watanabe [Mon, 13 Nov 2023 17:36:08 +0000 (02:36 +0900)] 
Merge pull request #30003 from poettering/vendor-model-unify

udev-util: add generic device_get_{vendor,model}_string() helpers

2 years agoid128: add id128_digest() helper
Lennart Poettering [Mon, 13 Nov 2023 09:58:18 +0000 (10:58 +0100)] 
id128: add id128_digest() helper

This helper hashes some arbitrary data and turns it into a v4 UUID.

2 years agoukify: show .sbom sections as binary
Zbigniew Jędrzejewski-Szmek [Mon, 13 Nov 2023 14:13:30 +0000 (15:13 +0100)] 
ukify: show .sbom sections as binary

Fixup for e87dec82bec6eff015b368b3c746810d684fc6af:
I misunderstood the format. It's actually CBOR, i.e. some binary format.
When trying to show show text we would first check if it's valid UTF-8,
so we would handle this gracefully, i.e. emit a warning and not print
the contents.

2 years agocore: add unit_reset_{memory,io}_accounting_last 30007/head
Mike Yuan [Mon, 13 Nov 2023 13:27:29 +0000 (21:27 +0800)] 
core: add unit_reset_{memory,io}_accounting_last

2 years agocore: generalize memory accounting attribute handling
Mike Yuan [Mon, 13 Nov 2023 12:23:42 +0000 (20:23 +0800)] 
core: generalize memory accounting attribute handling

Follow-up for #29941

Also, support for MemoryCurrent in cgroup v1 is removed, as we're
going to remove that completely anyway.

Fixes #30000

2 years agocore/unit-serialize: use private string table
Mike Yuan [Mon, 13 Nov 2023 15:43:54 +0000 (23:43 +0800)] 
core/unit-serialize: use private string table

2 years agotest-tpm2: raise timeout, as RSA is slow 30015/head
Lennart Poettering [Mon, 13 Nov 2023 15:53:56 +0000 (16:53 +0100)] 
test-tpm2: raise timeout, as RSA is slow

2 years agotest-tpm2: skip RSA generating TPM2 tests on physical hw
Lennart Poettering [Mon, 13 Nov 2023 15:43:30 +0000 (16:43 +0100)] 
test-tpm2: skip RSA generating TPM2 tests on physical hw

The TPM2 tests that genreate an RSA primary key are fast on vtpms, but
very slow on physical TPMs, simply because TPMs aren't precisely fast
devices. It makes sense to keep the tests around however. Hence hide the
test behind the "slow test" logic by default – but only if we run on
physical hw, and keep them in place on VMs (where we'd expect a vtpm, if
any).

2 years agotests: add macro for generating function enter log message
Lennart Poettering [Mon, 13 Nov 2023 15:41:16 +0000 (16:41 +0100)] 
tests: add macro for generating function enter log message

The test-tpm2 test multiplexes a bunch of tests from a single
entrypoint test that creates the TPM2 connection. This means we only get
the nice log output which test we are looking for once for the
entrypoint.

Let's add a macro that allows it to nicely generate it for the inner
tests too and use it.

2 years agocore/unit-serialize: realign table
Mike Yuan [Mon, 13 Nov 2023 12:53:59 +0000 (20:53 +0800)] 
core/unit-serialize: realign table

2 years agocore: use FOREACH_ARRAY and RET_GATHER more
Mike Yuan [Mon, 13 Nov 2023 13:24:34 +0000 (21:24 +0800)] 
core: use FOREACH_ARRAY and RET_GATHER more

2 years agoudev-util: add generic device_get_{vendor,model}_string() helpers 30003/head
Lennart Poettering [Fri, 10 Nov 2023 15:10:22 +0000 (16:10 +0100)] 
udev-util: add generic device_get_{vendor,model}_string() helpers

We chck the same props in various places, add a single implementation of
a call to inquire this.

2 years agoci: work around mold/clang incompat
Lennart Poettering [Mon, 13 Nov 2023 15:23:51 +0000 (16:23 +0100)] 
ci: work around mold/clang incompat

See discussion:

https://github.com/systemd/systemd/pull/30003#issuecomment-1808349258

2 years agomount-tool: make internal and external column name match 30010/head
Lennart Poettering [Mon, 13 Nov 2023 15:12:03 +0000 (16:12 +0100)] 
mount-tool: make internal and external column name match

2 years agomount-tool: rely on format-table.c's ersatz logic
Lennart Poettering [Mon, 13 Nov 2023 13:39:04 +0000 (14:39 +0100)] 
mount-tool: rely on format-table.c's ersatz logic

Let the table logic handle the special casing ov unavailable data,
rather than doing that ourselves.

2 years agomount-tool: reduce scope of enum
Lennart Poettering [Mon, 13 Nov 2023 13:38:40 +0000 (14:38 +0100)] 
mount-tool: reduce scope of enum

2 years agounits: pull in plymouth when booting into storagetm mode 30005/head
Lennart Poettering [Fri, 10 Nov 2023 16:00:38 +0000 (17:00 +0100)] 
units: pull in plymouth when booting into storagetm mode

2 years agostoragetm: show connection data also via plymouth
Lennart Poettering [Fri, 10 Nov 2023 15:58:50 +0000 (16:58 +0100)] 
storagetm: show connection data also via plymouth

Pretty!

2 years agoutil-lib: share plymouth client code
Lennart Poettering [Fri, 10 Nov 2023 15:30:30 +0000 (16:30 +0100)] 
util-lib: share plymouth client code

Let's add a new "plymouth-util.c" module with helpers for talking to
plymouth. We so far had three places for this, let's unify the code
doing this a bit.

2 years agoMerge pull request #29995 from keszybz/voidify-timestamp-getters
Lennart Poettering [Mon, 13 Nov 2023 13:41:42 +0000 (14:41 +0100)] 
Merge pull request #29995 from keszybz/voidify-timestamp-getters

Rename and voidify timestamp getters

2 years agomeson: fix printing of first-boot-full-preset
Zbigniew Jędrzejewski-Szmek [Wed, 8 Nov 2023 07:31:13 +0000 (08:31 +0100)] 
meson: fix printing of first-boot-full-preset

The meson summary logic checks for ENABLE_* and HAVE_*, but we used a define
with no prefix. Let's make it ENABLE_… for consistency with other config
options. Obviously this also fixes the summary output.

2 years agoMerge pull request #29996 from keszybz/ukify-summary-and-sbom-sections
Luca Boccassi [Mon, 13 Nov 2023 13:26:38 +0000 (13:26 +0000)] 
Merge pull request #29996 from keszybz/ukify-summary-and-sbom-sections

Ukify synopsis and SBOM sections

2 years agocore: rename MemoryZswapCurrent -> MemoryZSwapCurrent
Yu Watanabe [Mon, 13 Nov 2023 11:28:22 +0000 (20:28 +0900)] 
core: rename MemoryZswapCurrent -> MemoryZSwapCurrent

Follow-up for 26caa66867ec921621df023654fc6a2186a21589.

2 years agotree-wide: use the usual spelling of "cannot" 29995/head
Zbigniew Jędrzejewski-Szmek [Wed, 8 Nov 2023 12:50:39 +0000 (13:50 +0100)] 
tree-wide: use the usual spelling of "cannot"

(There's a bunch more in src/basic/linux/, but those files are copied from the
kernel and should not be modified.)

2 years agocore/unit: use assert for checking internal call sanity
Zbigniew Jędrzejewski-Szmek [Wed, 8 Nov 2023 08:11:07 +0000 (09:11 +0100)] 
core/unit: use assert for checking internal call sanity

The only way this could be called with an invalid value would be if
somebody forgot to initialize unit type. In such cases, it's better to
fail hard immediately.

2 years agoRename {dual,triple}_timestamp_get to {dual,triple}_timestamp_now
Zbigniew Jędrzejewski-Szmek [Wed, 8 Nov 2023 07:41:16 +0000 (08:41 +0100)] 
Rename {dual,triple}_timestamp_get to {dual,triple}_timestamp_now

Those functions take a pointer to a timestamp and return a timestamp pointer,
so the reader would be justified to think that those are just getters. Rename
them to avoid confusion.

2 years agoconf-parser: remove unused condition
Mike Yuan [Mon, 13 Nov 2023 09:08:24 +0000 (17:08 +0800)] 
conf-parser: remove unused condition

Follow-up for 9ac2f3c4d2cc02eda32034980461c21232bb746c

config_parse() returns 0 only on ENOENT, which can
never happen since we pass the FILE stream.

2 years agoukify: show .sbom sections as text 29996/head
Zbigniew Jędrzejewski-Szmek [Mon, 13 Nov 2023 09:41:52 +0000 (10:41 +0100)] 
ukify: show .sbom sections as text

There are draft proposals to embed SBOM metadata in the .sbom section of PE
binaries [1], in the coSWID XML format. Some details of how this is actually
implemented might change, but it seems very likely that both section name and
it being text will stay. Let's show the section as text to make such binaries
easier to inspect. ([1] recommends using 'objcopy -j .sbom' which isn't
particularly readable.)  Once there's more standarization of the actual
format, we can add pretty-printing and/or syntax highlighting.

[1] https://uefi.org/blog/firmware-sbom-proposal
[2] https://www.ietf.org/archive/id/draft-ietf-sacm-coswid-21.html

2 years agoukify: print a more readable synopsis in --help
Zbigniew Jędrzejewski-Szmek [Mon, 13 Nov 2023 09:17:54 +0000 (10:17 +0100)] 
ukify: print a more readable synopsis in --help

The details of formatting are copied from mkosi. This results in the following:

   usage:
     ukify build [--linux=LINUX] [--initrd=INITRD] [options…]
     ukify genkey [options…]
     ukify inspect FILE… [options…]

  Build and sign Unified Kernel Images

  options:
    --version             show program's version number and exit
    ...

I put "[options…]" at the end, because that's what one would generally do
with long options like "--cmdline" and others.

2 years agoMerge pull request #29990 from Flowdalic/memory-zswap-current
Mike Yuan [Mon, 13 Nov 2023 08:40:18 +0000 (16:40 +0800)] 
Merge pull request #29990 from Flowdalic/memory-zswap-current

cgroup: add support for memory.zswap.current