]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
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

3 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

3 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

3 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

3 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>
3 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

3 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

3 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

3 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.

3 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 -
$

3 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.

3 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

3 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

3 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.

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

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

3 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

3 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

3 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

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

3 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

3 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

3 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

3 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

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

3 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

3 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

3 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

3 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.

3 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.

3 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

3 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.

3 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

3 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.

3 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

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

3 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

3 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.

3 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

3 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).

3 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.

3 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.

3 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.

3 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

3 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

3 years agoman/systemd-dissect.xml: fix trivial error
Carlo Teubner [Fri, 11 Nov 2022 19:42:49 +0000 (19:42 +0000)] 
man/systemd-dissect.xml: fix trivial error

3 years agoMerge pull request #25351 from crrodriguez/Wenum-int-mismatch
Luca Boccassi [Sat, 12 Nov 2022 00:40:57 +0000 (01:40 +0100)] 
Merge pull request #25351 from crrodriguez/Wenum-int-mismatch

Fix gcc 13 -Wenum-int-mismatch warnings

3 years agoshared|install: Use InstallChangeType consistently 25351/head
Cristian Rodríguez [Fri, 11 Nov 2022 15:34:32 +0000 (15:34 +0000)] 
shared|install: Use InstallChangeType consistently

gcc 13 -Wenum-int-mismatch, enabled by default, reminds us enum ! = int

3 years agoresolve: dns_server_feature_level_*_string type is DnsServerFeatureLevel
Cristian Rodríguez [Fri, 11 Nov 2022 15:31:18 +0000 (15:31 +0000)] 
resolve: dns_server_feature_level_*_string type is DnsServerFeatureLevel

gcc 13 -Wenum-int-mismatch reminds us that enum != int

3 years agojournal-remote: code is of type enum MHD_RequestTerminationCode
Cristian Rodríguez [Fri, 11 Nov 2022 15:28:51 +0000 (15:28 +0000)] 
journal-remote: code is of type enum MHD_RequestTerminationCode

Fixes gcc 13 -Wenum-int-mismatch which are enabled by default.

3 years agolibfido2-util: Perform pre-flight check for credentials in token 25268/head
MkfsSion [Sat, 29 Oct 2022 18:29:02 +0000 (14:29 -0400)] 
libfido2-util: Perform pre-flight check for credentials in token

Do not attempt to decrypt using a key slot unless its corresponding
credential is found on an available FIDO2 token. Avoids multiple touches
/ confirmations when unlocking a LUKS2 device with multiple FIDO2 tokens
enrolled.

Partially fixes #19208 (when the libcryptsetup plugin is in use).

3 years agolibfido2-util: Extract error handling logic from fido2_use_hmac_hash_specific_token
MkfsSion [Sat, 29 Oct 2022 18:21:06 +0000 (14:21 -0400)] 
libfido2-util: Extract error handling logic from fido2_use_hmac_hash_specific_token

3 years agolibfido2-util: Commonize FIDO2 basic property settings
MkfsSion [Sat, 29 Oct 2022 18:14:22 +0000 (14:14 -0400)] 
libfido2-util: Commonize FIDO2 basic property settings

These properties are repeatedly set across multiple functions.

3 years agorepart: fix build
Lennart Poettering [Fri, 11 Nov 2022 16:47:21 +0000 (17:47 +0100)] 
repart: fix build

Follow-up for: 12e2b70f9b849e54018f147b8a11154cd5e2dcf6

3 years agonulstr-util: Declare NULSTR_FOREACH() iterator inline
Daan De Meyer [Fri, 11 Nov 2022 11:08:26 +0000 (12:08 +0100)] 
nulstr-util: Declare NULSTR_FOREACH() iterator inline

3 years agostrv: Make sure strv_make_nulstr() always returns a valid nulstr
Daan De Meyer [Fri, 11 Nov 2022 10:26:54 +0000 (11:26 +0100)] 
strv: Make sure strv_make_nulstr() always returns a valid nulstr

strv_make_nulstr() is documented to always return a valid nulstr,
but if the input is `NULL` we return a string terminated with only
a single NUL terminator, so let's fix that and always terminate the
resulting string with two NUL bytes.

3 years agosd-bus: Use goto finish instead of return in bus_add_match_full
Daan De Meyer [Fri, 11 Nov 2022 10:09:28 +0000 (11:09 +0100)] 
sd-bus: Use goto finish instead of return in bus_add_match_full

Fixes #25340

