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
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
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>
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
Zbigniew Jędrzejewski-Szmek [Thu, 10 Nov 2022 14:12:33 +0000 (15:12 +0100)]
mkosi: drop spaces after shell redirection operator
Zbigniew Jędrzejewski-Szmek [Thu, 10 Nov 2022 14:10:08 +0000 (15:10 +0100)]
ci: use mkosi executable directly
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.
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 -
$
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.
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
Yu Watanabe [Sun, 13 Nov 2022 23:18:21 +0000 (08:18 +0900)]
Merge pull request #25373 from medhefgo/boot-fixes
boot: Small fixes
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.
Jan Janssen [Sun, 13 Nov 2022 15:14:17 +0000 (16:14 +0100)]
boot: Fix error message
Jan Janssen [Sat, 12 Nov 2022 15:24:53 +0000 (16:24 +0100)]
boot: Silence driver reconnect errors
Yu Watanabe [Sun, 13 Nov 2022 13:59:40 +0000 (22:59 +0900)]
Merge pull request #25338 from DaanDeMeyer/at-fixes
Followups for #24813
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
David Tardon [Fri, 11 Nov 2022 08:59:09 +0000 (09:59 +0100)]
localectl: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:57:10 +0000 (09:57 +0100)]
hostnamectl: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:53:10 +0000 (09:53 +0100)]
analyze-inspect-elf: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:42:52 +0000 (09:42 +0100)]
analyze-timespan: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:17:20 +0000 (09:17 +0100)]
analyze-timestamp: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:11:30 +0000 (09:11 +0100)]
analyze-calendar: port to vertical table
David Tardon [Fri, 11 Nov 2022 08:12:06 +0000 (09:12 +0100)]
analyze-calendar: avoid unnecessary abbreviation
Yu Watanabe [Sun, 13 Nov 2022 11:17:10 +0000 (20:17 +0900)]
Merge pull request #25360 from poettering/strv-fixes
nulstr fixes
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
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
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.
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.
Lennart Poettering [Fri, 11 Nov 2022 22:26:08 +0000 (23:26 +0100)]
tests: add tests for various corner cases of 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.
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
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.
Lennart Poettering [Fri, 11 Nov 2022 21:01:03 +0000 (22:01 +0100)]
nulstr-util: use _cleanup_strv_free_() where appropriate
Lennart Poettering [Fri, 11 Nov 2022 20:59:41 +0000 (21:59 +0100)]
nulstr-util: rebreak comments
Lennart Poettering [Fri, 11 Nov 2022 20:57:28 +0000 (21:57 +0100)]
nulstr-util: modernize strv_from_nulstr() a bit
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.
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
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).
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.
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.
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.
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
Luca Boccassi [Sat, 12 Nov 2022 01:04:19 +0000 (01:04 +0000)]
README: use https on one more link
Carlo Teubner [Fri, 11 Nov 2022 19:42:49 +0000 (19:42 +0000)]
man/systemd-dissect.xml: fix trivial error
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
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
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
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.
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).
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
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.
Lennart Poettering [Fri, 11 Nov 2022 16:47:21 +0000 (17:47 +0100)]
Daan De Meyer [Fri, 11 Nov 2022 11:08:26 +0000 (12:08 +0100)]
nulstr-util: Declare NULSTR_FOREACH() iterator inline
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.
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
Cristian Rodríguez [Fri, 11 Nov 2022 14:22:49 +0000 (11:22 -0300)]
resolve: Use only C99 flex arrays (#25335)
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
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.
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.
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.
Daan De Meyer [Fri, 11 Nov 2022 08:59:25 +0000 (09:59 +0100)]
fs-util: Add missing assert to chmod_and_chown_at()
Daan De Meyer [Fri, 11 Nov 2022 08:52:12 +0000 (09:52 +0100)]
chase-symlinks: Drop unnecessary if
Daan De Meyer [Fri, 11 Nov 2022 08:50:50 +0000 (09:50 +0100)]
path-util: Drop path_make_relative_cwd()
Function is unused
Daan De Meyer [Fri, 11 Nov 2022 08:50:19 +0000 (09:50 +0100)]
tmpfile-util: Add missing assert
Yu Watanabe [Fri, 11 Nov 2022 06:18:12 +0000 (15:18 +0900)]
Merge pull request #25328 from poettering/vertical-tables
format-table: add concept of "vertical" table
Luca Boccassi [Thu, 10 Nov 2022 22:20:40 +0000 (23:20 +0100)]
Merge pull request #25325 from yuwata/resolve-cap-per-link-setting-by-global
resolve: provide effective mDNS or LLMNR settings
Lennart Poettering [Thu, 10 Nov 2022 12:32:08 +0000 (13:32 +0100)]
timedatectl: port to new 'vertical' table type
Lennart Poettering [Thu, 10 Nov 2022 12:31:43 +0000 (13:31 +0100)]
resolvectl: port to new 'vertical' table type
Lennart Poettering [Thu, 10 Nov 2022 22:10:17 +0000 (23:10 +0100)]
Merge pull request #25261 from poettering/dissec-uuid
systemd-dissect: show image UUID in output
Lennart Poettering [Thu, 10 Nov 2022 12:30:02 +0000 (13:30 +0100)]
resolvectl: fail properly if we can't append to table
Lennart Poettering [Thu, 10 Nov 2022 11:52:08 +0000 (12:52 +0100)]
format-table: add an explicit "vertical" mode
Originally, the table formatting code was written to display a number of
records, one per line, and within each line multiple fields of the same
record. The first line contains the column names.
It was then started to be used in a "vertical" mode however,
i.e. with field names on the left instead of the top. Let's support such
a mode explicitly, so that we can provide systematic styling, and can
properly convert this mode to JSON.
A new constructor "table_new_vertical()" is added creating such
"vertical" tables. Internally, this is a table with two columns: "key"
and "value". When outputting this as JSON we'll output a single JSON
object, with key/value as fields. (Which is different from the
traditional output where we'd use the first line as JSON field names,
and output an array of objects).
A new cell type TABLE_FIELD is added for specifically marking the
"field" cells, i.e. the cells in the first column. We'll automatically
suffic ":" to these fields on output.
Yu Watanabe [Thu, 10 Nov 2022 16:17:57 +0000 (01:17 +0900)]
meson: install systemd-ac-power under /usr/bin
And test the its help message.
The program is useful for e.g. scripts that conditionalize their tasks
to be invoked only when running on AC power.
Lennart Poettering [Thu, 10 Nov 2022 21:19:22 +0000 (22:19 +0100)]
update TODO
Ricky Tigg [Thu, 10 Nov 2022 19:19:46 +0000 (20:19 +0100)]
po: Translated using Weblate (Finnish)
Currently translated at 100.0% (193 of 193 strings)
Co-authored-by: Ricky Tigg <ricky.tigg@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fi/
Translation: systemd/main
Lennart Poettering [Thu, 10 Nov 2022 16:33:31 +0000 (17:33 +0100)]
test: add quick test for ensuring image UUID is deterministic based on the seed passed to repart
Lennart Poettering [Thu, 10 Nov 2022 16:18:50 +0000 (17:18 +0100)]
locale: honour new env var $SYSTEMD_UTF8=
This is useful to force off fancy unicode glyph use (i.e. use "->"
instead of "→"), which is useful in tests where locales might be
missing, and thus control via $LC_CTYPE is not reliable.
Use this in TEST-58, to ensure the output checks we do aren't confused
by missing these glyphs being unicode or not.
Daan De Meyer [Wed, 9 Nov 2022 12:41:38 +0000 (13:41 +0100)]
repart: Add integration test for #24678
Daan De Meyer [Fri, 23 Sep 2022 19:15:01 +0000 (21:15 +0200)]
repart: Don't descend into directories assigned to other partitions
Let's say we have the following repart definitions files root.conf
and home.conf:
```
[Partition]
Type=root
CopyFiles=/
```
```
[Partition]
Type=home
CopyFiles=/home
```
Currently, we'd end up copying /home to both the root partition and
the home partition. To prevent this from happening, let's adopt a
new policy when copying files for a partition: We won't copy any
files/directories that appear in the CopyFiles= list of another
partition, unless that directory explicitly appears in our own
CopyFiles= list.
This way, we prevent copying /home twice into the root and home
partition, but should a user really want that behavior, they can
have it by adding /home to the CopyFIles= list of the root partition
as well.
Daan De Meyer [Tue, 27 Sep 2022 10:30:55 +0000 (12:30 +0200)]
gpt: Add gpt_partition_type_mountpoint_nulstr()
Daan De Meyer [Tue, 27 Sep 2022 10:20:20 +0000 (12:20 +0200)]
gpt: Replace bitfields with designator field in GptPartitionType
To achieve this we move the PartitionDesignator enum from
dissect-image.h to gpt.h
Daan De Meyer [Fri, 23 Sep 2022 19:07:41 +0000 (21:07 +0200)]
copy: Support passing a deny list of files/directories to not copy
Lennart Poettering [Wed, 9 Nov 2022 21:51:42 +0000 (22:51 +0100)]
dissect: make image name bold
Lennart Poettering [Thu, 20 Oct 2022 21:14:28 +0000 (23:14 +0200)]
dissect: also parse out the top-level GPT table uuid and expose this as image UUID
systemd-repart generates this in a suitably stable fashion, hence let's
actually use it as an identifier for the image. As a first step parse
it, and show it.
Lennart Poettering [Thu, 20 Oct 2022 21:08:45 +0000 (23:08 +0200)]
json: add build helpers to insert id128 in uuid formatting into json object
Lennart Poettering [Thu, 10 Nov 2022 14:59:58 +0000 (15:59 +0100)]
update TODO
Daan De Meyer [Fri, 23 Sep 2022 17:00:23 +0000 (19:00 +0200)]
stat-util: Move inode_hash_ops to stat-util
TO make it usable in other code.
Yu Watanabe [Thu, 10 Nov 2022 06:52:57 +0000 (15:52 +0900)]
test: add tests for mDNS and LLMNR settings
Yu Watanabe [Thu, 10 Nov 2022 06:51:30 +0000 (15:51 +0900)]
test: create config under /run
Yu Watanabe [Fri, 4 Nov 2022 04:11:55 +0000 (13:11 +0900)]
resolvectl: warn if the global mDNS or LLMNR support level is lower than the requested one
Yu Watanabe [Fri, 4 Nov 2022 03:53:07 +0000 (12:53 +0900)]
resolve: provide effective supporting levels of mDNS and LLMNR
The per-link settings are ignored if the feature is disabled by the global setting.
Let's announce the effective level, to make not users confused.
Closes #24863.
Yu Watanabe [Fri, 4 Nov 2022 03:53:07 +0000 (12:53 +0900)]
resolve: introduce link_get_llmnr_support() and link_get_mdns_support()
Yu Watanabe [Fri, 4 Nov 2022 03:53:07 +0000 (12:53 +0900)]
resolve: drop redundant call of socket_ipv6_is_supported()
As link_relevant() is called with AF_INET6, which returns true only when
the link has at least one relevant IPv6 address.
Cristian Rodríguez [Wed, 9 Nov 2022 23:56:46 +0000 (23:56 +0000)]
build: Use -fstrict-flex-arrays=1 if supported
Due to "historical reasons" both gcc and clang treat *all* trailing
arrays members as flexible arrays, this has an evil side effect
of inhibiting bounds checks on such members as __builtin_object_size
cannot say for sure that:
struct {
...
type foo[3];
}
has a trailing foo member of fixed size rather than unspecified.
Ideally we should use -fstrict-flex-arrays as is, but we have to
tolerate kernel uapi headers that use [0] and third party libraries
written in c89 that may use [1] like curl.
Yu Watanabe [Thu, 10 Nov 2022 07:21:28 +0000 (16:21 +0900)]
test-network: skip test_match if alternative name is not supported by kernel
Fixes #25259.
Luca Boccassi [Thu, 10 Nov 2022 09:57:14 +0000 (10:57 +0100)]
Merge pull request #24813 from DaanDeMeyer/at-all-the-things
Add more openat() style variants for existing stuff
Luca Boccassi [Thu, 10 Nov 2022 09:44:27 +0000 (10:44 +0100)]
Merge pull request #25315 from poettering/dissect-mtree
dissect: add new --mtree switch to generate BSD comaptible mtree manifests of DDIs
Frantisek Sumsal [Thu, 10 Nov 2022 08:22:15 +0000 (08:22 +0000)]
Merge pull request #25280 from keszybz/initrd-with-overlayfs
Initrd with overlayfs
Zbigniew Jędrzejewski-Szmek [Mon, 7 Nov 2022 11:40:20 +0000 (12:40 +0100)]
pid1: skip cleanup if root is not tmpfs/ramfs
in_initrd() was really doing two things: checking if we're in the initrd, and
also verifying that the initrd is set up correctly. But this second check is
complicated, in particular it would return false for overlayfs, even with an
upper tmpfs layer. It also doesn't support the use case of having an initial
initrd with tmpfs, and then transitioning into an intermediate initrd that is
e.g. a DDI, i.e. a filesystem possibly with verity arranged as a disk image.
We don't need to check if we're in initrd in every program. Instead, concerns
are separated:
- in_initrd() just does a simple check for /etc/initrd-release.
- When doing cleanup, pid1 checks if it's on a tmpfs before starting to wipe
the old root. The only case where we want to remove the old root is when
we're on a plain tempory filesystem. With an overlay, we'd be creating
whiteout files, which is not very useful. (*)
This should resolve https://bugzilla.redhat.com/show_bug.cgi?id=
2137631
which is caused by systemd refusing to treat the system as an initrd because
overlayfs is used.
(*) I think the idea of keeping the initrd fs around for shutdown is outdated.
We should just have a completely separate exitrd that is unpacked when we want
to shut down. This way, we don't waste memory at runtime, and we also don't
transition to a potentially older version of systemd. But we don't have support
for this yet.
This replaces
0fef5b0f0bd9ded1ae7bcb3e4e4b2893e36c51a6.
Zbigniew Jędrzejewski-Szmek [Tue, 8 Nov 2022 13:18:46 +0000 (14:18 +0100)]
test-fd-util: fix typos and use log_tests_skipped()
Lennart Poettering [Wed, 9 Nov 2022 11:31:36 +0000 (12:31 +0100)]
test: add trivial test for systemd-dissect --mtree