Commit Graph

1349 Commits

Author SHA1 Message Date
Lennart Poettering
43ef7c944c CODING_STYLE: document how to handle kernel compat
Let's define a way how to mark codepaths that are subject to
deletion once the kernel baseline reaches a certain version, to make it
easier to find these cases.

WHile we are at it, introuce a whole section in CODING_STYLE about
kernel version compat.

I followed the new scheme in #39621, but we can merge the coding style
guidelines on this already.
2026-02-06 21:01:37 +01:00
Zbigniew Jędrzejewski-Szmek
2cbea2dd75 docs: update old man page links to the official location 2026-02-03 12:49:37 +01:00
Zbigniew Jędrzejewski-Szmek
d905ac0da1 docs/INCOMPATIBILITIES: describe the new meson option 2026-02-03 12:49:37 +01:00
Zbigniew Jędrzejewski-Szmek
0acd1b4f35 units: restore runlevel[0-6].target aliases
This partially reverts commit e58ba80a40. Those
aliases were removed as part of the removal of sysvinit compat, but the removal
was immediately reported as a regression by users. In particular, users can
have one of those set as the default target, or use those names in Wants= or
Requires= dependencies. At least in Fedora, the removal was immediately
reverted.

When looking at our "portability and stability promise", I noticed that those
units are explicitly listed in the promise. Let's restore them upstream. They
are conditionalized under a new -Dcompat-sysv-interfaces=bool option, so that
downstreams like Arch that wasnt to strictly avoid legacy interfaces can easily
disable them. They are dropped from the docs, like we do for all deprecated
interfaces.
2026-02-01 09:40:10 +01:00
Zbigniew Jędrzejewski-Szmek
f4dd927e5c docs/PORTABILITY_AND_STABILITY: update the policy
The kernel has a "don't break userspace" policy [1] which is very easy
to understand and like (even if the details are complicated). We had a
complicated policy statement, but the actual practice is that we'll
generally avoid changes that cause problems for users. So the whole
detailed table is more of a guideline than something that we can rely
on.

To improve public perception, and to align the docs with practice, let's
make a general promise to keep stability, and change the existing table
to a "guideline" that tells people which interfaces to use and which not
to use so that use and development of systemd don't conflict or create
pain.

The existing document was very long, and I think it'll have a bigger
impact if it shorter. In particular, the chart is dropped, because it
was of limited use and severly outdated, because we have added many new
interfaces and components without updating it. Adding the missing
elements (and then keeping it updated) would be a lot of effort. The
chart would be most useful to somebody trying to build a systemd
reimplementation, but there haven't been many attempts like this, so
let's save the work and drop it and make the document shorter.

I also dropped the mentions of Debian. Back in the day, we did indeed
adopt many Debian conventions for config files and such, but over the
years the scope of the project has grown quite a bit and that part
of systemd is a small fraction now. And we've adopted conventions
and ideas from many other places too, so we don't mention Debian
specifically.

