]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
17 months agomkfs-util: Set sector size for btrfs as well 33544/head
Daan De Meyer [Sat, 29 Jun 2024 13:27:02 +0000 (15:27 +0200)] 
mkfs-util: Set sector size for btrfs as well

btrfs used to default the sector size to the page size and didn't
support anything else. Since 6.7, it defaults to 4K and using 4K
makes the filesystem compatible with all page sizes. So let's make
sure we use minimum 4K as well (lower causes failures on systems with
a 4K page size) but still allow larger sector sizes if specified by
the user.

17 months agorepart: Don't set filesystem sector size to 512
Daan De Meyer [Sat, 29 Jun 2024 13:36:28 +0000 (15:36 +0200)] 
repart: Don't set filesystem sector size to 512

We want to use 4K as the default sector size for filesystems so they
don't have to be regenerated to work on 512, 2048 or 4096 sector sizes.

17 months agoAdded mised EVDEV_ABS_35 & EVDEV_ABS_36 for GAOMON s620
DocNITE [Fri, 28 Jun 2024 15:47:15 +0000 (18:47 +0300)] 
Added mised EVDEV_ABS_35 & EVDEV_ABS_36 for GAOMON s620

17 months agoMerge pull request #30360 from keszybz/nscd-drop
Luca Boccassi [Sat, 29 Jun 2024 08:36:16 +0000 (10:36 +0200)] 
Merge pull request #30360 from keszybz/nscd-drop

Drop support for nscd

17 months agoMerge pull request #33536 from teknoraver/hashmap_ensure_replace
Luca Boccassi [Sat, 29 Jun 2024 08:31:11 +0000 (10:31 +0200)] 
Merge pull request #33536 from teknoraver/hashmap_ensure_replace

Hashmap ensure replace

17 months agorepart: Log more about filesystem sector size
Daan De Meyer [Fri, 28 Jun 2024 17:36:50 +0000 (19:36 +0200)] 
repart: Log more about filesystem sector size

17 months agoMerge pull request #33518 from DaanDeMeyer/aarch64
Luca Boccassi [Sat, 29 Jun 2024 00:09:21 +0000 (02:09 +0200)] 
Merge pull request #33518 from DaanDeMeyer/aarch64

Various integration test fixes

17 months agocore/unit: follow merged units before updating SourcePath= timestamp too
Mike Yuan [Fri, 28 Jun 2024 13:32:33 +0000 (15:32 +0200)] 
core/unit: follow merged units before updating SourcePath= timestamp too

Currently, we only follow merged units for unit_load_dropin() call.
But if the unit is an alias, we should always perform operations
on the "canonical" unit.

17 months agoUse hashmap_ensure_replace() 33536/head
Matteo Croce [Fri, 28 Jun 2024 15:19:26 +0000 (17:19 +0200)] 
Use hashmap_ensure_replace()

Use the new function `hashmap_ensure_replace()` where we're using
`hashmap_ensure_allocated()` and `hashmap_ensure_replace()`.

Signed-off-by: Matteo Croce <teknoraver@meta.com>
17 months agoMerge pull request #33517 from keszybz/a-few-unrelated-cleanups
Luca Boccassi [Fri, 28 Jun 2024 17:06:31 +0000 (19:06 +0200)] 
Merge pull request #33517 from keszybz/a-few-unrelated-cleanups

A few unrelated cleanups

17 months agointroduce hashmap_ensure_replace()
Matteo Croce [Fri, 28 Jun 2024 14:16:50 +0000 (16:16 +0200)] 
introduce hashmap_ensure_replace()

Similar to hashmap_ensure_put(), but replace existing items in the map,
as hashmap_replace().

17 months agomeson: use less verbose quoting 30360/head
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jun 2024 16:52:59 +0000 (18:52 +0200)] 
meson: use less verbose quoting

17 months agoDrop support for nscd
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jul 2023 21:43:27 +0000 (23:43 +0200)] 
Drop support for nscd

nscd is known to be racy [1] and it was already deprecated and later dropped in
Fedora a while back [1,2]. We don't need to support obsolete stuff in systemd,
and the cache in systemd-resolved provides a better solution anyway.

We announced the plan to drop nscd in d44934f3785ad9ca4aab757beb80a9b11ba4bc04.

[1] https://fedoraproject.org/wiki/Changes/DeprecateNSCD
[2] https://fedoraproject.org/wiki/Changes/RemoveNSCD

The option is kept as a stub without any effect to make the transition easier.

17 months agoMerge pull request #33202 from bluca/extension_dedup
Luca Boccassi [Fri, 28 Jun 2024 16:25:36 +0000 (18:25 +0200)] 
Merge pull request #33202 from bluca/extension_dedup

