Commit graph

66627 commits

Author SHA1 Message Date
Lennart Poettering f24e1b54e1 update TODO 2023-08-10 10:07:00 +02:00
Lennart Poettering a74c99807f
Merge pull request #28736 from poettering/polkit-tweaks
some minor polkit handling tweaks
2023-08-10 09:35:52 +02:00
Yu Watanabe 7e1850e54b
Merge pull request #28732 from yuwata/udev-vs-tmpfiles-take-2
Udev vs tmpfiles take 2
2023-08-10 08:48:51 +09:00
Yu Watanabe b8e483aa2c
Merge pull request #28741 from keszybz/minor-tweaks-for-recent-patches
Minor tweaks for recent patches
2023-08-10 08:45:44 +09:00
Yu Watanabe 7a05926fbe udev: re-introduce symlinks for loopback block device
But the directories are changed from /dev/loop/by-ref/ -> /dev/disk/by-loop-ref/
and /dev/loop/by-inode/ -> /dev/disk/by-loop-inode/.
As /dev/loop/ is used by losetup command for other purpose.
See issue #28475.

This effectively reverts commits 9915cc6086,
5022fab15f, and
c0d998248e.
2023-08-10 07:05:47 +09:00
Luca Boccassi 4051fc1d54
Merge pull request #28734 from loongarch64/dev-wu-main
seccomp: add LoongArch 64bit support
2023-08-09 20:20:03 +01:00
Daan De Meyer 1f035c91bb mkosi: Update to latest
This update introduces the explicit Dependencies= setting, instead
of relying on implicit dependencies via alphanumerical ordering.

We also take the opportunity to rename the "final" preset to the
"system" preset, which seems like a better name.
2023-08-09 18:56:51 +02:00
Lennart Poettering d1e8e8b5ae tree-wide: drop _pure_ + _const_ from local, static functions
This is supposed to be a help for compilers to apply optimizations on
functions where they can't determine whether they are const/pure on
their own. For static, local functions the compiler can do this on its
own easily however, hence the decoration with pure/const is just noise.
Let's drop it, and let the compiler to its thing better.

(Use it for exported functions, since compilers can't 'reach-over' into
other modules to determine if they are pure, except if LTO is used)
2023-08-10 00:01:04 +08:00
Mike Yuan 07ba0bf7f5
Merge pull request #28728 from yuwata/fstab-no
gpt-auto, remount-fs: parse fstab= kernel command line option
2023-08-09 23:59:51 +08:00
Lennart Poettering d2a1673713 sysusers: move global variables into a Context object
Our coding style says static variables suck except for very special
cases, i.e. things like the log level or very per-process stuff, such as
parsed version of cmdline args and such. sysusers departed from that as
one of the very few exceptions in our codebases: it keeps its
operational state in global variables.

Address that. Introduce a Context object that carries the fields that so
far have been global, and pass it around as needed.

This has the nice effect that state and configuration is clearly
separated in code, and we can very clearly see which functions mangle
state and which ones do not.

No actual codeflow changes, just refactoring.
2023-08-09 17:34:00 +02:00
Lennart Poettering 7a23cc4b66
Merge pull request #28720 from poettering/vconsole-setup-tweaks
vconsole-setup: trivial modernizations
2023-08-09 17:32:12 +02:00
Xiaotian Wu f106a63952 LoongArch: Replace __loongarch64 with __loongarch_lp64
`__loongarch64` is no longer used for historical reasons and should be replaced by `__loongarch_lp64` in new code.

https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html#_cc_preprocessor_built_in_macro_definitions
2023-08-09 20:44:57 +08:00
Lennart Poettering 0de0ed6e89 bootctl: don't advertise systemd-efi-options in --help/man anymore
The command is deprecated, as per NEWS of 254. Let's go one step further
and remove it from the help text and man page, so that people are not
inspired to use it at this time anymore.

This is how we usually have done this before: remove it from visibility,
but support it for a while still.
2023-08-09 14:25:46 +02:00
Zbigniew Jędrzejewski-Szmek 288cc26803 60-ukify.install: fix whitespace 2023-08-09 13:56:07 +02:00
Zbigniew Jędrzejewski-Szmek 4d8c16b166 test: use pytest.raises wrapper
This way we check that the appropriate exception is raised,
not just ignore it.

Follow-up for e3c04a5c84.
2023-08-09 13:56:07 +02:00
Lennart Poettering c1b2e1a89a polkit: move asserts up, so that they cover all reply codepaths 2023-08-09 11:02:51 +02:00
Lennart Poettering 0a901c71f5 polkit: use LIST_POP where appropriate 2023-08-09 11:02:51 +02:00
Yu Watanabe a38de31c8b remount-fs: refuse to remount based on fstab when fstab=no kernel command line option specified
Otherwise, if for some reasons remount-fs is invoked even when fstab=no is
specified, mounts may get unexpected options from fstab.

