| Commit message (Collapse) | Author | Files | Lines |
|
No functional changes, just refactoring.
|
|
|
|
trailing empty strings
|
|
Follow-up for 53aa0d02add93d8c0afa2772609372a2040c162a.
|
|
It is used only in proc-cmdline.c and its test. And the test can be
covered by proc_cmdline_parse().
|
|
|
|
|
|
|
|
To make ConditionKernelCommandLine= or friend not confused when we are
running in a container.
Addresses https://github.com/systemd/systemd/pull/26887#discussion_r1143358884.
|
|
Follow-up for c5673ed0de3bec38f68d8113d253842b47766e27.
|
|
And make keyboard_load_and_wait() and font_load_and_wait() take Context.
|
|
Fixes memleaks introduced by 01771226c202183ff447da712f43d2fad8874484
and ea575e176aac9fa8f430bb30a3e8abd8da767a10
Fixes #26945.
|
|
We don't rely on any of the extra functionality of open_mkdir_at()
so let's just use xopenat() directly.
|
|
This is a combination of fdopen() and fd_reopen(). i.e. it first reopens
the fd, and then converts that into a FILE*.
We do this at various places already manually. let's move this into a
helper call of its own.
|
|
We might be configured to use some ther device than /dev/tpmrm0, hence
allow them all by allowlisting the tpm char device class as a whole.
|
|
This is an operation on an ExecContext, hence it probably should be
placed there.
|
|
|
|
The test files are /proc//auxv files copies from various architecutres
signified by the file name suffix.
Those tests are fairly simple, but when we run them on n architectures, we do
~n² cross-arch tests.
|
|
No functional change. (We already checked for ELFCLASS32 or ELFCLASS64 before,
so even though there's a new check for other architectures, the only caller
only passes ELFCLASS32 or ELFCLASS64.)
|
|
On top of taking a directory file descriptor, we use xopenat() so
that the function can also be used to work on existing file
descriptors to image files including all the logic to use O_DIRECT
and fallback to O_RDONLY if needed.
|
|
|
|
We need repart, bootctl, analyze and ukify for mkosi so let's make
sure those get built in the HACKING guide.
|
|
stx_dev_major=0 but not btrfs
btrfs_get_block_device_fd() returns -ENOTTY if fstatfs().f_type !=
BTRFS_SUPER_MAGIC
btrfs_get_block_device_fd() is run by verify_fsroot_dir() by
verify_xbootldr() by find_xbootldr_and_warn() if
statx($presumed-XBOOTLDR).stx_dev_major == 0 ("maybe a btrfs device")
Every bootctl verb_install() runs find_xbootldr_and_warn(), by default
with /boot
If your /boot .stx_dev_major=0 but /not/ btrfs, bootctl install/update
quietly exits 1 with no note so as to what exactly failed (debug also
empty, and the strace isn't exactly clear since no syscall actually
failed)
This is the case on ZFS and the Debian filesystem layout: /boot/efi is
the ESP, and everything else under / is ZFS:
$ sudo env SYSTEMD_LOG_LEVEL=debug bootctl update
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
Found container virtualization none.
File system "/boot" is not a FAT EFI System Partition (ESP) file system.
Using EFI System Partition at /boot/efi.
Checking whether /boot/efi/EFI/systemd/ contains any files…
$ echo $?
1
and funnier still:
$ sudo bootctl update --graceful
$ echo $?
1
Which is great, and also breaks postinst, which runs precisely the
latter, with no feedback at all
By checking for -ENOTTY we accept that the path being investigated
"is not it" if it's on ZFS (and any other filesystem that returns
.stx_dev_major == 0 but isn't btrfs)
|
|
Prompted by https://github.com/systemd/systemd/pull/26904#pullrequestreview-1349890241.
|
|
open/create a file/directory and lock it using the given lock type.
|
|
|
|
Fixes a bug introduced by 3e4d0f6cf99f8677edd6a237382a65bfe758de03.
The auxv metadata is unaligned, as the length of the prefix
"COREDUMP_PROC_AUXV=" is 19. Hence, parse_auxv{32,64}() may triger
an undefined behavior (or at least cause slow down), which can be
detected when running on an undefined behavior sanitizer.
This also introduces a macro to define `parse_auxv{32,64}()`.
Fixes #26912.
|
|
riscv64 (#26929)
Uncompressed aarch64 and riscv64 kernels have a different startpoint than x86.
Example output from ukify:
aarch64: NotImplementedError: unknown file format (starts with b'MZ@\xfa')
riscv64: NotImplementedError: unknown file format (starts with b'MZo\x10')
Add check for (b'MZ') to catch both in one call.
Fix:
https://github.com/systemd/systemd/issues/26923
|
|
Whenever we're going to close all file descriptors, we tend to close
the log and set it into open when needed mode. When this is done with
the logging target set to LOG_TARGET_AUTO, we run into issues because
for every logging call, we'll check if stderr is connected to the
journal to determine where to send the logging message. This check
obviously stops working when we close stderr, so we settle the log
target before we do that so that we keep using the same logging
target even after stderr is closed.
|
|
|
|
|
|
|
|
Suppress errors when creating/writing EFI variables during 'bootctl update' if
'--graceful' mode is active (as the documentation indicates).
Closes #26773.
|
|
|
|
Also update `differential-shellcheck` to latest version - https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases
Fixes: https://github.com/redhat-plumbers-in-action/differential-shellcheck/issues/215
|
|
Closes #25963
|
|
|
|
These are almost never used, so let's move them to the _full()
functions signatures.
|
|
Prompted by:
https://github.com/systemd/systemd/pull/26827#pullrequestreview-1341171981
|
|
Let's allow configuring tty term and size using kernel cmdline arguments
so that when running in a VM we can communicate the terminal TERM and size
from the host via SMBIOS extra kernel cmdline arguments.
|
|
Let's account for the recent changes in mkosi in the debugging
with vscode section.
|
|
Copies of the corresponding chase_symlinks() helpers.
|
|
We never check if r > 0 when using these helpers, so let's just
return zero like we usually do.
|
|
Useful in combination with CHASE_PARENT to get a directory file
descriptor to the parent directory of the resolved path and the
filename of the resolved path in the parent directory (which might
not be the same as the filename of the input path because of symlinks).
|
|
The nvme by-id symlink changes to the latest namespace when a new namespace gets
added, for example by connecting multiple NVMe/TCP host controllers via nvme
connect-all.
That is incorrect for persistent device links.
The persistent symbolic device link should continue to point to the same NVMe
namespace throughout the lifetime of the current boot.
Therefore the namespace id needs to be added to the link name.
|
|
|
|
|
|
|
|
A helper macro to push all unit related fields onto the log context.
We also modify exec_spawn() to use it.
|
|
Now that we have reference counting, it's useful to be able to push
single key values onto the log context separately, so that we don't
have to allocate new storage to join the separate string together into
a single field which means we won't be able to reuse a context containing
the same field.
|