3 years agoresolve: Use only C99 flex arrays (#25335)
Cristian Rodríguez [Fri, 11 Nov 2022 14:22:49 +0000 (11:22 -0300)] 
resolve: Use only C99 flex arrays (#25335)

3 years agorepart: Take into account minimal filesystem size
Daan De Meyer [Wed, 12 Oct 2022 21:59:37 +0000 (23:59 +0200)] 
repart: Take into account minimal filesystem size

Instead of requiring users to guess the required space for partitions
populated with CopyFiles=, let's make an educated guess ourselves. We
can populate the filesystem once in a very large sparse file and see
how much data is actually used as a good indicator of the required size.

3 years agorepart: Use ULL for all size constants
Daan De Meyer [Thu, 10 Nov 2022 10:03:15 +0000 (11:03 +0100)] 
repart: Use ULL for all size constants

3 years agorepart: Allow custom root directory per copy blocks source
Daan De Meyer [Fri, 14 Oct 2022 11:32:47 +0000 (13:32 +0200)] 
repart: Allow custom root directory per copy blocks source

Preparation for the next commit

3 years agorepart: Don't log partition number when populating filesystem
Daan De Meyer [Thu, 13 Oct 2022 12:02:39 +0000 (14:02 +0200)] 
repart: Don't log partition number when populating filesystem

This might not be known yet so let's use the filesystem itself
instead.

3 years agorepart: Create loop device when populating filesystems if needed
Daan De Meyer [Thu, 13 Oct 2022 11:45:34 +0000 (13:45 +0200)] 
repart: Create loop device when populating filesystems if needed

3 years agorepart: Move fstype_is_ro() checks out of the populate functions
Daan De Meyer [Thu, 13 Oct 2022 11:38:36 +0000 (13:38 +0200)] 
repart: Move fstype_is_ro() checks out of the populate functions

Preparation for the next commit.

3 years agoresize-fs: Bump xfs minimum partition size to 16MB
Daan De Meyer [Thu, 13 Oct 2022 11:31:13 +0000 (13:31 +0200)] 
resize-fs: Bump xfs minimum partition size to 16MB

14MB leads to errors in mkfs.xfs when running repart.

3 years agorepart: Calculate filesystem UUID earlier
Daan De Meyer [Thu, 13 Oct 2022 11:26:07 +0000 (13:26 +0200)] 
repart: Calculate filesystem UUID earlier

3 years agorepart: Use COPY_HOLES more
Daan De Meyer [Wed, 12 Oct 2022 18:05:38 +0000 (20:05 +0200)] 
repart: Use COPY_HOLES more

3 years agorepart: Use COPY_REFLINK in context_copy_blocks()
Daan De Meyer [Wed, 12 Oct 2022 18:04:11 +0000 (20:04 +0200)] 
repart: Use COPY_REFLINK in context_copy_blocks()

We might be copying between files without a loop device involved.
In that case, a reflink is possible and will be much faster.

3 years agorepart: Use copy_bytes() instead of copy_bytes_full()
Daan De Meyer [Wed, 12 Oct 2022 18:01:37 +0000 (20:01 +0200)] 
repart: Use copy_bytes() instead of copy_bytes_full()

3 years agoMerge pull request #24803 from DaanDeMeyer/repart-copy-deny-list
Daan De Meyer [Fri, 11 Nov 2022 12:19:58 +0000 (13:19 +0100)] 
Merge pull request #24803 from DaanDeMeyer/repart-copy-deny-list

repart: Don't descend into directories assigned to other partitions

3 years agoci: skip running on docs-only changes
Zbigniew Jędrzejewski-Szmek [Thu, 10 Nov 2022 14:00:53 +0000 (15:00 +0100)] 
ci: skip running on docs-only changes

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths

> If you define a path with the ! character, you must also define at least one
> path without the ! character. If you only want to exclude paths, use
> paths-ignore instead.
>
> The order that you define patterns matters:
>     A matching negative pattern (prefixed with !) after a positive match will
>     exclude the path.
>     A matching positive pattern after a negative match will include the path
>     again.

Even if some of the exluded paths *could* impact the build, generally it's a
waste of time to do mkosi builds on them. Let's skip to releave the builders a
bit.

3 years agoRevert "rm-rf: Add rm_rf_physical_and_close()" 25338/head
Daan De Meyer [Fri, 11 Nov 2022 09:05:32 +0000 (10:05 +0100)] 
Revert "rm-rf: Add rm_rf_physical_and_close()"

This reverts commit 56e2bceddc7383c4abe1ef0110192e491c729de4.

Doing destructive cleanup operations via unreliable /proc path
lookups is unsafe and should be avoided so let's remove this function.

3 years agotest-copy: Stop using rm_rf_physical_and_close
Daan De Meyer [Fri, 11 Nov 2022 09:04:37 +0000 (10:04 +0100)] 
test-copy: Stop using rm_rf_physical_and_close

This cleanup function depends on resolving fd's to paths via /proc
which is unreliable so we shouldn't depend on it for destructive
operations. Use regular path based cleanup instead.

3 years agofs-util: Add missing assert to chmod_and_chown_at()
Daan De Meyer [Fri, 11 Nov 2022 08:59:25 +0000 (09:59 +0100)] 
fs-util: Add missing assert to chmod_and_chown_at()

3 years agochase-symlinks: Drop unnecessary if
Daan De Meyer [Fri, 11 Nov 2022 08:52:12 +0000 (09:52 +0100)] 
chase-symlinks: Drop unnecessary if

3 years agopath-util: Drop path_make_relative_cwd()
Daan De Meyer [Fri, 11 Nov 2022 08:50:50 +0000 (09:50 +0100)] 
path-util: Drop path_make_relative_cwd()

Function is unused

3 years agotmpfile-util: Add missing assert
Daan De Meyer [Fri, 11 Nov 2022 08:50:19 +0000 (09:50 +0100)] 
tmpfile-util: Add missing assert