For safety, let's parse the kernel command line option.
2023-08-09 17:59:41 +09:00
Yu Watanabe 1be6f21320 remount-fs: split-out remount_by_fstab()
No functional change, just refactoring and preparation for later
commits.
2023-08-09 17:59:41 +09:00
Yu Watanabe b564224b37 fstab-generator: update cache in fstab_enabled_full() based on the parsed result of fstab=
Currently, fstab-generator does not use fstab file parsers in
fstab-util.c. So, this is not necessary. Just for a possible
optimization in the case the parsers used in the future.
2023-08-09 17:57:43 +09:00
Yu Watanabe 1177373b6a fstab-util: introduce fstab_enabled() helper function
And refuse to parse fstab when 'fstab=no' is specified in the kernel
command line.

When 'fstab=no' is specified in the kernel command line, fstab-generator
does not parse fstab and will not create e.g. /boot or /efi mount entry
even if fstab contains entries for the mount points. However, gpt-auto
generator may parse fstab file, and adjust or ignore mounts for EFI or
XBOOTLDR partitions based on the fstab file.

This makes gpt-auto also ignore fstab entries if 'fstab=no' is set in
the kernel command line.
2023-08-09 17:53:46 +09:00
Yu Watanabe 3787934b54 proc-cmdline: make proc_cmdline_get_bool() take flags
All other command line parsers takes flags. Let's make
proc_cmdline_get_bool() also take flags. Though, currently,
no flag is set by the caller.
2023-08-09 17:46:41 +09:00
Lennart Poettering 6433f1f6a2 vconsole-setup: simplify error handling
no need to negate an error which we don't need negated.

also, add debug log about errors we ignore.
2023-08-09 10:31:31 +02:00
Lennart Poettering 7b218ef930 vconsole-setup: simplify path allocation
Let's code this straighforwadly, and just allocate the string as we need
it, instead of doing pre-allocation.

This is not performance sensitive, as this will almost certainly just
return /dev/tty1 after the first transition.
2023-08-09 10:31:31 +02:00
Lennart Poettering bc6059844d vconsole-setup: use FOREACH_ARRAY() at one more place 2023-08-09 10:31:31 +02:00
Lennart Poettering 7686f3f16c vconsole-setup: port to main-func.h boilerplate 2023-08-09 10:31:31 +02:00
Yu Watanabe 3178698bb5 test: also check the ordering between udevd and tmpfiles-setup 2023-08-09 15:52:42 +09:00
Yu Watanabe ca15b59f1f Revert "Revert "tmpfiles.d: adjust /dev/vfio/vfio access mode""
This reverts commit 33b91308c2.

The commit b42482af90 dropped
'--exclude-prefix=/dev' from systemd-tmpfiles-setup.service. So, the
possibly later invocation of the service changes the permission set by
udevd.

As commmented in the head of this file, settings should be consistent
with udev rules. Only missing entry here is vfio. Let's re-add the
entry for the device.

Addresses https://github.com/systemd/systemd/pull/28681#issuecomment-1666949888.
2023-08-09 11:27:39 +09:00
Yu Watanabe 685e0dd192 veritysetup-generator: fix ordering of generated units
Fixes a bug introduced by 08b04ec7e7 and
953006dcb0.

Fixes #28725.
2023-08-09 11:26:09 +09:00
Yu Watanabe 20e7b94b72
Merge pull request #28731 from yuwata/sd-dhcp-server-cleanups
sd-dhcp-server: cleanups
2023-08-09 11:25:44 +09:00
Xiaotian Wu f9d3fb6b5e seccomp: add LoongArch 64bit support 2023-08-09 08:50:07 +08:00
Luca Boccassi bcb299e461
Merge pull request #28727 from yuwata/proc-cmdline-cleanups
tree-wide: fixlet and optimization for parsing kernel command line
2023-08-09 01:18:13 +01:00
Yu Watanabe 112a41b6ec unit: make udev rules really take precedence over tmpfiles
Follow-up for b42482af90.

The commit makes systemd-tmpfiles-setup.service also updates the
permission or owner of device nodes. However, the service does not have
ordering for systemd-udevd.service. So, the service may set different
permission from the one udevd already set.

Fixes #28653.
Replaces #28681.
2023-08-09 07:24:02 +09:00
Yu Watanabe 41521e3a21 Revert "unit: make udev rules take precesence over tmpfiles"
This reverts commit 31845ef554.

