]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotest: do an initial coverage capture
Frantisek Sumsal [Fri, 24 Mar 2023 20:15:28 +0000 (21:15 +0100)] 
test: do an initial coverage capture

I noticed that our coverage reports miss some files completely - this
happens when the test doesn't touch the code in them at all, so the
generated coverage data (and resulting reports) have no information
about them. Let's fix this by doing an initial zero coverage capture
that contains a zeroed counter for every instrumented line in every
file, so when we later merge it with a capture from the test, it shows up
with a missing coverage instead of not showing at all.

2 years agohwdb: Fix incorrect touchpad dimensions on Thinkpad L14 Gen1 (#26937)
taniishkaaa [Sat, 25 Mar 2023 10:41:07 +0000 (16:11 +0530)] 
hwdb: Fix incorrect touchpad dimensions on Thinkpad L14 Gen1 (#26937)

Closes #22793.

2 years agoMerge pull request #26960 from poettering/syscall-catchup
Yu Watanabe [Sat, 25 Mar 2023 04:39:27 +0000 (13:39 +0900)] 
Merge pull request #26960 from poettering/syscall-catchup

syscall filter group updates

2 years agoxdg-autostart-generator: do not warn about unknown fields
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 16:51:52 +0000 (17:51 +0100)] 
xdg-autostart-generator: do not warn about unknown fields

My user manager says:
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:256: Unknown key name 'Actions' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:258: Unknown section 'Desktop Action new-window'. Ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:343: Unknown section 'Desktop Action preferences'. Ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:12: Unknown key name 'Actions' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:13: Unknown key name 'SingleMainWindow' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:19: Unknown section 'Desktop Action Quit'. Ignoring.

This is not useful. Those are externally-provided files, and they are likely to
have entries which we know nothing about.

2 years agoMerge pull request #26977 from poettering/find-line-startswith
Yu Watanabe [Sat, 25 Mar 2023 04:38:24 +0000 (13:38 +0900)] 
Merge pull request #26977 from poettering/find-line-startswith

add new find_line_startswith() helper

2 years agobootctl: enable colored logging
Yu Watanabe [Fri, 24 Mar 2023 21:58:35 +0000 (06:58 +0900)] 
bootctl: enable colored logging

2 years agocore/main: fix setting of arguments for shutdown
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 13:11:48 +0000 (14:11 +0100)] 
core/main: fix setting of arguments for shutdown

Fixup for d2ebd50d7f9740dcf30e84efc75610af173967d2
and 6920049fad4fa39db5fec712f82f7f75b98fd4b9:
- add a comment that the last arg must be NULL and adjust the assert.
- move initialization around so that fields are declared,
  initialized, and consumed in the same order.
- move declaration of pos adjacent do declaration of command_line.
  This makes it easy to see that it was not initialized correctly.
- initialize buffers before writing the pointer into the args array.
  This makes no difference for the compiler, but it just feels "wrong"
  to do it in opposite order.

Because pos was off, we would ignore args after the timeout, and also
overwrite the buffer if enough args were used.

I think this is case shows clearly that declaring all variables at the
top of the function, with some initialized and other not, is very
error-prone. The compiler has no issue with declaring variables whereever,
and we should take advantage of this to make it keep declaration,
initialization, and use close. (Within reason of course.)

2 years agotools: add dump-auxv.py
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 13:54:34 +0000 (14:54 +0100)] 
tools: add dump-auxv.py

This is a little helper I used when preparing the tests for auxv
parsing. Just looking at hexdump output is pretty hard. We could
enhance it to display some specific data types better.

2 years agohwdb: drop boilerplate about match patterns in two more cases
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 16:25:59 +0000 (17:25 +0100)] 
hwdb: drop boilerplate about match patterns in two more cases

Follow-up for adbe000e3df5f91572bf4a77a2acd84ff5b87320.
Somehow I missed those two files.

2 years agoimport: use truncate_nl() where appropriate 26977/head
Lennart Poettering [Fri, 24 Mar 2023 17:27:03 +0000 (18:27 +0100)] 
import: use truncate_nl() where appropriate

2 years agotree-wide: port various places to find_line_startswith()
Lennart Poettering [Fri, 24 Mar 2023 17:25:13 +0000 (18:25 +0100)] 
tree-wide: port various places to find_line_startswith()