core: deduplicate identical dm-verity ExtensionImages=

17 months agoTEST-54-CREDS: Use UEFI firmware if available 33518/head
Daan De Meyer [Fri, 28 Jun 2024 14:22:15 +0000 (16:22 +0200)] 
TEST-54-CREDS: Use UEFI firmware if available

On aarch64, SMBIOS is only available when using UEFI, so let's make
sure that the creds test uses UEFI when available so that it can
read creds from SMBIOS when running in a virtual machine.

17 months agoTEST-18-FAILUREACTION: Set auto firmware
Daan De Meyer [Fri, 28 Jun 2024 14:21:51 +0000 (16:21 +0200)] 
TEST-18-FAILUREACTION: Set auto firmware

This test runs in nspawn by default but will still run in qemu when
tests are run unprivileged so make sure we use UEFI if available to
avoid hangs when using the linux firmware.

17 months agoTEST-09-REBOOT: Set auto firmware
Daan De Meyer [Fri, 28 Jun 2024 14:19:38 +0000 (16:19 +0200)] 
TEST-09-REBOOT: Set auto firmware

This test runs in nspawn by default but will still run in qemu when
tests are run unprivileged so make sure we use UEFI if available to
avoid hangs when using the linux firmware.

17 months agoTEST-06-SELINUX: Explicitly pull in autorelabel.service
Daan De Meyer [Fri, 28 Jun 2024 13:50:35 +0000 (15:50 +0200)] 
TEST-06-SELINUX: Explicitly pull in autorelabel.service

17 months agoTEST-70-TPM2: Use UEFI firmware if available
Daan De Meyer [Fri, 28 Jun 2024 13:28:16 +0000 (15:28 +0200)] 
TEST-70-TPM2: Use UEFI firmware if available

On x86 this doesn't matter but on aarch64 we need to make sure UEFI
is used so that /sys/kernel/security/tpm0/binary_bios_measurements
is there which is required for TEST-70-TPM2.

17 months agoTODO: add note about DDI deduplication 33202/head
Luca Boccassi [Tue, 25 Jun 2024 12:08:30 +0000 (13:08 +0100)] 
TODO: add note about DDI deduplication

17 months agocore: deduplicate identical dm-verity ExtensionImages=
Luca Boccassi [Tue, 4 Jun 2024 15:00:03 +0000 (16:00 +0100)] 
core: deduplicate identical dm-verity ExtensionImages=

It turns out OverlayFS doesn't handle gracefully when the same source is
specified multiple times in lowerdir= and it fails with ELOOP:

Failed to mount overlay (type overlay) on /run/systemd/mount-rootfs/opt (MS_RDONLY "lowerdir=/run/systemd/unit-extensions/1/opt:/run/systemd/unit-extensions/0/opt:/run/systemd/mount-rootfs/opt"): Too many levels of symbolic links

This happens even if we mount each image in a different internal mount
path, as OverlayFS will resolve it and look for the backing device, which
will be the same device mapper entity, and return a hard error.
This error does not appear if dm-verity is not used, so it is very
confusing for users, and unnecessary.

When mounting ExtensionImages, check if an image is dm-veritied,
and drop duplicates if the root hashes match, to avoid this user-unfriendly
hard error.

17 months agoman/varlinkctl: add `list-methods` command to synopsis and fix typo
Antonio Alvarez Feijoo [Fri, 28 Jun 2024 12:22:55 +0000 (14:22 +0200)] 
man/varlinkctl: add `list-methods` command to synopsis and fix typo

Follow-up for 16cfe84c2495c1d9e753e2b8e21b69bea21ebaf4

17 months agoTEST-45-TIMEDATE: Use syslog identifier journalctl match
Daan De Meyer [Fri, 28 Jun 2024 12:51:10 +0000 (14:51 +0200)] 
TEST-45-TIMEDATE: Use syslog identifier journalctl match

Using a unit match is racy whereas a syslog identifier match is
reliable.

17 months agoMerge pull request #33370 from grawity/run-title
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jun 2024 12:46:27 +0000 (14:46 +0200)] 
Merge pull request #33370 from grawity/run-title

run: add option to prevent the setting of terminal title

17 months agoMerge pull request #33516 from poettering/more-stub-tweaks
Luca Boccassi [Fri, 28 Jun 2024 12:46:16 +0000 (14:46 +0200)] 
Merge pull request #33516 from poettering/more-stub-tweaks

sd-stub: three more tweaks

17 months agoTEST-64-UDEV-STORAGE: Make nvme_subsystem expected pci symlinks more generic
Daan De Meyer [Fri, 28 Jun 2024 12:20:34 +0000 (14:20 +0200)] 
TEST-64-UDEV-STORAGE: Make nvme_subsystem expected pci symlinks more generic

