Commit Graph
83692 Commits
Author SHA1 Message Date
Yu Watanabe 9a8f2b628d chattr-util/acl-util: add helpers that tells us if an inode type can do chattr/acl (#39003)
Split out of #38728 but I think this makes things more readable in
general and makes sense on its own.
2025-09-19 15:50:18 +09:00
Yu Watanabe 8835034df8 importd: some minor tweaks (#39008) 2025-09-19 15:48:14 +09:00
Lennart Poettering 625c2e10c6 importd: port to PidRef 2025-09-19 15:45:46 +09:00
Lennart Poettering 93dea63fab fileio: modernize xopendirat() a bit 2025-09-19 08:39:32 +02:00
ners 7b7f0983e0 localectl: use XKB path specified from environment variable 2025-09-19 15:37:52 +09:00
Mike Yuan b6c8f0ec91 userdb: suppress creation of empty userdb dirs 2025-09-18 22:58:16 +02:00
Luca Boccassi defa0148b8 units: add missing Documentation=
The initrd units are described in the graphs in the bootup manpage,
so use that one for them.
2025-09-18 21:54:36 +01:00
Lennart Poettering c3b1aa6d73 acl-util: add new inode_type_can_acl() helper 2025-09-18 21:58:44 +02:00
Lennart Poettering 134749c1d0 chattr-util: add inode_type_can_chattr() helper 2025-09-18 21:58:00 +02:00
Lennart Poettering 74c10cfbeb sd-varlink: two small additions (#38994) 2025-09-18 21:34:09 +02:00
Lennart Poettering 86fd19af14 mountfsd: add recognizable error if we pass an fd with unexpected flags 2025-09-18 21:33:41 +02:00
Nick Rosbrook 9fe168a92c basic: validate timezones in get_timezones()
Depending on the packaging of tzdata, /usr/share/zoneinfo/tzdata.zi may
reference zones or links that are not actually present on the system.
E.g. on Debian and Ubuntu, there is a tzdata-legacy package that
contains "legacy" zones and links, but they are still referenced in
/usr/share/zoneinfo/tzdata.zi shipped by the main tzdata package.

Right now, get_timezoes() does not validate timezones when building the
list, which makes the following possible:

 $ timedatectl list-timezones | grep "US/Alaska"
 US/Alaska

 $ timedatectl set-timezone US/Alaska
 Failed to set time zone: Invalid or not installed time zone 'US/Alaska'

which feels buggy. Hence, simply validate timezones in get_timezones()
to avoid listing timezones that are not installed.
2025-09-18 21:33:24 +02:00
Lennart Poettering 818bd1dfa1 mountfsd: uncomment CapabilityBoundingSet= line
Since mountfsd was added in 702a52f4b5 the
caps bounding set line was commented. That's an accident. Fix that. (We
need to add a bunch of caps to the list).
2025-09-18 21:30:51 +02:00
Lennart Poettering 1c9500c2b7 units: explicitly reset TTY before running stuff on console
This adds TTYReset=yes to all units which run directly on the TTY. We
already had this in place for the gettys, but this adds it for the rest
that basically has StandardInput=tty + StandardOutput=tty set.

Originally, for these tools it wasn't necessary to reset the TTY,
because we after all already reset /dev/console very very early on once,
during PID1's early initialization, and hence there's no real reason to
do it again for these early boot services. But that's actually not
right, because since #36666 the TTY we reset from PID 1 is typically
/dev/console but the TTY those services are invoked on is typically the
resolved version of that, i.e. wherever that points. Now you might
think: if one is just an alias to the other, why does it matter to reset
this again? Well, because it's only a half-assed alias, and as it turns
out WIOCSWINSZ is not propagated from one to the other, i.e the terminal
dimesions we initialize for /dev/console don't propagate to whatever
that points to.

One option to address that would be to immediately propagate this down
ourselves (or to fix the kernel for it), but it felt safer to simply do
the reset again before the use, after all these one one-off services,
and there's no point in optimizing much here. Moreover, its probably
safer to give the guarantee that when the firstboot stuff (which after
all queries for pws to set) runs it definitely certainly guaranteed has
a properly reset terminal.
2025-09-18 21:30:31 +02:00
Mike Yuan f390e6b708 systemd-boot-update.service & zsh: replace --no-variables with --variables= (#39011) 2025-09-18 19:57:42 +02:00
Lennart Poettering b0d63f6059 Bump required minimum version of libfido2 to 1.5.0 (#38975)
Major distributions already have libfido2 >= 1.12.0. Let's bump the
required minimum version to 1.5.0, which provides FIDO_ERR_UV_BLOCKED.

Note, libfido2 1.5.0 was released on 2020-09-01.

See also #38608.
2025-09-18 17:59:44 +02:00
Lennart Poettering 265b3fbd52 btrfs-util: try unlinkat(AT_REMOVEDIR) before resorting to btrfs ioctls
An empty btrfs subvolume can always be removed without privs, hence try
to use unlinkat() first.
2025-09-18 17:58:56 +02:00
nl6720 fea2518a71 zsh: replace bootctl --no-variables with --variables=
bbeeea4362 replaced the option in bootctl.
2025-09-18 17:00:57 +03:00
nl6720 8ec3e769b5 systemd-boot-update.service: replace --no-variables with --variables=no
bbeeea4362 replaced the option in bootctl,
so systemd-boot-update.service should follow.
2025-09-18 17:00:49 +03:00
Lennart Poettering 2bbfbe4089 man: run update-man-rules 2025-09-18 15:56:11 +02:00
Lennart Poettering cba8c099a9 sd-varlink: optionally handle SIGTERM/SIGINT explicitly in simple varlink event loop 2025-09-18 15:56:11 +02:00
Lennart Poettering 04e2cb8928 sd-varlink: add api for resetting timeout to default
We currently don't expose the literal default time-out as API. Let's at
least provide users with a way to reset the time-out to the default.
2025-09-18 15:56:11 +02:00
Lennart Poettering 07345762c8 meson: downgrade dep on libgcrypt
We don't link against libgcrypt anymore, we use dlopen()
2025-09-18 15:51:01 +02:00
Lennart Poettering f26a805a9f import: always use the same buffer size
Let's synchronize the buffer sizes used when passing around the disk
images, i.e. size both our internal buffers and the pipe buffers the
same (so that we can always write()/read() everything in one gone -
except for the noise compression inserts).

Let's also increase the buffer sizes from 16K to 128K, which made a
difference for me, because it reduces the number of syscalls quite a
bit.
2025-09-18 15:43:13 +02:00
Lennart Poettering 0ba1d9f6db export-tar: refuse to write tar to a TTY 2025-09-18 15:40:41 +02:00
Lennart Poettering f20508da71 pull-job: fix include order 2025-09-18 15:29:42 +02:00
Mike Yuan 145649188a sd-json: two small tweaks (#38980) 2025-09-18 14:16:45 +02:00
Zbigniew Jędrzejewski-Szmek 3b54efe78e Change symlinks params to target & linkpath
This is what the symlinkat.2 man page uses.

The old naming with 'to' and 'from', where 'to' is the symlink name
and 'from' is the symlink target is very confusing.

Follow-up for 892838911b.
2025-09-18 12:36:50 +01:00
Andreas Schneider 3b3af5d020 man: Point to the nss-systemd manpage for more details. 2025-09-18 13:29:33 +02:00
Luca Boccassi e0f863641a meson tweaklets (#38978) 2025-09-18 11:00:19 +01:00
Kai Wohlfahrt 9ba0fd9293 Fix path in docs for local pcrlock.d directory 2025-09-18 10:59:12 +01:00
Luca Boccassi 407e8ab86c kernel-install: version sort listed kernels (#38983) 2025-09-18 10:58:37 +01:00
Jörg Behrmann 60e36dda6e man: change lexical to lexicographic
This changes the instances of lexical to lexicographic, thus making it easier
to grep for instances of lexicographic order, since there's only one variant of
the word to consider.

Lexicographic is chosen since there are slightly fewer instances of lexical and
lexicographic seems a better fit than lexical after checking a few
dictionaries.

The words lexical, lexicographic, and lexicographical are synonyms in
computing, meaning an alphabetical order. Both the Oxford dictionary and
Merriam-Webster make no distinction between lexicographic and lexicographical,
with only Wiktionary adding a more precise meaning of

    Meeting lexicographical standards or requirements; worthy of being included
    in a dictionary. [1]

Since, outside of computing, lexicographic(al) has the more specific meaning
pertaining to lexicography, i.e. the editing or making of dictionaries [2], and
lexical only has this as a secondary meaning after its linguistic meaning [3],
lexicographic fits the meaning of including and ordering entries better.

[1] https://en.wiktionary.org/wiki/lexicographical#English
[2] https://www.merriam-webster.com/dictionary/lexicographic
[3] https://www.oed.com/dictionary/lexical_adj
2025-09-18 10:57:38 +01:00
Lennart Poettering 435bef5d05 kernel-install: when listing kernels sort them by version 2025-09-18 09:31:35 +02:00
Lennart Poettering 9e9fbaa620 format-table: add TABLE_VERSION cell type
This is exactly like TABLE_STRING, with one exception: it sorts via
strverscmp_improved().
2025-09-18 09:31:35 +02:00
Lennart Poettering 8c7c808f84 sd-json: allow sd_json_dispatch() accept NULL pointers and treat them like empty objects 2025-09-18 09:15:05 +02:00
Lennart Poettering 6be5b61238 sd-json: make sure JSON_BUILD_STRING_UNDERSCORIFY() maps + to _, too
This is ultimately preparation for making systemd-creds's --with-key=
switch also accessible via Varlink, because it uses "+" inside an the
enum name. It makes sense to to allow this generally however.
2025-09-18 09:14:11 +02:00
Lennart Poettering 5d64216fc2 meson: sort components 2025-09-18 08:55:52 +02:00
Lennart Poettering e1e1ef09f9 meson: fail build when encountering unused variables 2025-09-18 08:55:52 +02:00
Yu Watanabe 0c25f8fd0b sd-boot: allow configuration of log levels (#38701)
This allows for more liberal usage of logging functionality as messages
will no longer always show up on screen, regardless of urgency. The log
level to use can be configured through an SMBIOS type 11 string
(`io.systemd.boot.loglevel=`) or by using the `log-level` option in
loader.conf. Valid values are debug, info, notice, warning, err, crit,
alert, and emerg. By default, info will be used.
2025-09-18 12:06:48 +09:00
Yu Watanabe 6f1bc004e9 basic/efivars: read EFI variables using one read(), not two (#38864)
In https://github.com/systemd/systemd/issues/38842 it is reported that
we're again having trouble accessing EFI variables:
```
  [  292.212415] H (udev-worker)[253]: Reading EFI variable /sys/firmware/efi/efivars/LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f.
  ...
  [  344.397961] H (udev-worker)[253]: Detected slow EFI variable read access on LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f: 52.185510s
```

We don't know what causes the slowdown, but it seems reasonable to avoid
unnecessary read() calls. We would read the 4-byte attr first, and then
the actual value later. But our code always reads the value (and
discards the attr in all cases except one, when _writing_ the variable),
so let's optimize for the case where we read the value and read the
whole contents in one read().
2025-09-18 12:03:30 +09:00
Yu Watanabe 46869e32cd resolve: two cleanups for varlink method (#38467) 2025-09-18 11:57:04 +09:00
Luca Boccassi 773a7d9a4e mount-util: support 'atime' family of mount options for fsmount() 2025-09-18 11:54:39 +09:00
Tobias Heider f405165065 stub: fix file path handling for loaded kernel
- Actually pass the new memory file path to parent_loaded_image->FilePath
- Restore old parent_loaded_image if Linux returns
- Pass the same kernel_file_path in load_via_boot_services path
- s/Re-use/Patch in comment explaining what we are doing

Fixes #38566
2025-09-18 11:40:43 +09:00
Yu Watanabe f871c20bad systemd-repart: add encryption configs into repart.d/* (#38052)
As explained in https://github.com/systemd/systemd/issues/37892, it
would be nice to define per-partition PCRs/key file to use.

The global default config will be still defined as cmdline options, and
`TPM2PCRs=` and `KeyFile=` will be overriden by them.
2025-09-18 11:02:38 +09:00
Yu Watanabe 794f12c778 vmspawn: fix error handling
Follow-up for 9b5ba882bd.
2025-09-18 10:43:36 +09:00
Yu Watanabe d8b60944f5 Bump required minimum version of libfido2 to 1.5.0
Major distributions already have libfido2 >= 1.12.0.
Let's bump the required minimum version to 1.5.0, which provides
FIDO_ERR_UV_BLOCKED.

Note, libfido2 1.5.0 was released on 2020-09-01.

See also #38608.
2025-09-18 09:29:29 +09:00
Yu Watanabe c6e6c85f83 test: several random cleanups and fixlets (#38877) 2025-09-18 09:13:17 +09:00
Yu Watanabe 600c757b5f resolve/varlink: use sd_json_dispatch_const_string() at more places 2025-09-18 09:07:36 +09:00
Yu Watanabe 6c135f7ace resolve/varlink: replace json_dispatch_address() with json_dispatch_byte_array_iovec() 2025-09-18 09:06:48 +09:00