2 years agostring-util: add new helper for finding line starting with specific string in a text...
Lennart Poettering [Fri, 24 Mar 2023 17:02:32 +0000 (18:02 +0100)] 
string-util: add new helper for finding line starting with specific string in a text buffer

We have implemented this manually a couple of times, and always wrong.
Hence let's implement this correctly for once and use everywhere.

2 years agoMerge pull request #26920 from medhefgo/ukify
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 16:00:31 +0000 (17:00 +0100)] 
Merge pull request #26920 from medhefgo/ukify

ukify: Use pefile to add sections to EFI stub

2 years agoman: update syscal filter group list 26960/head
Lennart Poettering [Fri, 24 Mar 2023 13:52:34 +0000 (14:52 +0100)] 
man: update syscal filter group list

2 years agochase-symlinks: Rename chase_symlinks() to chase()
Daan De Meyer [Tue, 21 Mar 2023 20:17:22 +0000 (21:17 +0100)] 
chase-symlinks: Rename chase_symlinks() to chase()

Chasing symlinks is a core function that's used in a lot of places
so it deservers a less verbose names so let's rename it to chase()
and chaseat().

We also slightly change the pattern used for the chaseat() helpers
so we get chase_and_openat() and similar.

2 years agoMerge pull request #26785 from keszybz/udev-distcheck
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 12:38:54 +0000 (13:38 +0100)] 
Merge pull request #26785 from keszybz/udev-distcheck

Implement --help/--version in all udev builtins

2 years agoukify: Add riscv32 and loongarch support 26920/head
Jan Janssen [Tue, 21 Mar 2023 16:10:19 +0000 (17:10 +0100)] 
ukify: Add riscv32 and loongarch support

2 years agoukify: Use pefile to add sections to EFI stub
Jan Janssen [Tue, 21 Mar 2023 16:07:06 +0000 (17:07 +0100)] 
ukify: Use pefile to add sections to EFI stub

2 years agoanalyze: don't claim "@known" was an unlisted syscall
Lennart Poettering [Fri, 24 Mar 2023 10:35:55 +0000 (11:35 +0100)] 
analyze: don't claim "@known" was an unlisted syscall

It's a sycall group of our own definition, and the output is erroneous
to claim otherwise. Let's hide it.

This adds syscall_set_add() which is nicely symmetric to the existing
syscall_set_remove().

Follow-up for: 6d6a08547c03f96dc798cda1ef4a8d3013d292d5

2 years agoseccomp-util: enforce group ordering
Lennart Poettering [Fri, 24 Mar 2023 10:17:08 +0000 (11:17 +0100)] 
seccomp-util: enforce group ordering

So far we asked via a comment that @default should stay the first group
and @known the last group in the list. Let's enforce that statically, in
code, too.

2 years agoseccomp-util: add some newer syscalls to existing groups
Lennart Poettering [Fri, 24 Mar 2023 10:16:38 +0000 (11:16 +0100)] 
seccomp-util: add some newer syscalls to existing groups

These three new syscalls are mostly just new flavours or extensions of
existing syscalls, hence add them to the same groups.

2 years agoseccomp-util: add new @sandbox syscall group with landlock/seccomp
Lennart Poettering [Fri, 24 Mar 2023 10:15:21 +0000 (11:15 +0100)] 
seccomp-util: add new @sandbox syscall group with landlock/seccomp

Let's group these 4 syscalls, as they offer similar things and I guess
might be used in conjunction quite often, as they offer unprivileged
sandboxing.

Fixes: #26913
2 years agotest: add a couple of tests for systemd-coredump
Frantisek Sumsal [Tue, 21 Mar 2023 22:19:41 +0000 (23:19 +0100)] 
test: add a couple of tests for systemd-coredump

2 years agoMerge pull request #26958 from yuwata/nulstr-optionally-drop-trailing-nulstr
Daan De Meyer [Fri, 24 Mar 2023 10:33:58 +0000 (11:33 +0100)] 
Merge pull request #26958 from yuwata/nulstr-optionally-drop-trailing-nulstr

nulstr: make strv_parse_nulstr() optionally drop trailing NULs

2 years agoMerge pull request #26957 from yuwata/proc-cmdline-cleanups
Daan De Meyer [Fri, 24 Mar 2023 10:29:54 +0000 (11:29 +0100)] 
Merge pull request #26957 from yuwata/proc-cmdline-cleanups

proc-cmdline: several cleanups