systemd-tmpfiles-setup-dev.service has Before=systemd-udevd.service.
So the commit does not change anything.
2023-08-09 07:13:09 +09:00
Yu Watanabe 9289e093ae meson: use install_emptydir() and drop meson-make-symlink.sh
The script is mostly equivalent to 'mkdir -p' and 'ln -sfr'.
Let's replace it with install_emptydir() builtin function and
inline meson call.
2023-08-08 22:11:34 +01:00
Yu Watanabe 809da721f0 sd-dhcp-server: propagate error on parsing DHCP packet
Otherwise, we silently ignore the received packet and that makes hard to
debug issue.
2023-08-09 05:33:24 +09:00
Yu Watanabe 7b1fac1e52 dhcp: rename function argument 2023-08-09 05:26:18 +09:00
mordner 653c90ec0e man: fix typo in journalctl 2023-08-08 22:05:10 +02:00
Fabian Vogt 327cd2d3db units/initrd-parse-etc.service: Conflict with emergency.target
If emergency.target is started while initrd-parse-etc.service/start is queued,
the initrd-parse-etc job did not get canceled. In parallel to the emergency
units, it eventually runs the service, which starts initrd-cleanup.service,
which in turn isolates initrd-switch-root.target. This stops the emergency
units and effectively starts the initrd boot process again, which likely
fails again like the initial attempt. The system is thus stuck in an endless
loop, never really reaching emergency.target.

With this conflict added, starting emergency.target automatically cancels
initrd-parse-etc.service/start, avoiding the loop.
2023-08-08 20:24:39 +01:00
Dan Streetman 60696b22d9 openssl: add log_openssl_errors()
Add a macro to log all errors in the openssl 'thread error queue'.

This consolidates all the openssl-generated errors to return -EIO and log at
debug level.

Also add a 'invalid' test in test-openssl, to allow manual verification that
the openssl error(s) are logged.
2023-08-08 19:40:37 +01:00
Jan Kuparinen 6eb151e989 po: Translated using Weblate (Finnish)
Currently translated at 86.3% (196 of 227 strings)

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fi/
Translation: systemd/main
2023-08-09 03:22:54 +09:00
Yu Watanabe a8d3315ba4 tree-wise: drop unnecessary use of proc_cmdline_key_streq()
If the key does not contain '-' or '_', then it is not necessary to use
proc_cmdline_key_streq(), and streq() is sufficient.

This also adds missing assertions about 'key' argument.
2023-08-09 03:16:31 +09:00
Yu Watanabe 91acee9906 resolve: ignore nameserver= and domain= kernel command line options without value
Otherwise, manager_parse_dns_server_string_and_warn() or
manager_parse_search_domains_and_warn() will trigger assertion.
2023-08-09 03:16:03 +09:00
Lennart Poettering 5a96b32dea libfido2: pick up debug logging from libfido2, and funnel it through our log subsystem
Fixes: #27984
2023-08-08 15:41:43 +02:00
Luca Boccassi 5c240bdd50
Merge pull request #28710 from rpigott/zsh-non-template-cache
zsh completion speedups
2023-08-08 12:06:40 +01:00
Yu Watanabe 074d90926f udev: set ID_NAME and ID_SERIAL to MMC/memstick devices again
Fixes a bug introduced by 998db5871f.

Fixes #28671.
2023-08-08 12:05:30 +01:00
Ronan Pigott 2cbda74862 zsh: reintroduce pattern argument to uncached verbs
The systemctl completion previously made use of PREFIX as a pattern
argument to list-unit-files and list-units. This had the problem of
erroneously filtering the results that were stored in the cache, and
erroneously filtering results that might have been requested according
to the users configuration (e.g. _correct completer, certain
matcher-lists or tag-orders, etc.).

Unfortunately, the runtime of list-unit-files increases when no pattern
argument is provided, and systemctl show, used to filter those units,
can become unacceptably slow when provided with too many units to
describe.

Let's re-introduce the pattern argument to list-unit-files and
list-units where necessary in order to alleviate these bottlenecks
without poisining the cache. A 'use-pattern' style is introduced that
may be used to disable this behavior if it is undesired. We can still
expect that certain completions, like `systemctl start <TAB>` will be
slow, like before. To fix this we will need systemd to learn a more
efficient way of filtering the units than parsing systemctl show.
2023-08-08 01:57:45 -07:00
Yu Watanabe beddf8ba29 busctl: fix showing array of dictionary in JSON format
This partially reverts the commit 684bce3d54
and fixes the issue introduced by it.

Fixes #28711.
2023-08-08 09:33:16 +01:00
Ronan Pigott c8e2cd79c1 zsh: use sys_really_all_units for non-template names
The systemctl invocations used for these completions match the ones used
for the _sys_really_all_units parameter, so we should really just use
the cached parameter rather than recomputing the result.
2023-08-07 18:00:04 -07:00
Lennart Poettering ab9617a766 shutdown: handle gracefully if MD_LEVEL udev propery is not set
See: #28490
2023-08-07 20:59:44 +01:00