[1] https://docs.kernel.org/admin-guide/reporting-regressions.html
2026-01-31 17:28:42 +01:00
Yu Watanabe
f3600fe955 docs: fix typo, grammar, and broken links (#40498) 2026-01-31 01:21:04 +09:00
Yu Watanabe
0922f62126 docs: update external links
- fix many links and drop unreachable links,
- always use https rather than http if supported,
2026-01-31 01:11:11 +09:00
Philip Withnall
a05439097f docs: Add a diagram for the internals of sysupdate
I had to sketch this out before I could get the internals of
systemd-sysupdate straight in my head, particularly around how an
`UpdateSet` points to one `Instance` from each of a set of `Resource`s,
and those `Instance`s are either all sources or all targets.

Hopefully this is useful to the next person to look at the code.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-01-30 13:19:33 +09:00
Yu Watanabe
bd604320af docs: fix multiple grammar errors
Generated by GitHub Copilot.
2026-01-29 00:40:18 +09:00
Lennart Poettering
3775fab341 CODING_STYLE: suggest a clear order for func params that combine fd and path 2026-01-24 20:52:00 +01:00
Daan De Meyer
824fcb95c9 portable: Enable unpriv operation
This does not yet support directory images properly
as systemd itself does not support unpriv directory
images properly yet.

The user profiles are a copy of the system profiles but without
DynamicUser=yes (can't be used by user managers) and without
ProtectHome=yes (this masks /home which breaks StateDirectory= which
is lcoated inside /home)
2026-01-21 15:09:46 +01:00
DaanDeMeyer
995c507a6f nss-util: Add support for $SYSTEMD_NSS_LOG_LEVEL
When setting SYSTEMD_LOG_LEVEL=debug and debugging a tool that happens
to do NSS lookups, the resulting logs from varlink are obnoxiously
verbose. Let's parse a separate log level environment variable in NSS
to allow overriding the log level for NSS specifically so these noisy
logs can be silenced.
2026-01-21 12:03:07 +01:00
Lennart Poettering
d0badc0a61 sysupdate: add simple "freshness" validation to systemd-sysupdate
In order to make "freeze" attacks against the update logic harder let's
add the ability to encode a "Best Before" date into SHA256SUMS directory
listings: if the current time is already beyond that time, we'll ignore
the SHA256SUMS as "stale" and fail the upgrade. Or in other words: the
freeze attack will now result in a client-side error eventually, instead
of success state.

The best before data is encoded in an optional pseudo-file listed in SHA256SUMS:
any file named BEST-BEFORE-YYYY-MM-DD.
2026-01-20 21:22:35 +01:00
Mike Yuan
73b82070e1 docs,man: more SysV compat removal notes 2026-01-18 15:50:54 +09:00
Yu Watanabe
d207be293c Drop support for SysV rc-local script support
As already announced for several years.
2026-01-16 22:56:28 +09:00
Yu Watanabe
0a2cdd5891 Drop remaining references about sysv script support
Follow-up for 986fee6217.
2026-01-16 22:56:08 +09:00
DaanDeMeyer
90e80b9e8b docs: Document practice of using comments for argument names 2026-01-14 16:52:58 +01:00
Luca Boccassi
986fee6217 Drop support for sysvinit scripts
As announced by a few releases now, finally drop support for
sysvinit scripts.
Keep rc-local generator for now, as it's really a distinct
feature even though from the same era.
2026-01-06 10:34:02 +01:00
Yu Watanabe
2ff1a84b19 docs: update password agent document (#40235)
Adding some missing information from the code to the docs.
2026-01-02 08:03:37 +09:00
Ben Boeckel
0d15b2304b docs/PASSWORD_AGENTS: document the AcceptCached= field 2025-12-31 10:59:41 -05:00
Ben Boeckel
9f4606c361 docs/PASSWORD_AGENTS: document the Silent= field 2025-12-31 10:59:25 -05:00
Ben Boeckel
dc08cb1eb8 docs/PASSWORD_AGENTS: clarify that Echo=0 may obscure 2025-12-31 10:58:53 -05:00
Ben Boeckel
19d7ce2f7b docs/PASSWORD_AGENTS: note that the user directory may be created 2025-12-31 10:58:26 -05:00
DaanDeMeyer
f3c67f7e16 docs: Add explicit reference to unprivileged userns docs of mkosi
Fixes #40216
2025-12-28 09:31:47 +00:00
Mike Yuan
6e44160e0f docs/RELEASE: correct numbering without 7
Follow-up for b1192a01cd
2025-12-18 15:44:08 +01:00
Lennart Poettering
d91aed3b55 docs: add redirection of the osc context to uapi website 2025-12-18 10:50:23 +01:00
Luca Boccassi
ea73b8887b docs: update mkosi config file path in release process
Follow-up for fb514c2f8f
2025-12-18 00:47:14 +00:00
Luca Boccassi
b1192a01cd docs: add OBS step to release process
Version rewriting in obs-service-tar-scm is not happy with rc tags
2025-12-18 00:46:41 +00:00
Luca Boccassi
b262ded0bd Boot loader menu docs and tweaks (#39842) 2025-12-17 23:00:59 +00:00
Zbigniew Jędrzejewski-Szmek
755637b04a docs/BLI: add missing descriptions of feature bits
Follow up for 2553a5482c,
92bb46c464,
e15d18b4c6,
a67f22c4a7,
e1f1b5fc62.
2025-12-17 22:55:38 +01:00
Zbigniew Jędrzejewski-Szmek
1228429908 docs/BOOT_LOADER_INTERFACE: use full variable names once
We said in the header that "all EFI variables use the vendor UUID
4a67b082-0a4c-41cf-b6c7-440b29bb8c4f", but people not familiar with
UEFI might not know that this is concatenated with the variable name.
Let's use the full form once — when introducing the variable — to
make it easier to grep and search for.

While at it, use sembreaks in the document. This makes subsequent
changes much easier to review. (It also shows that some sentences
are rather long and thus hard to understand.)
2025-12-17 22:55:23 +01:00
Daan De Meyer
9848f56cc6 tree-wide: Use meson test -q
meson test output is extremely verbose, printing
a separate line for each successful test. Let's
add -q/--quiet everywhere so it only prints full
lines for skipped and failed tests.
2025-12-12 11:45:58 +01:00
Daan De Meyer
ee6b3d1aa2 test: Stop using grep -q in integration test
When a TTY is attached to the test unit, grep -q will generate SIGPIPE
for the previous command in the pipeline which in combo with `pipefail`
will cause the command to fail with exit status 141 which will fail the
test.

Replace with >/dev/null to avoid this from happening.

See also https://www.gnu.org/software/grep/manual/html_node/Usage.html
> There is a related problem with Bash’s set -e -o pipefail. Since grep
> does not always read all its input, a command outputting to a pipe read
> by grep can fail when grep exits before reading all its input, and the
> command’s failure can cause Bash to exit.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2025-12-10 12:09:10 +01:00
Yu Watanabe
f01daa30f1 docs/MOUNT_REQUIREMENTS: fix typo
Follow-ups for 3e94ae6f1e.
2025-11-25 22:52:10 +09:00
Lennart Poettering
81b52a013c docs: reference UAPI specs by their number when linked 2025-11-23 17:16:09 +01:00
Daan De Meyer
dd281e19a7 docs: Document cast formatting rules 2025-11-22 23:41:46 +01:00
Daan De Meyer
3c6af4cc79 Make file-hierarchy.7 link to two online docs and drop most of the contents (#39412) 2025-11-20 09:56:41 +01:00
Luca Boccassi
6d36d07599 docs: elf metadata specs have moved to uapi-group 2025-11-19 20:00:25 +01:00
Zbigniew Jędrzejewski-Szmek
720876d5c0 docs/MOUNT_REQUIREMENTS: also link to LFHS
This document doesn't really without the basis of the other one.
2025-11-18 13:03:38 +01:00
Zbigniew Jędrzejewski-Szmek
3e94ae6f1e docs/MOUNT_REQUIREMENTS: describe nested mounts more carefully
I was looking into a question posed in one of the Fedora discussion threads:
is it OK for a package to assume that files in different directories under /usr
are always on the same mount point? rpmlint emits a warning if a package has
files that are hardlinked between directories, i.e. rpmlint thinks that this
is not the case. But in practice, our systems are like this and our tooling
generally doesn't expect a part of /usr to be separated out. I looked at the
MOUNT_REQUIREMENTS document, but it doesn't answer this question clearly.
It was clearly written with the assumption that e.g. "/usr/" or "/var/" are one
mount point, so when it is "mounted", all of it is available. But the document
also talks about submounts being pulled in through requirements on specific
units, which requires some mounts not to be mounted all at once, so the reader
is left without any direct answer to this question.

This rewrite makes the following changes:
- rename "generally three categories of requirements" to
  "three general categories of mount points" because we're categorizing
  mount points, not requirements.
- always repeat the category name in further mentions,
  e.g. "2/early" instead of just "2" so the reader doesn't have to jump
  back to the table when reading.
- mention that it is OK for a mount point to be not split out
- say that submount which is "conceptually separate" may be mounted
  later.
- say "ephemeral system" instead of "stateless system" and split out
  the description of those systems into a separate paragraph and clearly
  state that they are an exception that skips the requirements listed in
  this document.
- be consistent in specifying the boundary before which each category must
  have been mounted. Previously, cat. 1 was described as "before transisition"
  and cat. 2 was described as "during early boot", which created the additional
  problem that later we needed to contradict this saying that "must be mounted
  during early boot" doesn't actually mean that and this can be done ealier.
  If we say "before end of early boot", we avoid this awkwardness.
2025-11-18 13:03:38 +01:00
Daan De Meyer
7e5a07c24a Various documentation updates 2025-11-18 10:09:19 +00:00
Luca Boccassi
00ed239a7b repart: prefix LUKS superblock label with "luks-" by default, and add explicit VolumeLabel= setting to control it (#39713)
Alternative-to: #39536
2025-11-17 17:46:39 +00:00
Philip Withnall
69f1a1d5ed docs: Update MEMORY_PRESSURE to mention recent improvements in GLib
See https://gitlab.gnome.org/GNOME/glib/-/issues/2931 for the changes in
GLib upstream. Using `GMemoryMonitor` is now more compliant with the
systemd recommended approach, but it needs further work to read the
recommended environment variables rather than unconditionally accessing
the per-cgroup PSI kernel file directly.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-11-17 18:05:41 +01:00
Lennart Poettering
e30738c20c dissect-tool: accept encryption password via $PASSWORD 2025-11-17 16:42:58 +01:00
Lennart Poettering
867e64737a units: measure a separator event into PCR 9 after completing NvPCR initialization
We do this in a separate service (rather than inside of
systemd-tpm2-setup), since we want failures of this measurement to
result in an instant reboot, like for most our measurements.

Failures to initialize nvpcrs, or allocate an SRK are somewhat OK (and
more likely), as long as this separator communicates clearly where they
have to have taken place, if they worked.
2025-11-14 22:22:39 +01:00
Lennart Poettering
d70296bb56 tpm2-setup: measure information about NvPCR initialization to PCR 9
This locks down NvPCR initilization a bit more: we'll measure each
initialization of an NvPCR into PCR 9, thus chaining the NvPCRs to the
PCR set. After all NvPCRs are initialized we measure a barrier into PCR
9 as well.

This ensures that later additions of NvPCRs are clearly recognizable and
distuingishable from those done at boot.
2025-11-14 22:04:58 +01:00
Ivan Kruglov
b8ef90d6fd docs: initial version of varlink guideline 2025-11-14 17:54:20 +01:00
Zbigniew Jędrzejewski-Szmek
aff5c0af8b docs/BACKPORTS: update
We now keep stable branches in the main repo. Update the description
to match current practice.

Closes https://github.com/systemd/systemd/issues/35846.
2025-11-12 23:01:35 +00:00
Francesco Valla
840549989f modules-load: implement parallel module loading
Load modules in parallel using a pool of worker threads. The number of
threads is equal to the number of CPUs, with a maximum of 16 (to avoid
too many threads being started during boot on systems with many an high
core count, since the number of modules loaded on boot is usually on
the small side).

The number of threads can optionally be specified manually using the
SYSTEMD_MODULES_LOAD_NUM_THREADS environment variable; in this case,
no limit is enforced. If SYSTEMD_MODULES_LOAD_NUM_THREADS is set to 0,
probing happens sequentially.

Co-authored-by: Eric Curtin <ecurtin@redhat.com>
2025-11-07 14:12:56 +01:00
Lennart Poettering
330e66f15e doc: document NvPCRs briefly 2025-11-02 21:26:13 +01:00