2 years agoMerge pull request #26948 from yuwata/vconsole-fix-memleak
Daan De Meyer [Fri, 24 Mar 2023 10:28:00 +0000 (11:28 +0100)] 
Merge pull request #26948 from yuwata/vconsole-fix-memleak

vconsole: introduce Context and its helper functions

2 years agoMerge pull request #26956 from yuwata/core-main-arguments-followed-by-equal
Daan De Meyer [Fri, 24 Mar 2023 10:27:45 +0000 (11:27 +0100)] 
Merge pull request #26956 from yuwata/core-main-arguments-followed-by-equal

core/main: make arguments followed by '='

2 years agoprocess-util: drop trailing NUls before parsing the nulstr 26958/head
Yu Watanabe [Thu, 23 Mar 2023 02:59:44 +0000 (11:59 +0900)] 
process-util: drop trailing NUls before parsing the nulstr

No functional changes, just refactoring.

2 years agotest: add tests from strv_parse_nulstr_full()
Yu Watanabe [Thu, 23 Mar 2023 03:40:03 +0000 (12:40 +0900)] 
test: add tests from strv_parse_nulstr_full()

2 years agonulstr-util: introduce strv_parse_nulstr_full() that optionally drop trailing empty...
Yu Watanabe [Thu, 23 Mar 2023 03:39:36 +0000 (12:39 +0900)] 
nulstr-util: introduce strv_parse_nulstr_full() that optionally drop trailing empty strings

2 years agotest-proc-cmdline: test proc_cmdline_get_key() actually parses EFI options 26957/head
Yu Watanabe [Wed, 22 Mar 2023 20:52:32 +0000 (05:52 +0900)] 
test-proc-cmdline: test proc_cmdline_get_key() actually parses EFI options

Follow-up for 53aa0d02add93d8c0afa2772609372a2040c162a.

2 years agoproc-cmdline: make proc_cmdline_parse_given() static
Yu Watanabe [Wed, 22 Mar 2023 19:55:59 +0000 (04:55 +0900)] 
proc-cmdline: make proc_cmdline_parse_given() static

It is used only in proc-cmdline.c and its test. And the test can be
covered by proc_cmdline_parse().

2 years agoproc-cmdline: use proc_cmdline_key_string() when we search for key
Yu Watanabe [Wed, 22 Mar 2023 18:06:16 +0000 (03:06 +0900)] 
proc-cmdline: use proc_cmdline_key_string() when we search for key

2 years agoproc-cmdline: rename variable
Yu Watanabe [Wed, 22 Mar 2023 19:32:23 +0000 (04:32 +0900)] 
proc-cmdline: rename variable

2 years agoproc-cmdline: insert an empty line between variable declaration and assertion
Yu Watanabe [Thu, 23 Mar 2023 00:21:28 +0000 (09:21 +0900)] 
proc-cmdline: insert an empty line between variable declaration and assertion

2 years agocore/main: make positional arguments followed by '=', then by value 26956/head
Yu Watanabe [Thu, 23 Mar 2023 05:10:30 +0000 (14:10 +0900)] 
core/main: make positional arguments followed by '=', then by value

To make ConditionKernelCommandLine= or friend not confused when we are
running in a container.

Addresses https://github.com/systemd/systemd/pull/26887#discussion_r1143358884.

2 years agocore/main: fix maximum number of arguments for shutdown command
Yu Watanabe [Mon, 20 Mar 2023 23:02:16 +0000 (08:02 +0900)] 
core/main: fix maximum number of arguments for shutdown command

Follow-up for c5673ed0de3bec38f68d8113d253842b47766e27.

2 years agovconsole: introduce context_get_config() helper function 26948/head
Yu Watanabe [Fri, 24 Mar 2023 05:54:15 +0000 (14:54 +0900)] 
vconsole: introduce context_get_config() helper function

And make keyboard_load_and_wait() and font_load_and_wait() take Context.

2 years agovconsole: introduce Context and its helper functions
Yu Watanabe [Thu, 23 Mar 2023 13:30:30 +0000 (22:30 +0900)] 
vconsole: introduce Context and its helper functions

Fixes memleaks introduced by 01771226c202183ff447da712f43d2fad8874484
and ea575e176aac9fa8f430bb30a3e8abd8da767a10

Fixes #26945.

2 years agochase-symlinks: Use xopenat() instead of open_mkdir_at()
Daan De Meyer [Thu, 23 Mar 2023 19:05:16 +0000 (20:05 +0100)] 
chase-symlinks: Use xopenat() instead of open_mkdir_at()