When running the test on aarch64 the symlinks look as follows:

"""
[root@H ~]# ls /dev/disk/by-path
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0       platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part1  platform-4010000000.pcie-pci-0000:00:05.0-nvme-16
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part  platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part2  platform-4010000000.pcie-pci-0000:00:05.0-nvme-17
"""

So let's make the PCI patterns a little more generic so they match
both the x86 and the aarch64 paths.

17 months agoLICENSES/README: expand text to summarize state for binaries and libs
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jun 2024 11:22:40 +0000 (13:22 +0200)] 
LICENSES/README: expand text to summarize state for binaries and libs

We would say how *sources* are licensed, but actually most user care about the
resulting binaries. So say how the *binaries* are licensed. I used the word
"effectively" because the permissive licenses don't set any requirements on the
binaries, so the license of sources is a complex mix, but the resulting
binaries have a simple effective license.

Also, make it clear that the GPLv2 license applies to udev programs, but not
the shared library. Based on private correspondence, there's some confusion
about this.

17 months agomkosi: Install pciutils
Daan De Meyer [Fri, 28 Jun 2024 11:41:12 +0000 (13:41 +0200)] 
mkosi: Install pciutils

17 months agotest: pull in multi-user.target explicitly
Daan De Meyer [Fri, 28 Jun 2024 11:34:37 +0000 (13:34 +0200)] 
test: pull in multi-user.target explicitly

Let's make sure we pull in multi-user.target so that we get a console
when a test fails and we're running meson test with --interactive.

17 months agoTEST-64-UDEV-STORAGE: Fix python 3.9 compatibility
Daan De Meyer [Fri, 28 Jun 2024 10:51:46 +0000 (12:51 +0200)] 
TEST-64-UDEV-STORAGE: Fix python 3.9 compatibility

Using double quotes in f-strings only works from python 3.12 onwards.
Use single quotes to make sure python 3.9 works as well.

Also clean up quotes a little in general.

17 months agoTEST-64-UDEV-STORAGE: Use bus pci slot 1 instead of 0
Daan De Meyer [Fri, 28 Jun 2024 10:50:49 +0000 (12:50 +0200)] 
TEST-64-UDEV-STORAGE: Use bus pci slot 1 instead of 0

Trying to use bus pci slot 0 fails on aarch64 so let's use 1 instead.

The error:

"""
qemu-system-aarch64: -device virtio-blk-pci,drive=drive0,scsi=off,bus=pci_bridge25: Unsupported PCI slot 0 for standard hotplug controller. Valid slots are between 1 and 31.
"""

17 months agosd-bus: drop bytefield annontations 33517/head
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jun 2024 09:45:41 +0000 (11:45 +0200)] 
sd-bus: drop bytefield annontations

It's the same old story: 'struct sd_bus' is generally instantiated once, so
bitfields, for which we pay with more complicated code in all users of this
struct, are counterproductive. In some progs the structure may be instantiated
a few times, but it's still not worth it because we save a few bytes of memory
in one place and pay for this with many more bytes in the code.

$ size build/libsystemd.so.0.39.0{.orig,}
   text    data     bss     dec     hex filename
2452757   65376    3768 2521901  267b2d build/libsystemd.so.0.39.0.orig
2451669   65376    3768 2520813  2676ed build/libsystemd.so.0.39.0

$ diff -u <(pahole build/libsystemd.so.0.39.0.orig) <(pahole build/libsystemd.so.0.39.0)
...
-       /* size: 1960, cachelines: 31, members: 105 */
-       /* sum members: 1944, holes: 3, sum holes: 9 */
-       /* sum bitfield members: 25 bits, bit holes: 2, sum bit holes: 31 bits */
+       /* size: 1984, cachelines: 31, members: 105 */
+       /* sum members: 1971, holes: 4, sum holes: 13 */
        /* member types with holes: 1, total: 1 */

i.e. 2452757 - 2451669 = 1088 extra bytes of code and slower execution, to save
24 bytes of memory per instance of the struct. (But the number of cachelines
doesn't change, so the smaller struct most likely has no effect on memory
access, and the alignment of the struct most likely means that the memory
saving is illusory too, we just end up with a few bytes of padding after the
struct.)

In the other structs, the alignment prevent the bitfield for having any effect
on memory use, but the compiler would still generate more complicated code,
i.e. we pay something for nothing.

For example:

