]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agorepart: Write temporary LUKS header to /var/tmp instead of /tmp 25410/head
Daan De Meyer [Thu, 17 Nov 2022 13:15:28 +0000 (14:15 +0100)] 
repart: Write temporary LUKS header to /var/tmp instead of /tmp

This is a relatively large file so let's not create it in memory.

2 years agoFollowups for aa6aa81c1e2fa0d35f91545d440ce5a31e1a43df
Daan De Meyer [Wed, 16 Nov 2022 16:33:31 +0000 (17:33 +0100)] 
Followups for aa6aa81c1e2fa0d35f91545d440ce5a31e1a43df

2 years agotmpfile-util: Introduce fopen_temporary_child()
Daan De Meyer [Thu, 17 Nov 2022 13:12:48 +0000 (14:12 +0100)] 
tmpfile-util: Introduce fopen_temporary_child()

Instead of having fopen_temporary() create the file either next
to an existing file or in tmp/, let's split this up clearly into
two different functions, one for creating temporary files next to
existing files, and one for creating a temporary file in a directory.

2 years agoHandle MACHINE_ID=uninitialized
Marcus Schäfer [Wed, 16 Nov 2022 15:25:08 +0000 (16:25 +0100)] 
Handle MACHINE_ID=uninitialized

systemd supports /etc/machine-id to be set to: uninitialized
In this case the expectation is that systemd creates a new
machine ID and replaces the value 'uninitialized' with the
effective machine id. In the scope of kernel-install we
should also enforce the creation of a new machine id in this
condition

2 years agopcrphase: add $SYSTEMD_PCRPHASE_STUB_VERIFY env var for overriding stub check
Lennart Poettering [Mon, 14 Nov 2022 16:26:45 +0000 (17:26 +0100)] 
pcrphase: add $SYSTEMD_PCRPHASE_STUB_VERIFY env var for overriding stub check

2 years agoshared/tpm2-util: Fix "Error: Esys invalid ESAPI handle (40000001)" warning
Vitaly Kuznetsov [Tue, 15 Nov 2022 13:57:23 +0000 (14:57 +0100)] 
shared/tpm2-util: Fix "Error: Esys invalid ESAPI handle (40000001)" warning

systemd-cryptenroll complains (but succeeds!) upon binding to a signed PCR
policy:

$ systemd-cryptenroll --unlock-key-file=/tmp/passphrase --tpm2-device=auto
  --tpm2-public-key=... --tpm2-signature=..." /tmp/tmp.img

ERROR:esys:src/tss2-esys/esys_iutil.c:394:iesys_handle_to_tpm_handle() Error: Esys invalid ESAPI handle (40000001).
WARNING:esys:src/tss2-esys/esys_iutil.c:415:iesys_is_platform_handle() Convert handle from TPM2_RH to ESYS_TR, got: 0x40000001
ERROR:esys:src/tss2-esys/esys_iutil.c:394:iesys_handle_to_tpm_handle() Error: Esys invalid ESAPI handle (40000001).
WARNING:esys:src/tss2-esys/esys_iutil.c:415:iesys_is_platform_handle() Convert handle from TPM2_RH to ESYS_TR, got: 0x4000000
New TPM2 token enrolled as key slot 1.

The problem seems to be that Esys_LoadExternal() function from tpm2-tss
expects a 'ESYS_TR_RH*' constant specifying the requested hierarchy and not
a 'TPM2_RH_*' one (see Esys_LoadExternal() -> Esys_LoadExternal_Async() ->
iesys_handle_to_tpm_handle() call chain).

It all works because Esys_LoadExternal_Async() falls back to using the
supplied values when iesys_handle_to_tpm_handle() fails:

    r = iesys_handle_to_tpm_handle(hierarchy, &tpm_hierarchy);
    if (r != TSS2_RC_SUCCESS) {
        ...
        tpm_hierarchy = hierarchy;
    }