We don't rely on any of the extra functionality of open_mkdir_at()
so let's just use xopenat() directly.

2 years agoMerge pull request #26935 from keszybz/test-parse_aux
Luca Boccassi [Thu, 23 Mar 2023 23:13:42 +0000 (23:13 +0000)] 
Merge pull request #26935 from keszybz/test-parse_aux

Add test for auxv parsing

2 years agoMerge pull request #26949 from DaanDeMeyer/xopenat-reopen
Luca Boccassi [Thu, 23 Mar 2023 23:08:21 +0000 (23:08 +0000)] 
Merge pull request #26949 from DaanDeMeyer/xopenat-reopen

loop-util: Add loop_device_make_by_path_at()

2 years agofileio: add new helper fdopen_independent()
Lennart Poettering [Thu, 23 Mar 2023 11:33:41 +0000 (12:33 +0100)] 
fileio: add new helper fdopen_independent()

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.

2 years agoMerge pull request #26953 from poettering/encrypted-cred-mini-refactor
Lennart Poettering [Thu, 23 Mar 2023 20:21:45 +0000 (21:21 +0100)] 
Merge pull request #26953 from poettering/encrypted-cred-mini-refactor

core: minor refactoring of allowlisting TPM devices when encrypted creds are loaded

2 years agopid1: allowlist all tpm devices for a unit when encrypted creds are needed 26953/head
Lennart Poettering [Thu, 23 Mar 2023 17:22:43 +0000 (18:22 +0100)] 
pid1: allowlist all tpm devices for a unit when encrypted creds are needed

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.

2 years agocore: move encrypted credential check to execute.c
Lennart Poettering [Thu, 23 Mar 2023 12:58:34 +0000 (13:58 +0100)] 
core: move encrypted credential check to execute.c

This is an operation on an ExecContext, hence it probably should be
placed there.

2 years agotest-coredump-util: also test parse_auxv() with unaligned data 26935/head
Zbigniew Jędrzejewski-Szmek [Wed, 22 Mar 2023 13:06:31 +0000 (14:06 +0100)] 
test-coredump-util: also test parse_auxv() with unaligned data

2 years agotest-coredump-util: add tests for parse_aux()
Zbigniew Jędrzejewski-Szmek [Wed, 22 Mar 2023 12:42:40 +0000 (13:42 +0100)] 
test-coredump-util: add tests for parse_aux()

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.

2 years agocoredump: split out parse_auxv() to src/shared/
Zbigniew Jędrzejewski-Szmek [Wed, 22 Mar 2023 08:53:16 +0000 (09:53 +0100)] 
coredump: split out parse_auxv() to src/shared/

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

2 years agoloop-util: Add loop_device_make_by_path_at() 26949/head
Daan De Meyer [Thu, 23 Mar 2023 13:42:35 +0000 (14:42 +0100)] 
loop-util: Add loop_device_make_by_path_at()

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.

2 years agofs-util: Allow xopenat() to reopen existing file descriptors
Daan De Meyer [Thu, 23 Mar 2023 13:30:43 +0000 (14:30 +0100)] 
fs-util: Allow xopenat() to reopen existing file descriptors

2 years agoMerge pull request #26214 from YHNdnzj/sd-notify-change-notifyaccess
Mike Yuan [Thu, 23 Mar 2023 16:11:29 +0000 (00:11 +0800)] 
Merge pull request #26214 from YHNdnzj/sd-notify-change-notifyaccess

core: support overriding NOTIFYACCESS= through sd-notify during runtime

2 years agodocs: Explicitly tell developers to enable mkosi required meson options
Daan De Meyer [Thu, 23 Mar 2023 10:15:29 +0000 (11:15 +0100)] 
docs: Explicitly tell developers to enable mkosi required meson options

We need repart, bootctl, analyze and ukify for mkosi so let's make
sure those get built in the HACKING guide.

2 years agofind-esp: don't silently error bootctl install if presumed XBOOTLDR part is stx_dev_m...
наб [Fri, 3 Mar 2023 14:57:42 +0000 (15:57 +0100)] 
find-esp: don't silently error bootctl install if presumed XBOOTLDR part is 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)