$ diff -u <(pahole build/libsystemd.so.0.39.0.orig) <(pahole build/libsystemd.so.0.39.0)
...
 struct node_callback {
        struct node *              node;                 /*     0     8 */
-       _Bool                      is_fallback:1;        /*     8: 0  1 */
+       _Bool                      is_fallback;          /*     8     1 */

-       /* XXX 7 bits hole, try to pack */
        /* XXX 3 bytes hole, try to pack */

        unsigned int               last_iteration;       /*    12     4 */
@@ -455,15 +448,13 @@
        struct node_callback *     callbacks_prev;       /*    32     8 */

        /* size: 40, cachelines: 1, members: 6 */
-       /* sum members: 36, holes: 1, sum holes: 3 */
-       /* sum bitfield members: 1 bits, bit holes: 1, sum bit holes: 7 bits */
+       /* sum members: 37, holes: 1, sum holes: 3 */
        /* last cacheline: 40 bytes */
 };

I kept the bitfield in sd_bus_slot because it prevents the struct from growing
from 112 to 120 bytes by reducing the alignment requirement for subsequent
fields, and we potentially can have this instantiated many times.

17 months agosd-bus: simplify handling of 'types' in convenience methods
Zbigniew Jędrzejewski-Szmek [Wed, 26 Jun 2024 11:07:03 +0000 (13:07 +0200)] 
sd-bus: simplify handling of 'types' in convenience methods

The arg types==NULL has different meanings for different functions. Some
functions like sd_bus_message_appendv() require a non-null param and treat "" as
"no data". Other functions like sd_bus_skip() treat null as "process one item",
while the convenience functions treat NULL the same as "". So I think it's
reasonable to make the convenience functions handle NULL explicitly, separately
from "". That way the logical separation of concerns is clearer, and e.g.
sd_bus_message_appendv() handles all non-null strings, while e.g.
sd_bus_call_methodv() doesn't look into the string at all.

Behaviour is unchanged.

17 months agomkosi: move variable to the right scope
Zbigniew Jędrzejewski-Szmek [Thu, 6 Jun 2024 11:23:17 +0000 (13:23 +0200)] 
mkosi: move variable to the right scope

17 months agoTEST-58-REPART: reverse order of diff args
Zbigniew Jędrzejewski-Szmek [Thu, 30 May 2024 09:33:20 +0000 (11:33 +0200)] 
TEST-58-REPART: reverse order of diff args

I expect the test output to be the second argument, so we're diffing "expected"
and "output", not the other way around.

I noticed this when working on https://github.com/systemd/systemd/pull/33081.

17 months agomeson: Drop genkey target
Daan De Meyer [Fri, 28 Jun 2024 07:58:56 +0000 (09:58 +0200)] 
meson: Drop genkey target

In mkosi.images/system/mkosi.conf, we configure the certificate as
an extra tree so it's available inside the image. However, we pick up
the certificate from the top level repository directory and not from the
build directory where it is generated by the genkey meson target.

We currently have no way to access the build directory that mkosi was
invoked from when parsing the configuration file. Thus we have no way to
specify the correct location to the certificate when it's located in the
build directory.

For now, let's look for the key and certificate in the top level repository
root directory and drop the genkey target.