Note, TPM2_RH_OWNER was used on purpose to support older tpm2-tss versions
(pre https://github.com/tpm2-software/tpm2-tss/pull/1531), use meson magic
to preserve compatibility.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
2 years agoMerge pull request #25399 from DaanDeMeyer/siginfo-crash
Lennart Poettering [Wed, 16 Nov 2022 17:42:07 +0000 (18:42 +0100)] 
Merge pull request #25399 from DaanDeMeyer/siginfo-crash

crash-handler: Make sure we propagate the original siginfo

2 years agoMerge pull request #25096 from DaanDeMeyer/journald-log-fixes
Daan De Meyer [Wed, 16 Nov 2022 15:40:00 +0000 (16:40 +0100)] 
Merge pull request #25096 from DaanDeMeyer/journald-log-fixes

journal: Ratelimit more journald log messages

2 years agocrash-handler: Make sure we propagate the original siginfo 25399/head
Daan De Meyer [Sun, 5 Jun 2022 12:25:22 +0000 (14:25 +0200)] 
crash-handler: Make sure we propagate the original siginfo

If we call raise(), we lose the information from the original signal.
If we use rt_sigqueueinfo(), the original siginfo gets reused which
is helpful when debugging crashes.

2 years agosigbus: Add fallback in case rt_tgsiqqueueinfo() fails
Daan De Meyer [Wed, 16 Nov 2022 14:06:55 +0000 (15:06 +0100)] 
sigbus: Add fallback in case rt_tgsiqqueueinfo() fails

2 years agomkfs-util: Add support for rootless xfs population
Daan De Meyer [Wed, 16 Nov 2022 10:17:52 +0000 (11:17 +0100)] 
mkfs-util: Add support for rootless xfs population

We use mkfs.xfs's protofile (-p) support to achieve this. The
protofile is a description of the files that should be copied into
the filesystem. The format is described in the manpage of mkfs.xfs.

2 years agoMerge pull request #25319 from zx2c4-forks/krngseed
Luca Boccassi [Wed, 16 Nov 2022 14:07:54 +0000 (15:07 +0100)] 
Merge pull request #25319 from zx2c4-forks/krngseed

boot: implement kernel EFI RNG seed protocol with proper hashing

2 years agosigbus: Make sure the signal is delivered to the same thread
Daan De Meyer [Wed, 16 Nov 2022 14:05:24 +0000 (15:05 +0100)] 
sigbus: Make sure the signal is delivered to the same thread

2 years agomissing_syscall: Add rt_tgsigqueueinfo()
Daan De Meyer [Wed, 16 Nov 2022 14:03:11 +0000 (15:03 +0100)] 
missing_syscall: Add rt_tgsigqueueinfo()

2 years agoMerge pull request #25310 from jlinton/fpdt_dev_mem_alt
Lennart Poettering [Wed, 16 Nov 2022 13:55:17 +0000 (14:55 +0100)] 
Merge pull request #25310 from jlinton/fpdt_dev_mem_alt

acpi-fpdt: Use kernel fpdt parsing

2 years agoMerge pull request #24855 from kraxel/qemu
Lennart Poettering [Wed, 16 Nov 2022 13:53:42 +0000 (14:53 +0100)] 
Merge pull request #24855 from kraxel/qemu

better qemu support (handle direct kernel boot etc).

2 years agoMerge pull request #25393 from poettering/tpm2-override
Lennart Poettering [Wed, 16 Nov 2022 13:30:26 +0000 (14:30 +0100)] 
Merge pull request #25393 from poettering/tpm2-override

tpm2-util: force default TCTI to be "device" with parameter "/dev/tpm…

2 years agosystemd-boot man page: add section for virtual machines 24855/head
Gerd Hoffmann [Tue, 4 Oct 2022 13:01:39 +0000 (15:01 +0200)] 
systemd-boot man page: add section for virtual machines

2 years agoboot: improve support for qemu
Gerd Hoffmann [Fri, 9 Sep 2022 11:12:04 +0000 (13:12 +0200)] 
boot: improve support for qemu

systemd-boot expects being loaded from ESP and is quite unhappy in case
the loaded image device path is something else.  When running on qemu
this can easily happen though.  Case one is direct kernel boot, i.e.
loading via 'qemu -kernel systemd-bootx64.efi'.  Case two is sd-boot
being added to the ovmf firmware image and being loaded from there.

This patch detects both cases and goes inspect all file systems known to
the firmware, trying to find the ESP.  When present the
VMMBootOrderNNNN variables are used to inspect the file systems in the
given order.

2 years agoMerge pull request #24555 from medhefgo/bootctl
Zbigniew Jędrzejewski-Szmek [Wed, 16 Nov 2022 11:27:30 +0000 (12:27 +0100)] 
Merge pull request #24555 from medhefgo/bootctl

bootctl: Small improvements

2 years agolocalectl,analyze: some minor vertical table rework fixes
Lennart Poettering [Fri, 11 Nov 2022 13:32:51 +0000 (14:32 +0100)] 
localectl,analyze: some minor vertical table rework fixes

Follow-up for #25339

2 years agolog: Disable log rate limiting if debug logging is enabled 25096/head
Daan De Meyer [Wed, 16 Nov 2022 10:37:14 +0000 (11:37 +0100)] 
log: Disable log rate limiting if debug logging is enabled

When debugging, it makes sense to not do any rate limiting at all.

2 years agoMerge pull request #24944 from DaanDeMeyer/repart-rootless
Daan De Meyer [Wed, 16 Nov 2022 08:09:06 +0000 (09:09 +0100)] 
Merge pull request #24944 from DaanDeMeyer/repart-rootless

repart: Add support for running without root privileges

2 years agoRevert "journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL"
Daan De Meyer [Mon, 14 Nov 2022 11:45:47 +0000 (12:45 +0100)] 
Revert "journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL"

This commit broke backwards compatibility so let's revert it until
we find a better solution.

This reverts commit 977ad21b5b8f6323515297bd8995dcaaca0905df.

2 years agoFix reading /etc/machine-id in kernel-install (#25388)
Marcus Schäfer [Tue, 15 Nov 2022 23:17:19 +0000 (00:17 +0100)] 
Fix reading /etc/machine-id in kernel-install (#25388)

* Fix reading /etc/machine-id in kernel-install

The kernel-install script has code to read the contents of
/etc/machine-id into the MACHINE_ID variable. Depending
on the variable content kernel-install either logs the
value or creates a new machine id via 'systemd-id128 new'.
In that logic there is one issue. If the file /etc/machine-id
exists but is empty, the script tries to call read on an
empty file which return with an exit code != 0. As the
script code also uses 'set -e', kernel-install will exit at
this point which is unexpected.

The condition of an empty /etc/machine-id file exists for
example when building OS images, which should initialize the
system id on first boot but not staticly inside of the image.
afaik an empty /etc/machine-id is also a common approach
to make systemd indicate that it should create a new system
id. Because of this, the commit makes sure the reading of
/etc/machine-id does not fail in any case such that the
handling of the MACHINE_ID variable takes place.

2 years agoUpdate hostnamectl.xml
angus-p [Tue, 15 Nov 2022 16:11:36 +0000 (16:11 +0000)] 
Update hostnamectl.xml

set-hostname is obsolete

2 years agotpm2: add some extra validation of device string before using it 25393/head
Lennart Poettering [Tue, 15 Nov 2022 22:01:04 +0000 (23:01 +0100)] 
tpm2: add some extra validation of device string before using it

Let's add some extra validation before constructing and using the .so
name to load. This isn't really security sensitive, given that we
used secure_getenv() to get the device string (and it thus should have
been come from a trusted source) but let's better be safe than sorry.

2 years agotpm2-util: force default TCTI to be "device" with parameter "/dev/tpmrm0"
Lennart Poettering [Mon, 14 Nov 2022 16:26:49 +0000 (17:26 +0100)] 
tpm2-util: force default TCTI to be "device" with parameter "/dev/tpmrm0"

Apparently some distros default to tss-abmrd. Let's bypass that and
always go to the kernel resource manager.

abmrd cannot really work for us, since we want to access the TPM already
in earliest boot i.e. in environments the abmrd service is not available
in.

Fixes: #25352
2 years agoMemoryZSwapMax directive to configure new memory.zswap.max cgroup file
Pasha Vorobyev [Fri, 4 Feb 2022 19:49:46 +0000 (11:49 -0800)] 
MemoryZSwapMax directive to configure new memory.zswap.max cgroup file

2 years agorepart: Run most repart integration tests without root privileges 24944/head
Daan De Meyer [Thu, 10 Nov 2022 14:40:00 +0000 (15:40 +0100)] 
repart: Run most repart integration tests without root privileges

To make sure rootless mode keeps working, let's run all repart
integration tests that we can without root privileges. The only ones
we need to keep running with root privileges are the tests that operate
on a block/loop device and those that use --image=.

2 years agorepart: Don't use loop devices when we're not operating on a block device
Daan De Meyer [Sun, 9 Oct 2022 22:14:17 +0000 (00:14 +0200)] 
repart: Don't use loop devices when we're not operating on a block device

When repart is not operating on a block device, if we avoid using
any loop devices at all, it becomes possible to run repart without
needing root privileges.

Note that this also depends on the filesystems in use to support
population without needing root privileges (specifically, squashfs,
ext4 or btrfs).

2 years agorepart: Change mode of temporary root to 755
Daan De Meyer [Thu, 10 Nov 2022 13:32:15 +0000 (14:32 +0100)] 
repart: Change mode of temporary root to 755

Let's make sure regular users can access read/execute files when
we're populating from a temporary root.

2 years agorepart: Fail early if no sources are provided for a read-only filesystem
Daan De Meyer [Wed, 12 Oct 2022 12:53:48 +0000 (14:53 +0200)] 
repart: Fail early if no sources are provided for a read-only filesystem

2 years agorepart: Skip partition_populate_directory() if no sources are provided
Daan De Meyer [Wed, 12 Oct 2022 12:40:29 +0000 (14:40 +0200)] 
repart: Skip partition_populate_directory() if no sources are provided

2 years agorepart: Fail early if we're missing privileges to populate a filesystem
Daan De Meyer [Tue, 11 Oct 2022 08:56:16 +0000 (10:56 +0200)] 
repart: Fail early if we're missing privileges to populate a filesystem

2 years agorepart: Ensure files end up owned by root in generated filesystems
Daan De Meyer [Mon, 10 Oct 2022 21:34:04 +0000 (23:34 +0200)] 
repart: Ensure files end up owned by root in generated filesystems

By forking off a user namespace before running mkfs and ID mapping
the user running repart to root in the user namespace, we can make
sure that files in the generated filesystems are all owned by root
instead of the user running repart.

To make this work we have to make sure that all the files in the
root directory that's passed to the mkfs binary are owned by the
user running repart, so we have to drop the shortcut for only a
single root directory in partition_populate_directory().

2 years agorepart: Fix copy failure error message
Daan De Meyer [Mon, 10 Oct 2022 16:12:15 +0000 (18:12 +0200)] 
repart: Fix copy failure error message

2 years agorepart: Move verity sig formatting into data partition functions
Daan De Meyer [Sun, 9 Oct 2022 20:30:05 +0000 (22:30 +0200)] 
repart: Move verity sig formatting into data partition functions

Refactoring to make implementing rootless repart easier.

2 years agorepart: Move verity hash formatting into data partition functions
Daan De Meyer [Sun, 9 Oct 2022 20:26:10 +0000 (22:26 +0200)] 
repart: Move verity hash formatting into data partition functions

Refactoring to make implementing rootless repart easier.

2 years agorepart: Do offline encryption instead of online
Daan De Meyer [Sun, 9 Oct 2022 18:46:59 +0000 (20:46 +0200)] 
repart: Do offline encryption instead of online

Offline encryption can be done without mounting the luks device. For
now we still use loop devices to split out the partition we want to
write to but in a later commit we'll replace this with a regular file.

For offline encryption, we need to keep 2x the luks header size space
free at the end of the partition, so this means our encrypted partitions
will be 16M larger than before.

2 years agorepart: Let libcryptsetup calculate the volume key
Daan De Meyer [Thu, 13 Oct 2022 12:36:06 +0000 (14:36 +0200)] 
repart: Let libcryptsetup calculate the volume key

We also bump the volume key size to 512 bits.

2 years agomkfs-util: Add support to populate vfat without mounting using mcopy
Daan De Meyer [Tue, 11 Oct 2022 08:50:58 +0000 (10:50 +0200)] 
mkfs-util: Add support to populate vfat without mounting using mcopy

mkfs.vfat doesn't support specifying a root directory to bootstrap
the filesystem from (see https://github.com/dosfstools/dosfstools/issues/183).
Instead, we can use the mcopy tool from the mtools package to copy
files into the vfat filesystem after creating it without needing to
mount the vfat filesystem.

2 years agomkosi: Add mkfs tools to mkosi image
Daan De Meyer [Sun, 9 Oct 2022 17:52:08 +0000 (19:52 +0200)] 
mkosi: Add mkfs tools to mkosi image

Useful for testing systemd-repart

2 years agomkfs-util: Add root support for ext and btrfs
Daan De Meyer [Fri, 7 Oct 2022 19:21:46 +0000 (21:21 +0200)] 
mkfs-util: Add root support for ext and btrfs

For these filesysrems, it's useful to provide the filesystem upfront
so that we don't have to mount it later which requires root privileges.

2 years agomkfs-util: Make argument handling for mkfs binaries more flexible
Daan De Meyer [Mon, 10 Oct 2022 22:10:39 +0000 (00:10 +0200)] 
mkfs-util: Make argument handling for mkfs binaries more flexible

Preparation for the next commit.

2 years agobtrfs-util: Remove bogus assert()
Daan De Meyer [Mon, 10 Oct 2022 13:45:24 +0000 (15:45 +0200)] 
btrfs-util: Remove bogus assert()

If size is zero, BTRFS_IOC_CLONE_RANGE will copy until the end of
the source file.

2 years agoMerge pull request #25001 from DaanDeMeyer/repart-filter
Daan De Meyer [Tue, 15 Nov 2022 19:07:24 +0000 (20:07 +0100)] 
Merge pull request #25001 from DaanDeMeyer/repart-filter

repart: Add --include/--exclude-partitions

2 years agorepart: Add integration test for --include/--exclude-partitions 25001/head
Daan De Meyer [Fri, 11 Nov 2022 13:26:45 +0000 (14:26 +0100)] 
repart: Add integration test for --include/--exclude-partitions

2 years agorepart: Add --include/--exclude-partitions
Daan De Meyer [Fri, 14 Oct 2022 10:06:55 +0000 (12:06 +0200)] 
repart: Add --include/--exclude-partitions

Let's allow filtering the partitions to operate on by partition
type UUID. This is necessary when building bootable images with a
verity protected root/usr partition as we can only build the UKI
image when we have the verity roothash which means we cannot populate
the EFI partition yet when we run repart initially to determine the
verity roothash.

2 years agorepart: Use first unused partition number for new partitions
Daan De Meyer [Fri, 14 Oct 2022 10:40:28 +0000 (12:40 +0200)] 
repart: Use first unused partition number for new partitions

If we skip some partition types in a first run of systemd-repart,
we don't want their partition numbers to be different than usual,
so let's change the allocation of partition numbers to account for
that.

2 years agogpt: Expose GptPartitionType and get rid of SECONDARY/OTHER
Daan De Meyer [Thu, 13 Oct 2022 19:26:16 +0000 (21:26 +0200)] 
gpt: Expose GptPartitionType and get rid of SECONDARY/OTHER

Instead of exposing just the partition type UUID, let's expose the
GptPartitionType struct, which has a lot more information available
in a much more accessible way.

Also, let's get rid of SECONDARY/OTHER in PartitionDesignator. These
were only there to support preferred architectures in dissect-image.c,
but we can easily handle that by comparing architectures when we decide
whether to override a partition. This is done in a new function
compare_arch().

2 years agorepart: Remove the repeated ';' from code (#25386)
Li kunyu [Tue, 15 Nov 2022 08:02:51 +0000 (08:02 +0000)] 
repart: Remove the repeated ';' from code (#25386)

2 years agoMerge pull request #24908 from DaanDeMeyer/repart-minimize
Daan De Meyer [Tue, 15 Nov 2022 07:19:28 +0000 (08:19 +0100)] 
Merge pull request #24908 from DaanDeMeyer/repart-minimize

repart: Add Minimize setting

2 years agoacpi-fpdt: Use kernel fpdt parsing 25310/head
Jeremy Linton [Tue, 8 Nov 2022 05:31:30 +0000 (23:31 -0600)] 
acpi-fpdt: Use kernel fpdt parsing

On some kernels/distros (RHEL/aarch64) /dev/mem is
turned off. This means that the ACPI FPDT data is
missing from systemd-analyze output when /dev/mem
fails to provide the boot times.

Instead recent kernels can export that data from
/sys/firmware/acpi/fpdt/boot/ entries. Use that
information if available first.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2 years agorandom-seed: refresh EFI boot seed when writing a new seed 25319/head
Jason A. Donenfeld [Fri, 11 Nov 2022 14:22:35 +0000 (15:22 +0100)] 
random-seed: refresh EFI boot seed when writing a new seed

Since this runs at shutdown to write a new seed, we should also keep the
bootloader's seed maximally fresh by doing the same. So we follow the
same pattern - hash some new random bytes with the old seed to make a
new seed. We let this fail without warning, because it's just an
opportunistic thing. If the user happens to have set up the random seed
with bootctl, and the RNG is initialized, then things should be fine. If
not, we create a new seed if systemd-boot is in use. And if not, then we
just don't do anything.

2 years agoboot: implement kernel EFI RNG seed protocol with proper hashing
Jason A. Donenfeld [Wed, 9 Nov 2022 11:44:37 +0000 (12:44 +0100)] 
boot: implement kernel EFI RNG seed protocol with proper hashing

Rather than passing seeds up to userspace via EFI variables, pass seeds
directly to the kernel's EFI stub loader, via LINUX_EFI_RANDOM_SEED_TABLE_GUID.
EFI variables can potentially leak and suffer from forward secrecy
issues, and processing these with userspace means that they are
initialized much too late in boot to be useful. In contrast,
LINUX_EFI_RANDOM_SEED_TABLE_GUID uses EFI configuration tables, and so
is hidden from userspace entirely, and is parsed extremely early on by
the kernel, so that every single call to get_random_bytes() by the
kernel is seeded.

In order to do this properly, we use a bit more robust hashing scheme,
and make sure that each input is properly memzeroed out after use. The
scheme is:

    key = HASH(LABEL || sizeof(input1) || input1 || ... || sizeof(inputN) || inputN)
    new_disk_seed = HASH(key || 0)
    seed_for_linux = HASH(key || 1)

The various inputs are:
- LINUX_EFI_RANDOM_SEED_TABLE_GUID from prior bootloaders
- 256 bits of seed from EFI's RNG
- The (immutable) system token, from its EFI variable
- The prior on-disk seed
- The UEFI monotonic counter
- A timestamp

This also adjusts the secure boot semantics, so that the operation is
only aborted if it's not possible to get random bytes from EFI's RNG or
a prior boot stage. With the proper hashing scheme, this should make
boot seeds safe even on secure boot.

There is currently a bug in Linux's EFI stub in which if the EFI stub
manages to generate random bytes on its own using EFI's RNG, it will
ignore what the bootloader passes. That's annoying, but it means that
either way, via systemd-boot or via EFI stub's mechanism, the RNG *does*
get initialized in a good safe way. And this bug is now fixed in the
efi.git tree, and will hopefully be backported to older kernels.

As the kernel recommends, the resultant seeds are 256 bits and are
allocated using pool memory of type EfiACPIReclaimMemory, so that it
gets freed at the right moment in boot.

2 years agorepart: Add Minimize= integration test 24908/head
Daan De Meyer [Thu, 10 Nov 2022 11:33:02 +0000 (12:33 +0100)] 
repart: Add Minimize= integration test

2 years agoMerge pull request #25327 from keszybz/mkosi-less-work
Frantisek Sumsal [Mon, 14 Nov 2022 11:44:16 +0000 (11:44 +0000)] 
Merge pull request #25327 from keszybz/mkosi-less-work

Skip mkosi runs on docs-only changes and some small cleanups

2 years agoMerge pull request #25361 from bluca/readme
Luca Boccassi [Mon, 14 Nov 2022 11:32:39 +0000 (12:32 +0100)] 
Merge pull request #25361 from bluca/readme

README: note a couple more kconfigs

2 years agomeasure: fix section names in 'objcopy' example in systemd-measure man
Vitaly Kuznetsov [Fri, 11 Nov 2022 16:15:55 +0000 (17:15 +0100)] 
measure: fix section names in 'objcopy' example in systemd-measure man

A copy paste error has crippled in the objcopy example in 'systemd-measure'
manual,  "--change-section-vma" should reference the section being added,
not ".splash". When used as-is, the resulting UKI is unbootable.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
2 years agoREADME: note Kconfig for verifying DDIs via MoK keys 25361/head
Luca Boccassi [Sat, 12 Nov 2022 01:07:13 +0000 (01:07 +0000)] 
README: note Kconfig for verifying DDIs via MoK keys

Also note them in the mkosi.build kernel config list

2 years agomkosi: drop spaces after shell redirection operator 25327/head
Zbigniew Jędrzejewski-Szmek [Thu, 10 Nov 2022 14:12:33 +0000 (15:12 +0100)] 
mkosi: drop spaces after shell redirection operator

2 years agoci: use mkosi executable directly
Zbigniew Jędrzejewski-Szmek [Thu, 10 Nov 2022 14:10:08 +0000 (15:10 +0100)] 
ci: use mkosi executable directly

2 years agosystemctl: do not show unit properties with --all
Yu Watanabe [Sun, 13 Nov 2022 12:10:56 +0000 (21:10 +0900)] 
systemctl: do not show unit properties with --all

Fixes a bug introduced by a6e334649d4bdff0c6f664e98666b2223aa21a8b.

Fixes #25343.

2 years agotmpfiles: log at info level when some allowed failures occur
Luca Boccassi [Thu, 10 Nov 2022 15:47:19 +0000 (15:47 +0000)] 
tmpfiles: log at info level when some allowed failures occur

In provision.conf we ship:

d- /root :0700 root :root -
d- /root/.ssh :0700 root :root -

These are allowed to fail, for example on a read-only filesystem. But they still
log at error level, which is annoying and gets flagged. Tune those specific errors
down to info.

There are likely more that could be tuned down, but the important thing is to cover
the tmpfiles.d that we ship right now.

Before:

$ echo -e "d- /root :0700 root :root - \nd- /root/.ssh :0700 root :root -" | SYSTEMD_LOG_LEVEL=err build/systemd-tmpfiles --root=/tmp/img --create -
Failed to create directory or subvolume "/tmp/img/root": Read-only file system
Failed to open path '/tmp/img/root': No such file or directory
$

After:

$ echo -e "d- /root :0700 root :root - \nd- /root/.ssh :0700 root :root -" | SYSTEMD_LOG_LEVEL=err build/systemd-tmpfiles --root=/tmp/img --create -
$

2 years agomodule-util: use the blacklist from module_blacklist= in cmdline
Mike Yuan [Fri, 11 Nov 2022 18:52:38 +0000 (02:52 +0800)] 
module-util: use the blacklist from module_blacklist= in cmdline

When a module is blacklisted using module_blacklist=
we shouldn't fail with 'Operation not permitted'.
Instead we check for it and skip it if this is the case.

2 years agoMerge pull request #25368 from yuwata/bootctl-ignore-invalid-boot-entries
Yu Watanabe [Mon, 14 Nov 2022 01:51:33 +0000 (10:51 +0900)] 
Merge pull request #25368 from yuwata/bootctl-ignore-invalid-boot-entries

bootctl: ignore invalid boot entries

2 years agoMerge pull request #25373 from medhefgo/boot-fixes
Yu Watanabe [Sun, 13 Nov 2022 23:18:21 +0000 (08:18 +0900)] 
Merge pull request #25373 from medhefgo/boot-fixes

boot: Small fixes

2 years agodissect-image: do not try to close invalid fd
Yu Watanabe [Sun, 13 Nov 2022 10:25:02 +0000 (19:25 +0900)] 
dissect-image: do not try to close invalid fd

Fixes a bug introduced by f7725647bb41c3398a867f139efe526efe8aa1b3.

Hopefully fixes #25348.

2 years agoboot: Fix error message 25373/head
Jan Janssen [Sun, 13 Nov 2022 15:14:17 +0000 (16:14 +0100)] 
boot: Fix error message

2 years agoboot: Silence driver reconnect errors
Jan Janssen [Sat, 12 Nov 2022 15:24:53 +0000 (16:24 +0100)] 
boot: Silence driver reconnect errors

2 years agoMerge pull request #25338 from DaanDeMeyer/at-fixes
Yu Watanabe [Sun, 13 Nov 2022 13:59:40 +0000 (22:59 +0900)] 
Merge pull request #25338 from DaanDeMeyer/at-fixes

Followups for #24813

2 years agoMerge pull request #25339 from dtardon/vertical-tables
Yu Watanabe [Sun, 13 Nov 2022 13:39:36 +0000 (22:39 +0900)] 
Merge pull request #25339 from dtardon/vertical-tables

Port more tools to vertical table

2 years agolocalectl: port to vertical table 25339/head
David Tardon [Fri, 11 Nov 2022 08:59:09 +0000 (09:59 +0100)] 
localectl: port to vertical table

2 years agohostnamectl: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:57:10 +0000 (09:57 +0100)] 
hostnamectl: port to vertical table

2 years agoanalyze-inspect-elf: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:53:10 +0000 (09:53 +0100)] 
analyze-inspect-elf: port to vertical table

2 years agoanalyze-timespan: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:42:52 +0000 (09:42 +0100)] 
analyze-timespan: port to vertical table

2 years agoanalyze-timestamp: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:17:20 +0000 (09:17 +0100)] 
analyze-timestamp: port to vertical table

2 years agoanalyze-calendar: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:11:30 +0000 (09:11 +0100)] 
analyze-calendar: port to vertical table

2 years agoanalyze-calendar: avoid unnecessary abbreviation
David Tardon [Fri, 11 Nov 2022 08:12:06 +0000 (09:12 +0100)] 
analyze-calendar: avoid unnecessary abbreviation

2 years agoMerge pull request #25360 from poettering/strv-fixes
Yu Watanabe [Sun, 13 Nov 2022 11:17:10 +0000 (20:17 +0900)] 
Merge pull request #25360 from poettering/strv-fixes

nulstr fixes

2 years agoMerge pull request #25355 from poettering/chase-symlinks-no-symlink
Yu Watanabe [Sun, 13 Nov 2022 11:16:34 +0000 (20:16 +0900)] 
Merge pull request #25355 from poettering/chase-symlinks-no-symlink

chase_symlinks(): add CHASE_PROHIBIT_SYMLINKS

2 years agoMerge pull request #25349 from poettering/table-header-rework-only
Yu Watanabe [Sun, 13 Nov 2022 11:16:09 +0000 (20:16 +0900)] 
Merge pull request #25349 from poettering/table-header-rework-only

format-table: add TABLE_HEADER cell table

2 years agobootctl,bootspec: make use of CHASE_PROHIBIT_SYMLINKS whenever we access the ESP... 25355/head
Lennart Poettering [Fri, 11 Nov 2022 16:36:29 +0000 (17:36 +0100)] 
bootctl,bootspec: make use of CHASE_PROHIBIT_SYMLINKS whenever we access the ESP/XBOOTLDR

Let's make use of the new flag whenever we access the ESP or XBOOTLDR.
The resources we make use of in these partitions can't possibly use
symlinks (because UEFI knows no symlink concept), and they are untrusted
territory, hence under no circumstances we should be tricked into
following symlinks that shouldn't be there in the first place.

Of course, you might argue thta ESP/XBOOTLDR are VFAT and thus don#t
know symlinks. But the thing is, they don#t have to be. Firmware can
support other file systems too, and people can use efifs to gain access
to arbitrary Linux file systems from EFI. Hence, let's better be safe
than sorry.

2 years agochase-symlinks: add new flag for prohibiting any following of symlinks
Lennart Poettering [Fri, 11 Nov 2022 16:31:34 +0000 (17:31 +0100)] 
chase-symlinks: add new flag for prohibiting any following of symlinks

This is useful when operating in the ESP, which is untrusted territory,
and where under no circumstances we should be tricked by symlinks into
doing anything we don't want to.

2 years agotests: add tests for various corner cases of nulstr 25360/head
Lennart Poettering [Fri, 11 Nov 2022 22:26:08 +0000 (23:26 +0100)] 
tests: add tests for various corner cases of nulstr

2 years agonulstr-util: fix corner cases of strv_make_nulstr()
Lennart Poettering [Fri, 11 Nov 2022 22:17:12 +0000 (23:17 +0100)] 
nulstr-util: fix corner cases of strv_make_nulstr()

Let's change the return semantics of strv_make_nulstr() so that we can
properly distuingish the case where we have a no entries in the nulstr
from the case where we have a single empty string in a nulstr.

Previously we couldn't distuingish those, we'd in both cases return a
size of zero, and a buffer with two NUL bytes.

With this change, we'll still return a buffer with two NULL bytes, but
for the case where no entries are defined we'll return a size of zero,
and where we have two a size of one.

This is a good idea, as it makes sure we can properly handle all corner
cases.

Nowadays the function is used by one place only: ask-password-api.c. The
corner case never mattered there, since it was used to serialize
passwords, and it was known that there was exactly one password, not
less. But let's clean this up. This means the subtraction of the final
NUL byte now happens in ask-password-api.c instead.

2 years agonulstr-util: don't use 'r' for anything but integer return values
Lennart Poettering [Fri, 11 Nov 2022 21:07:43 +0000 (22:07 +0100)] 
nulstr-util: don't use 'r' for anything but integer return values

2 years agonulstr-util: use memdup_suffix0() where appropriate
Lennart Poettering [Fri, 11 Nov 2022 21:04:37 +0000 (22:04 +0100)] 
nulstr-util: use memdup_suffix0() where appropriate

if the nulstr is not nul-terminated, we shouldn't use strndup() but
memdup_suffix0(), to not trip up static analyzers which imply we are
duping a string here.

2 years agonulstr-util: use _cleanup_strv_free_() where appropriate
Lennart Poettering [Fri, 11 Nov 2022 21:01:03 +0000 (22:01 +0100)] 
nulstr-util: use _cleanup_strv_free_() where appropriate

2 years agonulstr-util: rebreak comments
Lennart Poettering [Fri, 11 Nov 2022 20:59:41 +0000 (21:59 +0100)] 
nulstr-util: rebreak comments

2 years agonulstr-util: modernize strv_from_nulstr() a bit
Lennart Poettering [Fri, 11 Nov 2022 20:57:28 +0000 (21:57 +0100)] 
nulstr-util: modernize strv_from_nulstr() a bit

2 years agostrv: move nulstr utilities to nulstr-util.[ch]
Lennart Poettering [Fri, 11 Nov 2022 20:55:00 +0000 (21:55 +0100)] 
strv: move nulstr utilities to nulstr-util.[ch]

Let's move them out of the generic, already very long strv.[ch] module
into the more specific nulst-util.[ch]

No code changes.

2 years agoformat-table: teach table_add_cell_stringf_full() to generate TABLE_FIELD/TABLE_HEADE... 25349/head
Lennart Poettering [Fri, 11 Nov 2022 14:01:46 +0000 (15:01 +0100)] 
format-table: teach table_add_cell_stringf_full() to generate TABLE_FIELD/TABLE_HEADER cells, too

2 years agoformat-table: introduce TABLE_HEADER cell type
Lennart Poettering [Fri, 11 Nov 2022 13:25:51 +0000 (14:25 +0100)] 
format-table: introduce TABLE_HEADER cell type

This rework the logic for handling the "header" cells a bit. Instead of
special casing the first row in regards to uppercasing/coloring let's
just intrduce a proper cell type TABLE_HEADER which is in most ways
identical to TABLE_STRING except that it defaults to uppercase output
and underlined coloring.

This is mostly refactoring, but I think it makes a ton of sense as it
makes the first row less special and you could in fact insert
TABLE_HEADER (and in fact TABLE_FIELD) cells wherever you like and
something sensible would happen (i.e. a string cell is displayed with
a specific formatting).

2 years agoac-power: check battery existence and status
Yu Watanabe [Fri, 11 Nov 2022 04:54:03 +0000 (13:54 +0900)] 
ac-power: check battery existence and status

If a battery is not present or its status is not discharging, then
the battery should not be used as a power source.
Let's count batteries currently discharging.

Fixes #25316.

2 years agobootctl: downgrade log message when firmware reports non-existent or invalid boot... 25368/head
Yu Watanabe [Sun, 13 Nov 2022 05:41:08 +0000 (14:41 +0900)] 
bootctl: downgrade log message when firmware reports non-existent or invalid boot entry

Fixes #25359.

2 years agobootctl: make boot entry id logged in hex
Yu Watanabe [Sun, 13 Nov 2022 05:36:01 +0000 (14:36 +0900)] 
bootctl: make boot entry id logged in hex

To make consistent with the printed boot id below and other tools e.g.
efibootmgr.

2 years agoMerge pull request #25268 from PeterCxy/fido2-preflight
Luca Boccassi [Sat, 12 Nov 2022 14:51:47 +0000 (15:51 +0100)] 
Merge pull request #25268 from PeterCxy/fido2-preflight

libfido2-util: Perform pre-flight check for credentials in token

2 years agoREADME: use https on one more link
Luca Boccassi [Sat, 12 Nov 2022 01:04:19 +0000 (01:04 +0000)] 
README: use https on one more link