2 years agotest-fileio: add test for return value of read_one_line_file()
Zbigniew Jędrzejewski-Szmek [Tue, 21 Mar 2023 08:32:12 +0000 (09:32 +0100)] 
test-fileio: add test for return value of read_one_line_file()

Prompted by https://github.com/systemd/systemd/pull/26904#pullrequestreview-1349890241.

2 years agoMerge pull request #26936 from DaanDeMeyer/xopenat-lock
Daan De Meyer [Thu, 23 Mar 2023 06:49:12 +0000 (07:49 +0100)] 
Merge pull request #26936 from DaanDeMeyer/xopenat-lock

fs-util: Add xopenat_lock()

2 years agoMerge pull request #26916 from DaanDeMeyer/log-context-ref
Daan De Meyer [Wed, 22 Mar 2023 21:07:45 +0000 (22:07 +0100)] 
Merge pull request #26916 from DaanDeMeyer/log-context-ref

log: Avoid pushing the same fields more than once on the log context

2 years agofs-util: Add xopenat_lock() 26936/head
Daan De Meyer [Wed, 22 Mar 2023 16:04:36 +0000 (17:04 +0100)] 
fs-util: Add xopenat_lock()

open/create a file/directory and lock it using the given lock type.

2 years agoedit-util: alloc correct amount of memory
Mike Yuan [Wed, 22 Mar 2023 12:15:19 +0000 (20:15 +0800)] 
edit-util: alloc correct amount of memory

2 years agocoredump: use unaligned_read_ne{32,64}() to parse auxv
Yu Watanabe [Tue, 21 Mar 2023 23:49:49 +0000 (08:49 +0900)] 
coredump: use unaligned_read_ne{32,64}() to parse auxv

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.

2 years agoukify: allow uncompressed kernel images for UNAME detection on aarch64 and riscv64...
Tobias Powalowski [Wed, 22 Mar 2023 12:24:57 +0000 (13:24 +0100)] 
ukify: allow uncompressed kernel images for UNAME detection on aarch64 and 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

2 years agocore: Settle log target if we're going to be closing all fds
Daan De Meyer [Mon, 20 Mar 2023 12:26:57 +0000 (13:26 +0100)] 
core: Settle log target if we're going to be closing all fds

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.

2 years agolabeler: add journal label also for sd-journal stuff
David Tardon [Wed, 22 Mar 2023 12:14:38 +0000 (13:14 +0100)] 
labeler: add journal label also for sd-journal stuff

2 years agotest: add tests for NOTIFYACCESS override through sd_notify 26214/head
Mike Yuan [Tue, 21 Mar 2023 19:40:52 +0000 (03:40 +0800)] 
test: add tests for NOTIFYACCESS override through sd_notify

2 years agostat-util: Add verify_regular_at()
Daan De Meyer [Tue, 14 Mar 2023 20:05:09 +0000 (21:05 +0100)] 
stat-util: Add verify_regular_at()

2 years agoMerge pull request #26829 from DaanDeMeyer/copy-at
Daan De Meyer [Wed, 22 Mar 2023 08:53:51 +0000 (09:53 +0100)] 
Merge pull request #26829 from DaanDeMeyer/copy-at

copy: Add more at() helpers

2 years agobootctl: 'graceful' should ignore EFI variable failures
Kevin P. Fleming [Tue, 21 Mar 2023 17:46:08 +0000 (13:46 -0400)] 
bootctl: 'graceful' should ignore EFI variable failures

Suppress errors when creating/writing EFI variables during 'bootctl update' if
'--graceful' mode is active (as the documentation indicates).

Closes #26773.

2 years agoMerge pull request #26928 from jamacku/update-shellcheck
Yu Watanabe [Wed, 22 Mar 2023 06:13:38 +0000 (15:13 +0900)] 
Merge pull request #26928 from jamacku/update-shellcheck

ci: trigger `differential-shellcheck` workflow on push

2 years agoci: limit permissions for `differential-shellcheck` 26928/head
Jan Macku [Wed, 22 Mar 2023 05:53:09 +0000 (06:53 +0100)] 
ci: limit permissions for `differential-shellcheck`

2 years agoci: trigger differential-shellcheck workflow on push
Jan Macku [Wed, 22 Mar 2023 05:48:08 +0000 (06:48 +0100)] 
ci: trigger differential-shellcheck workflow on push

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
2 years agocore: support overriding NOTIFYACCESS= through sd-notify during runtime
Mike Yuan [Thu, 26 Jan 2023 09:44:03 +0000 (17:44 +0800)] 
core: support overriding NOTIFYACCESS= through sd-notify during runtime