We don't have to change the Github Actions CI because it already runs genkey
manually before the image build (which is something we forgot to remove when
introducing the genkey target and is the reason this didn't cause issues before).

17 months agoupdate TODO
Lennart Poettering [Fri, 28 Jun 2024 08:15:53 +0000 (10:15 +0200)] 
update TODO

17 months agoupdate TODO
Lennart Poettering [Fri, 28 Jun 2024 08:12:55 +0000 (10:12 +0200)] 
update TODO

17 months agostub: move safety check for LoadOptions into if block where we actually use it 33516/head
Lennart Poettering [Thu, 27 Jun 2024 20:12:35 +0000 (22:12 +0200)] 
stub: move safety check for LoadOptions into if block where we actually use it

17 months agostub: don't mangle command line if we got it as array
Lennart Poettering [Thu, 27 Jun 2024 20:12:49 +0000 (22:12 +0200)] 
stub: don't mangle command line if we got it as array

There are two ways to get the command line: from the EFI shell,
preparsed, already split at whitespace. This we just combine with
spaces, since kernel wants it as one string.

And as one command line blob which is how we are invoked otherwise and
which comes with all kinds of whitespace quite likely.

Let's only strip leading and trailing whitespace in the latter case,
given it's likely the concatenation of whitespace separated strings
generated by shell scripts and such. But let's not strip it we already
received a preparsed array.

17 months agostub: make sure we always mangle the cmdlines we read
Lennart Poettering [Thu, 27 Jun 2024 16:41:15 +0000 (18:41 +0200)] 
stub: make sure we always mangle the cmdlines we read

17 months agodocs: fix dead link to GNOME documentation
Luca Boccassi [Thu, 27 Jun 2024 16:59:01 +0000 (17:59 +0100)] 
docs: fix dead link to GNOME documentation

17 months agoman/tmpfiles: remove outdated behavior regarding symlink ownership
Giovanni Baratta [Thu, 27 Jun 2024 11:35:12 +0000 (13:35 +0200)] 
man/tmpfiles: remove outdated behavior regarding symlink ownership

Update the man page of tmpfiles.d to remove outdated comments regarding the behavior of ownership with symlinks.
The behavior has been changed in this commit 51207ca134716a0dee5fd763a6c39204be849eb1

17 months agovarlink: fix license
David Tardon [Thu, 27 Jun 2024 13:44:20 +0000 (15:44 +0200)] 
varlink: fix license

The old license was a copy&paste mistake.

17 months agoMerge pull request #33506 from DaanDeMeyer/mkosi-btrfs
Daan De Meyer [Thu, 27 Jun 2024 14:56:27 +0000 (16:56 +0200)] 
Merge pull request #33506 from DaanDeMeyer/mkosi-btrfs

mkosi: Switch back to btrfs

17 months agomkosi: Switch back to btrfs 33506/head
Daan De Meyer [Thu, 27 Jun 2024 10:08:51 +0000 (12:08 +0200)] 
mkosi: Switch back to btrfs

Now that we're running on Noble instead of Jammy btrfs has the temp_fsid
feature which means we can mount the same image multiple times so let's
switch back to btrfs instead of ext4 as the filesystem as btrfs properly
records timestamps when building filesystems from a root directory unlike
ext4.

17 months agomkosi: Install btrfs-progs on CentOS as well
Daan De Meyer [Thu, 27 Jun 2024 13:45:44 +0000 (15:45 +0200)] 
mkosi: Install btrfs-progs on CentOS as well

17 months agocryptsetup: allow customizing cache behavior
Kamil Szczęk [Sat, 11 May 2024 08:42:14 +0000 (10:42 +0200)] 
cryptsetup: allow customizing cache behavior

The new "password-cache" option allows customizing behavior of the
ask-password module in regards to caching credentials in the kernel
keyring. There are 3 possible values for this option:
  * read-only - look for credentials in kernel keyring before asking
  * on - same as read-only, but also save credentials input by user
  * off - disable keyring credential cache

Currently the cache is forced upon the user and this can cause issues.
For example, if user wants to attach two volumes with two different
FIDO2 tokens in a quick succession, the attachment operation for the
second volume will use the PIN cached from the first FIDO2 token, which
of course will fail and since tokens are only attempted once, this will
cause fallback to a password prompt.

17 months agocryptsetup: make key discovery more robust
Kamil Szczęk [Wed, 5 Jun 2024 18:50:21 +0000 (20:50 +0200)] 
cryptsetup: make key discovery more robust

Currently, if user doesn't specify a key file, /etc/cryptsetup-keys.d/
and /run/cryptsetup-keys.d/ will be searched for a key file with name
matching the volume name. But current implementation has an important
flaw. When the auto-discovered key is a socket file - it will read the
key only once, while the socket might provide different keys for
different types of tokens. The issue is fixed by trying to discover the
key on each unlock attempt, this way we can populate the socket bind
name with something the key provider might use to differentiate between
different keys it has to provide.

17 months agomkosi: Enable hyperscale-packages-experimental for CentOS
Daan De Meyer [Thu, 27 Jun 2024 10:49:59 +0000 (12:49 +0200)] 
mkosi: Enable hyperscale-packages-experimental for CentOS

This gets us a kernel with btrfs support.

17 months agoMerge pull request #33503 from poettering/hostnamed-polkit-fixes
Lennart Poettering [Thu, 27 Jun 2024 10:47:46 +0000 (12:47 +0200)] 
Merge pull request #33503 from poettering/hostnamed-polkit-fixes

hostnamed: minor corrects to Varlink polkit handling

17 months agoMerge pull request #32560 from poettering/varlink-double-fd
Lennart Poettering [Thu, 27 Jun 2024 10:47:31 +0000 (12:47 +0200)] 
Merge pull request #32560 from poettering/varlink-double-fd

varlink: add ability to talk to remote Varlink service binary via ssh

17 months agoupdate TODO
Lennart Poettering [Thu, 27 Jun 2024 10:25:25 +0000 (12:25 +0200)] 
update TODO

17 months agoupdate TODO
Lennart Poettering [Fri, 21 Jun 2024 10:58:12 +0000 (12:58 +0200)] 
update TODO

17 months agoMerge pull request #33502 from DaanDeMeyer/opensuse
Luca Boccassi [Thu, 27 Jun 2024 09:49:19 +0000 (11:49 +0200)] 
Merge pull request #33502 from DaanDeMeyer/opensuse

mkosi: Drop s390x console patch from opensuse spec

17 months agoci: add simple test for the new "ssh-exec:" varlink logic 32560/head
Lennart Poettering [Thu, 27 Jun 2024 09:30:07 +0000 (11:30 +0200)] 
ci: add simple test for the new "ssh-exec:" varlink logic

17 months agovarlink: add ability to invoke and talk to remote service binary via SSH
Lennart Poettering [Thu, 25 Apr 2024 08:54:24 +0000 (10:54 +0200)] 
varlink: add ability to invoke and talk to remote service binary via SSH

17 months agovarlink: if $SYSTEMD_VARLINK_LISTEN is set to "-", listen on stdio
Lennart Poettering [Thu, 25 Apr 2024 08:57:56 +0000 (10:57 +0200)] 
varlink: if $SYSTEMD_VARLINK_LISTEN is set to "-", listen on stdio

17 months agohostnamed: make sure we can actually properly parse 'allowInteractiveAuthentication... 33503/head
Lennart Poettering [Thu, 27 Jun 2024 08:12:04 +0000 (10:12 +0200)] 
hostnamed: make sure we can actually properly parse 'allowInteractiveAuthentication' varlink parameter

If people want they should be able to turn on this flag, to allow
interactive auth. Let's make sure this actually works. i.e. add it to
the introspection data and don't refuse the parameter in Describe().
(note the varlink handling already does parameter validation through
varlink_dispatch(), hence we can just drop any further validation)

17 months agohostnamed: if polkit authentication fails for Varlink Describe() call, don't reply...
Lennart Poettering [Thu, 27 Jun 2024 08:09:45 +0000 (10:09 +0200)] 
hostnamed: if polkit authentication fails for Varlink Describe() call, don't reply to client with an error

The logic of the Describe() call was supposed to be: if we can acquire
the PK priv to get the product UUID then let's return the product UUID,
and if we cannot then return the data without it.

This didn't work however, since the polkit varlink glue would
immediately propagate the error it acquired from polkit its own client.
Let's turn this off, optionally, so that hostnamed can handle this
nicely.

17 months agomkosi: Drop leftover systemd-coredump-debuginfo package for opensuse 33502/head
Daan De Meyer [Thu, 27 Jun 2024 08:14:32 +0000 (10:14 +0200)] 
mkosi: Drop leftover systemd-coredump-debuginfo package for opensuse

The package was merged into the main systemd package in
https://src.opensuse.org/rpm/systemd/commit/23bfa9d83b6e24a5395a704b816a351f3dc5b5316e580cacedd1b5d9e068c117.

17 months agomkosi: Drop s390x console patch from opensuse spec
Daan De Meyer [Thu, 27 Jun 2024 07:49:40 +0000 (09:49 +0200)] 
mkosi: Drop s390x console patch from opensuse spec

This patch does not apply anymore on upstream, so let's remove it
from the spec before building until the spec is fixed.

17 months agovarlink: add helper that adds a connection via stdio to a varlink server
Lennart Poettering [Thu, 25 Apr 2024 08:56:00 +0000 (10:56 +0200)] 
varlink: add helper that adds a connection via stdio to a varlink server

This adds varlink_server_add_connection_stdio() as wrapper around
varlink_server_add_connection_pair(), that steals stdin/stdout fds and
turns them into a varlink connection. To be safe it replaces
stdin/stdout with /dev/null fds.

17 months agovarlink: add new call varlink_server_add_connection_pair() for two-fd servers
Lennart Poettering [Thu, 25 Apr 2024 08:55:23 +0000 (10:55 +0200)] 
varlink: add new call varlink_server_add_connection_pair() for two-fd servers

This adds the server-side for varlink connections over two distinct fds.

17 months agovarlink: add new call varlink_connect_fd_pair() helper for two-fd clients
Lennart Poettering [Wed, 24 Apr 2024 19:41:10 +0000 (21:41 +0200)] 
varlink: add new call varlink_connect_fd_pair() helper for two-fd clients

This makes use of the functionality added in the previous commit to
implement the client-side functionality for talking to servers via a
pair of fds.

17 months agovarlink: support varlink communication via distinct input/output fds
Lennart Poettering [Wed, 24 Apr 2024 16:54:07 +0000 (18:54 +0200)] 
varlink: support varlink communication via distinct input/output fds

When invoking another process via a pair of pipes it makes sense to
allow reading from one fd, and writing from another. Teach our varlink
code to do so optionally.

(sd-bus supports something similar, fill the gap).

This is preparation for a later commit that uses this to talk to remote
SSH invocations via pipes.

17 months agoMerge pull request #33493 from poettering/stub-refactor
Lennart Poettering [Thu, 27 Jun 2024 07:18:39 +0000 (09:18 +0200)] 
Merge pull request #33493 from poettering/stub-refactor

sd-stub: clean-up codebase/refactoring

17 months agoMerge pull request #33491 from keszybz/allow-interactive-auth-in-inhibit
Luca Boccassi [Wed, 26 Jun 2024 21:01:22 +0000 (23:01 +0200)] 
Merge pull request #33491 from keszybz/allow-interactive-auth-in-inhibit

Allow interactive auth in inhibit

17 months agoMerge pull request #33338 from ml-/specifiers
Luca Boccassi [Wed, 26 Jun 2024 19:40:15 +0000 (21:40 +0200)] 
Merge pull request #33338 from ml-/specifiers

tmpfiles: add %q, %A, %M specifiers

17 months agocore/exec-invoke: use sched_setattr instead of sched_setscheduler
Florian Schmaus [Wed, 26 Jun 2024 12:37:52 +0000 (14:37 +0200)] 
core/exec-invoke: use sched_setattr instead of sched_setscheduler

The kernel's sched_setattr interface allows for more control over a processes
scheduling attributes as the previously used sched_setscheduler interface.

Using sched_setattr is also the prerequisite for support of utilization
clamping (UCLAMP [1], see #26705) and allows to set sched_runtime. The latter,
sched_runtime, will probably become a relevant scheduling parameter of the
EEVDF scheduler [2, 3], and therefore will not only apply to processes
scheduled via SCHED_DEADLINE, but also for processes scheduled via
SCHED_OTHER/SCHED_BATCH (i.e., most processes).

1: https://docs.kernel.org/next/scheduler/sched-util-clamp.html
2: https://lwn.net/Articles/969062/
3: https://lwn.net/ml/linux-kernel/20240405110010.934104715@infradead.org/

17 months agocryptsetup: improve TPM2 blob display
Kamil Szczęk [Tue, 25 Jun 2024 15:44:53 +0000 (17:44 +0200)] 
cryptsetup: improve TPM2 blob display

Just a tiny change to fix an eyesore in cryptsetup luksDump display :)

17 months agoMerge pull request #33495 from bluca/mkosi_update
Luca Boccassi [Wed, 26 Jun 2024 16:21:20 +0000 (18:21 +0200)] 
Merge pull request #33495 from bluca/mkosi_update

mkosi: update to latest, fix opensuse, use standalone shutdown package in Debian

17 months agoefi: share setting of generic efivars between sd-stub/sd-boot 33493/head
Lennart Poettering [Wed, 26 Jun 2024 13:18:57 +0000 (15:18 +0200)] 
efi: share setting of generic efivars between sd-stub/sd-boot

We have very similar code for setting generic efi vars in sd-stub and
sd-boot. Let's share it.

This changes behaviour in a minor way: if you chainload multiple
versions of an sd-boot you'll see the efi vars of the first one now in
the OS, not of the last one.

But this should not matter, invocation like that should generally not
happen.

17 months agomeasure: normalize error paths
Lennart Poettering [Wed, 26 Jun 2024 13:05:33 +0000 (15:05 +0200)] 
measure: normalize error paths

Always put the success path at least indentation, and indent the error
paths.

17 months agostub: rework linux handover to take "struct iovec"
Lennart Poettering [Wed, 26 Jun 2024 11:16:18 +0000 (13:16 +0200)] 
stub: rework linux handover to take "struct iovec"

17 months agostub: turn lookup_name() into shorter and more generic function that turns sectin...
Lennart Poettering [Wed, 26 Jun 2024 10:35:46 +0000 (12:35 +0200)] 
stub: turn lookup_name() into shorter and more generic function that turns sectin into char* string

17 months agostub: add helper that turns PE section into char16_t* string
Lennart Poettering [Wed, 26 Jun 2024 10:35:12 +0000 (12:35 +0200)] 
stub: add helper that turns PE section into char16_t* string

17 months agostub: reorder variables
Lennart Poettering [Wed, 26 Jun 2024 10:23:57 +0000 (12:23 +0200)] 
stub: reorder variables

17 months agostub: reorder things a bit, so that initrds are generated/looked up together
Lennart Poettering [Wed, 26 Jun 2024 10:22:33 +0000 (12:22 +0200)] 
stub: reorder things a bit, so that initrds are generated/looked up together

17 months agostub: uniformly process "measured" flags
Lennart Poettering [Wed, 26 Jun 2024 10:13:45 +0000 (12:13 +0200)] 
stub: uniformly process "measured" flags

Always pass the pointer through so that the functions combine the flags
directly, instead of doing that in the caller.

17 months agostub: split out function that determines main cmdline
Lennart Poettering [Wed, 26 Jun 2024 10:11:46 +0000 (12:11 +0200)] 
stub: split out function that determines main cmdline

17 months agostub: normalize error handling when looking for PE sections
Lennart Poettering [Wed, 26 Jun 2024 10:05:04 +0000 (12:05 +0200)] 
stub: normalize error handling when looking for PE sections

17 months agostub: slightly reorder things
Lennart Poettering [Wed, 26 Jun 2024 10:02:06 +0000 (12:02 +0200)] 
stub: slightly reorder things

Let's do the section measurement first, before we use any data of it.

Let's bring up the boot splash next, so that it covers anything else we
might do.

17 months agostub: split out code that displays boot splash
Lennart Poettering [Wed, 26 Jun 2024 10:00:46 +0000 (12:00 +0200)] 
stub: split out code that displays boot splash

17 months agostub: split out code that loads all addons from disk into function of its own
Lennart Poettering [Wed, 26 Jun 2024 09:58:17 +0000 (11:58 +0200)] 
stub: split out code that loads all addons from disk into function of its own

17 months agostub: merge separate lists for addon cmdlines/devicetrees into one
Lennart Poettering [Wed, 26 Jun 2024 09:36:03 +0000 (11:36 +0200)] 
stub: merge separate lists for addon cmdlines/devicetrees into one

Instead of keeping the lists for the global and per-UKI addons separate
throughout, just merge them. We apply them in the same order after all.

17 months agostub: don't make up errors
Lennart Poettering [Wed, 26 Jun 2024 09:21:26 +0000 (11:21 +0200)] 
stub: don't make up errors

17 months agostub: add DevicetreeAddon structure
Lennart Poettering [Wed, 26 Jun 2024 09:18:51 +0000 (11:18 +0200)] 
stub: add DevicetreeAddon structure

Instead of keeping three parallel arrays of dt base, dt size and dt
filename, just introduce a proper structure and use an array of that,
greatly simplifying DT handling.

17 months agostub: split out call that loads embedded device tree
Lennart Poettering [Wed, 26 Jun 2024 08:48:49 +0000 (10:48 +0200)] 
stub: split out call that loads embedded device tree

17 months agostub: split out code that sets EFI vars indicating measured PCRs
Lennart Poettering [Wed, 26 Jun 2024 08:39:22 +0000 (10:39 +0200)] 
stub: split out code that sets EFI vars indicating measured PCRs

17 months agostub: move initialization of kernel iovec to the end, where it's used
Lennart Poettering [Wed, 26 Jun 2024 08:37:29 +0000 (10:37 +0200)] 
stub: move initialization of kernel iovec to the end, where it's used

17 months agostub: split out code that finds embedded initrds
Lennart Poettering [Wed, 26 Jun 2024 08:34:09 +0000 (10:34 +0200)] 
stub: split out code that finds embedded initrds

17 months agostub: split out code that generates embedded initrds
Lennart Poettering [Wed, 26 Jun 2024 08:31:23 +0000 (10:31 +0200)] 
stub: split out code that generates embedded initrds

17 months agostub: split out calls that generate sidecar initrds
Lennart Poettering [Wed, 26 Jun 2024 08:25:25 +0000 (10:25 +0200)] 
stub: split out calls that generate sidecar initrds

17 months agostub: rework initrd handling around "struct iovec"
Lennart Poettering [Wed, 26 Jun 2024 08:20:26 +0000 (10:20 +0200)] 
stub: rework initrd handling around "struct iovec"

Let's maintain an array of "struct iovec" for the initrds. It becomes a
ton easier and shorter to process/combine the various initrds then.

17 months agostub: split out code that finds the uname among PE sections
Lennart Poettering [Wed, 26 Jun 2024 07:27:28 +0000 (09:27 +0200)] 
stub: split out code that finds the uname among PE sections

17 months agostub: split out code that appends smbios command line
Lennart Poettering [Wed, 26 Jun 2024 07:20:54 +0000 (09:20 +0200)] 
stub: split out code that appends smbios command line

17 months agostub: split out code that measures our own PE sections
Lennart Poettering [Tue, 25 Jun 2024 20:49:24 +0000 (22:49 +0200)] 
stub: split out code that measures our own PE sections

17 months agostub: split out random seed part out of run()
Lennart Poettering [Tue, 25 Jun 2024 20:45:57 +0000 (22:45 +0200)] 
stub: split out random seed part out of run()

17 months agoefi: introduce PeSectionVector structure, and use it for referencing PE sections
Lennart Poettering [Mon, 24 Jun 2024 15:52:10 +0000 (17:52 +0200)] 
efi: introduce PeSectionVector structure, and use it for referencing PE sections