Closes #25963

2 years agocopy: Add more at() helpers 26829/head
Daan De Meyer [Tue, 14 Mar 2023 16:12:27 +0000 (17:12 +0100)] 
copy: Add more at() helpers

2 years agocopy: Move chattr arguments to full function signatures
Daan De Meyer [Tue, 14 Mar 2023 15:30:46 +0000 (16:30 +0100)] 
copy: Move chattr arguments to full function signatures

These are almost never used, so let's move them to the _full()
functions signatures.

2 years agoMerge pull request #26828 from DaanDeMeyer/tmpfile-at
Daan De Meyer [Tue, 21 Mar 2023 19:52:17 +0000 (20:52 +0100)] 
Merge pull request #26828 from DaanDeMeyer/tmpfile-at

tmpfile-util: Add open_tmpfile_linkable_at() and link_tmpfile_at()

2 years agofd-util: make sure fd_reopen() works with AT_FDCWD systematically
Lennart Poettering [Tue, 21 Mar 2023 13:34:44 +0000 (14:34 +0100)] 
fd-util: make sure fd_reopen() works with AT_FDCWD systematically

Prompted by:

https://github.com/systemd/systemd/pull/26827#pullrequestreview-1341171981

2 years agoMerge pull request #26866 from DaanDeMeyer/chase-fix
Daan De Meyer [Tue, 21 Mar 2023 19:50:48 +0000 (20:50 +0100)] 
Merge pull request #26866 from DaanDeMeyer/chase-fix

chase-symlinks: Add CHASE_FILENAME and more at() helpers

2 years agoexecute: Add kernel cmdline arguments for tty term, rows and columns
Daan De Meyer [Sun, 19 Mar 2023 10:24:01 +0000 (11:24 +0100)] 
execute: Add kernel cmdline arguments for tty term, rows and columns

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.

2 years agodocs: Fix vscode debugging section in HACKING.md
Daan De Meyer [Tue, 21 Mar 2023 15:06:15 +0000 (16:06 +0100)] 
docs: Fix vscode debugging section in HACKING.md

Let's account for the recent changes in mkosi in the debugging
with vscode section.

2 years agochase-symlinks: Add more chase_symlinks_at() helpers 26866/head
Daan De Meyer [Tue, 14 Mar 2023 13:03:28 +0000 (14:03 +0100)] 
chase-symlinks: Add more chase_symlinks_at() helpers

Copies of the corresponding chase_symlinks() helpers.

2 years agochase-symlinks: Return zero from access() and stat() helpers
Daan De Meyer [Fri, 17 Mar 2023 09:06:13 +0000 (10:06 +0100)] 
chase-symlinks: Return zero from access() and stat() helpers

We never check if r > 0 when using these helpers, so let's just
return zero like we usually do.

2 years agochase-symlinks: Add CHASE_EXTRACT_FILENAME flag
Daan De Meyer [Tue, 14 Mar 2023 17:37:55 +0000 (18:37 +0100)] 
chase-symlinks: Add CHASE_EXTRACT_FILENAME flag

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

2 years agoudev-rules: fix nvme symlink creation on namespace changes
Thomas Blume [Thu, 2 Mar 2023 11:06:13 +0000 (12:06 +0100)] 
udev-rules: fix nvme symlink creation on namespace changes

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.

2 years agotmpfile-util: Add open_tmpfile_linkable_at() and link_tmpfile_at() 26828/head
Daan De Meyer [Tue, 14 Mar 2023 16:12:06 +0000 (17:12 +0100)] 
tmpfile-util: Add open_tmpfile_linkable_at() and link_tmpfile_at()

2 years agofs-util: Add open_parent_at()
Daan De Meyer [Tue, 14 Mar 2023 16:10:48 +0000 (17:10 +0100)] 
fs-util: Add open_parent_at()

2 years agolock-util: Add make_lock_file_at()
Daan De Meyer [Thu, 9 Mar 2023 11:59:09 +0000 (12:59 +0100)] 
lock-util: Add make_lock_file_at()

2 years agounit: Add LOG_CONTEXT_PUSH_UNIT() 26916/head
Daan De Meyer [Tue, 21 Mar 2023 13:57:29 +0000 (14:57 +0100)] 
unit: Add LOG_CONTEXT_PUSH_UNIT()

A helper macro to push all unit related fields onto the log context.
We also modify exec_spawn() to use it.

2 years agolog: Add key/value support to the log context
Daan De Meyer [Tue, 21 Mar 2023 13:51:56 +0000 (14:51 +0100)] 
log: Add key/value support to the log context

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.

2 years agolog: Avoid pushing the same fields more than once on the log context
Daan De Meyer [Tue, 21 Mar 2023 13:06:21 +0000 (14:06 +0100)] 
log: Avoid pushing the same fields more than once on the log context

Let's try to optimize against pushing the same fields multiple times
onto the log context. To achieve this we make the log context reference
counted and return an existing context object if it's using the same
fields.

A consequence of this is that we have to make sure attaching/detaching
is coupled to the lifetime of the context object, so we make the attach
and detach functions private for now. If we need independent attach/detach
in the future, we can make that work with some extra complexity but since
we don't need it yet, let's not support it for now.

2 years agoMerge pull request #26893 from yuwata/uki-util-update-log
Yu Watanabe [Tue, 21 Mar 2023 10:06:18 +0000 (19:06 +0900)] 
Merge pull request #26893 from yuwata/uki-util-update-log

util: rename uki-util.[ch] -> kernel-image.[ch]

2 years agomkosi: Default to debug log level for udev as well
Daan De Meyer [Tue, 21 Mar 2023 09:01:09 +0000 (10:01 +0100)] 
mkosi: Default to debug log level for udev as well

Unlike CI, the debug output just goes to the journal, so there's no
harm in enabling it, even if it's noisy.

2 years agoman/network-generator: replace dracut.kernel reference with dracut.cmdline
Antonio Alvarez Feijoo [Tue, 21 Mar 2023 08:09:24 +0000 (09:09 +0100)] 
man/network-generator: replace dracut.kernel reference with dracut.cmdline

`dracut.kernel.7` is just a symlink to `dracut.cmdline.7`, so the web reference
points to a non-existent URL
(https://man7.org/linux/man-pages/man7/dracut.kernel.7.html).

2 years agogpt-auto-generator: fix typo
Antonio Alvarez Feijoo [Tue, 21 Mar 2023 08:43:15 +0000 (09:43 +0100)] 
gpt-auto-generator: fix typo

2 years agoMerge pull request #26867 from dtardon/list-dependencies-circular
Zbigniew Jędrzejewski-Szmek [Tue, 21 Mar 2023 08:40:46 +0000 (09:40 +0100)] 
Merge pull request #26867 from dtardon/list-dependencies-circular

Fix printing of circular dependencies

2 years agoutil: rename uki-util.[ch] -> kernel-image.[ch] 26893/head
Yu Watanabe [Tue, 21 Mar 2023 07:49:23 +0000 (16:49 +0900)] 
util: rename uki-util.[ch] -> kernel-image.[ch]

As the file contains functions not only for UKI.

2 years agouki-util: rename KernelType -> KernelImageType
Yu Watanabe [Tue, 21 Mar 2023 07:44:50 +0000 (16:44 +0900)] 
uki-util: rename KernelType -> KernelImageType

The name KernelType is slightly ambiguous. The type is about kernel
image. Let's rename the enum to clarify that.

2 years agouki-util: rename uki -> f
Yu Watanabe [Tue, 21 Mar 2023 07:40:36 +0000 (16:40 +0900)] 
uki-util: rename uki -> f

As the function is not only for UKI.

2 years agouki-util: update log messages
Yu Watanabe [Sun, 19 Mar 2023 15:01:40 +0000 (00:01 +0900)] 
uki-util: update log messages

2 years agoudev-rules: add another check for conflicting expressions
Dmitry V. Levin [Mon, 20 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: add another check for conflicting expressions

Log an error when a rule line contains the following kind of conflicting
match expressions:

  KEY=="foo", KEY=="bar"

2 years agocompare-operator: added unit tests
OMOJOLA JOSHUA DAMILOLA [Sun, 19 Mar 2023 16:11:15 +0000 (16:11 +0000)] 
compare-operator: added unit tests

2 years agoMerge pull request #26875 from yuwata/core-transaction
Yu Watanabe [Mon, 20 Mar 2023 15:42:30 +0000 (00:42 +0900)] 
Merge pull request #26875 from yuwata/core-transaction

core/transaction: several fixes for merge_unit_ids()