1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00
Commit Graph

8963 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
fb0ef5eac0 man/systemd-stub: reword descriptions of .dtb and .profile sections
- The text was clearly edited in variuos places to e.g. allow multiple
  sections, so it first said that sections are singletons, and immediately
  after that that some section are not.
- Replace "regardless of the kernel" with "regardless of the kernel version".
  The kernel is very much involved e.g. in loading of the initrds.
- Various other small rewordings to make the text more legible.
2024-10-03 16:34:04 +01:00
Lukas Nykryn
67b6404b80 man: using WantedBy=default.target is not a good idea
We had several users, that wrote their unit files with
WantedBy=default.target because it should be started "every time".
But for example in Fedora/CentOS/RHEL, this often breaks for
example selinux relabels (where we just want to do a relabel and reboot).
2024-10-02 18:25:03 +02:00
Marcel Hellwig
fec09ff094 Update sd_bus_message_append_array.xml
fix pointer constness in documentation
2024-10-01 15:55:28 +02:00
Daniel Dawson
0c96911afb systemd-integritysetup: accept integrity-algorithm=xxhash64
Signed-off-by: Daniel Dawson <danielcdawson@gmail.com>
2024-10-01 11:16:14 +02:00
Mike Yuan
468c6265a2
Merge pull request #34534 from keszybz/man-exitrd
Formally document exitrds
2024-09-30 21:02:04 +02:00
Yu Watanabe
82f2c33db5 tpm2-util: show loaded libraries in 'systemd-analyze has-tpm2'
After 3b16e9f419, even the libraries are
documented in the man page, it is useful to mention which libraries are
checked in the command output.

Of course, the dependencies are kind of implementation detail, and may
be changed in the future version, but that's especially why I think
showing the library deps in the output is useful.

systemd-analyze is a debugging tool, and already shows many internal
states. I think there is nothing to prevent from showing the deps.

Prompted by #34477.
2024-09-30 15:40:14 +02:00
Zbigniew Jędrzejewski-Szmek
1ca81b2e00 man: fix formatting in file-hierarchy
Somebody wrapped the text, but whitespace is preserved in <programlisting>, so
the output was mangled. It also doesn't make sense to run systemd-path as root
(as indicated by '#'), so drop that. Also, this chunk should be a separate
paragraph.
2024-09-26 19:57:07 +02:00
Zbigniew Jędrzejewski-Szmek
7352a0093f man: say that SYSEXT_SCOPE=initrd also applies to exitrds
We generally do _not_ want the same sysexts to be loaded in both initrd and
exitrd phases. The environment is completely different and it's unlikely that
the same code can be useful in both places. Nevertheless, it can be useful in
_some_ cases, for example when the sysexts contains debugging tools.

I think we don't need to differentiate between initrds and exitrds through
SYSEXT_SCOPE, because the two types are made available in completely different
locations and loaded through a different mechanism, with very little chance of
an initrd being loaded as an exitrd without an explicit admin action (or the
other way around). So let's not complicate our code or definitions by an
explicit "exitrd" sysext designator, but just clarify that "initrd" also
encompasses exitrds in this context.
2024-09-23 12:12:06 +02:00
Zbigniew Jędrzejewski-Szmek
c87bce7d28 man: reword some sentences with umbiguous subjects
A sencence like "The system manager does, a, b, c, which is really d, and e.",
it is generally understood that the manager also does "e". This can be
quite confusing if the manager cannot do "e", in our case unmount the file
system on which it is sitting.

Similary, we cannot "fall back to x if it is missing", since "it" in that
sentence means "x".
2024-09-23 12:09:43 +02:00
Zbigniew Jędrzejewski-Szmek
ace26a511f man: slightly enhance docs about "exitrd" and remove TODO entry for it
The concept is fairly well established and present in our docs in various
places.

Say that the exitrd is also marked by the presence of /etc/initrd-release.
2024-09-23 12:09:43 +02:00
Yu Watanabe
3ae0e54527 machine: fix bus method argument name: who -> whom
Follow-up for cd2fb04960.
2024-09-21 05:38:01 +09:00
cvlc12
dbf5b09de4 man: update PCR and Secure Boot key names and paths 2024-09-20 05:01:15 +09:00
Yu Watanabe
3b16e9f419 man/systemd-analyze: mention required libraries for TPM2 support
Closes #34477.
2024-09-19 19:21:08 +09:00
Yu Watanabe
07e6a111c0 man: fix typo
Follow-up for 8aee931e7a.
2024-09-19 09:18:47 +09:00
Antonio Alvarez Feijoo
bf39626d61 man/repart: use <varname> instead of <variable>
Otherwise, `<variable>$BOOT</variable>` is rendered:

```
[2548/2992] Generating man/repart.d.5 with a custom command
Element variable in namespace '' encountered in para, but no template matches.
Element variable in namespace '' encountered in para, but no template matches.
```
2024-09-18 16:03:56 +02:00
Daan De Meyer
81af8f998e repart: Support specifying multiple directories to ExcludeFiles= 2024-09-18 10:22:33 +02:00
Jason Yundt
dfb3155419 man: document ShowStatus and SetShowStatus()
SetShowStatus() was added in order to fix #11447. Recently, I ran into
the exact same problem that OP was experiencing in #11447. I wasn’t able
to figure out how to deal with the problem until I found #11447, and it
took me a while to find #11447.

This commit takes what I learned from reading #11447 and adds it to the
documentation. Hopefully, this will make it easier for other people who
run into the same problem in the future.
2024-09-18 10:11:55 +02:00
Adrian Vovk
2cb9c68c3a
repart: Add SupplementFor= logic
This was designed to deal with $BOOT, as defined by the Boot Loader
Specification, but it was made a generic mechanism because it is useful
elsewhere too. See the updated man page for usage examples, motivation,
and an explanation of how this works.
2024-09-17 14:06:50 -04:00
Yu Watanabe
4f0bc2582e man: fix typo
Follow-up for a632d8dd9f.
2024-09-16 11:49:04 +09:00
Yu Watanabe
f6cc5e1c8d
Merge pull request #34393 from poettering/tmpfiles-ownership-flag
tmpfiles: introduce an explicit line flag $ for enabling purge logic …
2024-09-16 10:51:09 +09:00
Yu Watanabe
590f430cac
Merge pull request #34425 from yuwata/udev-rules-case-insensitive-match
udev-rules: support case insensitive match
2024-09-16 10:42:37 +09:00
Yu Watanabe
b5ec8f77e0
Merge pull request #34434 from poettering/bootctl-stub-paths
bootctl: expose new stub path efi vars and related
2024-09-16 10:41:24 +09:00
Lennart Poettering
3e0a3a0259 bootctl: show whether a PE file is an addon in 'booctl kernel-identify' 2024-09-16 10:41:10 +09:00
Lennart Poettering
db15657dfb tmpfiles: introduce an explicit line flag $ for enabling purge logic for a line
Let's make the risk of accidental misuse, and mark lines that shall be
covered by --purge with an explicit new flag "$".

See: #33349
2024-09-15 19:43:09 +02:00
Lennart Poettering
90cf998875 bootctl: add --print-loader-path + --print-stub-path
These are inspired by the existing commands that return the path to the
boot or ESP partitions. However, these new commands show the path to the
boot loader (systemd-boot) or UKI/stub (systemd-stub) that was used on
the current boot. This information is derived from EFI variables.
2024-09-15 19:34:19 +02:00
Mike Yuan
3a41a21666 man/bootup: rename initrd to exitrd at one more place
Follow-up for f2c2fa87b6
2024-09-16 01:35:31 +09:00
Yu Watanabe
5f5c5c48b9 udev-rules: support case insensitive match
This introduces 'i' prefix for match string. When specified, string or
pattern will match case-insensitively.

Closes #34359.

Co-authored-by: Ryan Wilson <ryantimwilson@meta.com>
2024-09-15 23:09:26 +09:00
Lennart Poettering
55184c4cfc man: document that sd_bus_process() only returns otherwise unhandled messages in *ret_message 2024-09-12 16:18:07 +02:00
Lennart Poettering
1791854ce4
Merge pull request #34385 from poettering/man-unify-pcr-key-name
man: clean up PCR public key filenames in systemd-stub and systemd-measure man pages
2024-09-12 15:45:40 +02:00
Lennart Poettering
58e359604f analyze: move "has-tpm2" from systemd-creds to systemd-analyze
The verb s not really specific to credential management, it was always a
bit misplaced. Hence move it to systemd-analyze, where we already have
some general TPM related verbs such as "srk" and "pcrs"
2024-09-12 12:56:03 +02:00
Lennart Poettering
201aca5f9a man: fix advertised filename of the PCR public key 2024-09-12 09:46:26 +02:00
Lennart Poettering
6f1dfc407e man: systemd-stub places PCR public key in file 'tpm2-pcr-public-key.pem', stick to that name across the board
systemd-stub provides the signing key for TPM2 signed PCR policies in a
file tpm2-pcr-public-key.pem to userspace. Hence, to clarify that this
is the same key as used when signing via "systemd-measure", let's rename
it in the docs like that.

Also rename the private key to tpm2-pcr-private-key.pem, to keep the
symmetry.

With this we should universally stick to this nomenclature:

1. tpm2-pcr-public-key.pem   ← public part of signing key
2. tpm2-pcr-private-key.pem  ← private part of signing key
3. tpm2-pcr-signature.json   ← signature file made with key pair

Inspired by: #34069
2024-09-12 09:46:26 +02:00
Daan De Meyer
aaa6c6e279
Merge pull request #34377 from DaanDeMeyer/symlinks
repart: Add MakeSymlinks=
2024-09-11 21:34:37 +02:00
Daan De Meyer
c64ddefd5c repart: Add MakeSymlinks=
Similar to MakeDirectories=, but creates symlinks in the filesystem.
2024-09-11 18:45:05 +02:00
sinus-x
2c8184a8d2 man: Correct flag description of systemd-cat
It is not true that "no string" is written to journal; the binary
name is used when run via `systemd-cat command`, or `cat` is used
when run via `command | systemd-cat`.
2024-09-11 15:00:34 +02:00
Lennart Poettering
87f5efdeb0
Merge pull request #34353 from yuwata/timesync-bus-document
timesync: add document for org.freedesktop.timesync1
2024-09-11 10:15:30 +02:00
Lennart Poettering
a482908cbc stub: add StubDevicePartUUID/StubImageIdentifier
These variables closely mirror the existing
LoaderDevicePartUUID/LoaderImageIdentifier variables. But the Stub…
variables indicate the location of the stub/UKI (i.e. of systemd-stub),
while the Loader… variables indicate the location of the boot loader
(i.e. of systemd-boot). (Except of course, there is no boot loader used,
in which case both sets point to the stub/UKI, as a special case).

This actually matters, as we support that sd-boot runs off the ESP,
while a UKI then runs off XBOOTLDR, i.e. two distinct partitions.
2024-09-11 06:48:27 +02:00
Lennart Poettering
8d5ff87a70 man: fix documentation for LoaderDevicePathUUID + LoaderImageIdentifier, in systemd-stub man page too
Let's fix the version here too, and also clarify that this is usually
not necessarily the ESP.
2024-09-11 06:48:19 +02:00
Lennart Poettering
8b5ad0ba41 man: fix LoaderDevicePathUUID + LoaderImageIdentifier descriptions
First of all, these were always set, i.e. since sd-boot was merged into
our tree, i.e. v220. Let's say so explicitly.

Also, let's be more accurate, regarding which partition this referes to:
it's usually "the" ESP, but given that you can make firmware boot from
arbitrary disks, it could be any other partition too. Hence, be
explicit on this.

Also, clarify tha sd-stub will set this too, if sd-boot never set it.
2024-09-11 06:47:16 +02:00
Yu Watanabe
fd0958762a man: add basic documents for org.freedesktop.timesync1
Closes #34352.
2024-09-11 04:42:50 +09:00
Lennart Poettering
f2129f1d8c
Merge pull request #34294 from poettering/uki-with-many-core
multi-profile UKIs (systemd-stub hookup)
2024-09-10 08:59:53 +02:00
Yu Watanabe
6d449bc71f
Merge pull request #34318 from YHNdnzj/networkctl-edit-if-netdev
networkctl: support editing netdev files by link and cat ":all"
2024-09-10 14:32:28 +09:00
Lennart Poettering
a632d8dd9f stub: add ability to place multiple alternative PE sections of a specific type in the same UKI ("Multi-Profile UKIs")
This adds a ability to add alternative sections of a specific type in
the same UKI. The primary usecase is for supporting multiple different
kernel cmdlines that are baked into a UKI.

The mechanism is relatively simple (I think), in order to make it robust.

1. A new PE section ".profile" is introduced, that is a lot like
   ".osrel", but contains information about a specific "profile" to
   boot. The ".profile" section can appear multiple times in the same
   PE, and acts as delimiter indicating where a new profile starts.
   Everything before the first ".profile" is called the "base profile",
   and is shared among all other profiles, which can then override or
   add addition PE sections on top.

2. An UKI's command line can be prefixed with an argument such as "@0" or
   "@1" or "@2" which indicates the "profile" to boot. If no argument is
   specified the default is profile 0. Also, a UKI that lacks any
   .profile section is treated like one with only a profile 0, but with
   no data in that profile section.

3. The stub will first search for its usual set of PE sections
   (hereafter called "base sections"), and stop at the first .profile PE
   section if any. It will then find the .profile matching the selected
   profile by its index, and any sections found as part of that profile
   on top of the base sections.

And that's already it.

Example: let's say a distro wants to provide a single UKI that can be
invoked in one of three ways:

1. The regular profile that just boots the system
2. A profile that boots into storagetm
3. A profile that initiates factory reset and reboots.

For this it would define a classic UKI with sections .linux, .initrd,
.cmdline, and whatever else it needs. The .cmdline section would contain
the kernel command line for the regular profile.

It would then insert one ".profile" section, with a contents like the
following:

    ID=regular

This is the profile for profile 0. It would immediately afterwards add
another ".profile" section:

    ID=storagetm
    TITLE=Boot into Storage Target Mode

This would then followed with a .cmdline section that is just like the
basic one, but with "rd.systemd.unit=storage-target-mode.target"
suffixed. Then, another .profile section would be added:

    ID=factory-reset
    TITLE=Factory Reset

Which is then followed by one last PE section: a .cmdline one with
"systemd.unit=factory-reset.target" suffixed to te regular command line.

i.e. expressed in tabular form the above would be:

    The base profile:
          .linux
          .initrd
          .cmdline
          .osrel
    The regular boot profile:
          .profile
    The storagetm profile:
          .profile
          .cmdline
    The factory reset profile:
          .profile
          .cmdline

You might wonder why the first .cmdline in the list above is placed in
the base profile rather than in the regular boot profile, given that it
is overriden in all other profiles anyway. And you are right. The only
reason I'd place it in the base profile is that it makes the UKI more
nicely extensible if later profiles are added that want to replace
something else instead of the .cmdline, for example .ucode or so. But it
really doesn't matter much.

While the primary usecase is of course multiple alternative command
lines, the concept is more powerful than that: for various usecases it
might be valuable to offer multiple choices of devicetree, ucode or
initrds.

The .profile contents is also passed to the invoked kernel as a file in
/.extra/profile (via a synthetic initrd). Thus, this functionality can
even be useful without overriding any section at all, simply by means of
reading that file from userspace.

Design choices:

1. On purposes I used a special command line marker (i.e. the "@" thing,
   which maybe we should call the "profile selector"), that doesn't look
   like a regular kernel command line option.  This is because this is
   really not a regular kernel command line option – we process it in
   the stub, then remove it as prefix, and measure the unprefixed
   command line only after that. The kernel will not see the profile
   selector either. I think these special semantics are best
   communicated by making it look substantially different from regular
   options.

2. This moves around measurements a bit. Previously we measured our UKI
   sections right after finding them. Now we first parse the profile
   number from the command line, then search for the profile's sections,
   and only then measure the sections we actually end up using for this
   profile. I think that this logic makes most sense: measure what we
   are using, not what we are overriding. Or in other words, if you boot
   profile @3, then we'll measure .cmdline (assuming it exists) of
   profile 3, and *not* measure .cmdline of the base profile. Also note
   that if the user passes in a custom kernel command line via command
   line arguments we'll strip off the profile selector (i.e. the initial
   "@X" thing) before we pass it on.

3. The .profile stuff is supposed to be generic and extensible. For
   example we could use it in future to mark "dangerous" options such as
   factory reset, so that boot menus can ask for confirmation before
   booting into it. Or we could introduce match expressions against
   SMBIOS or other system identifiers, to filter out profiles on
   specific hw.

Note btw, that PE allows defining multiple sections that point to the
same offsets in the file. This allows sharing payload under different
names. For example, if profile @4 and @7 shall carry the same .ucode
section, they can define .ucode in each profile and then make it point to
the same offset.

Also note that that one can even "mask" a base section in a profile, by
inserting an empty section. For example, if the base .dtb section should
not be used for profile @4, then add a section .dtb right after the
fourth .profile with a zero size to the UKI, and you will get your wish
fulfilled.

This code only contains changes to sd-stub. A follow-up commit will
teach sd-boot to also find this profile PE sections to synthesize
additional menu entries from a single UKI.

A later commit will add support for gnerating this via ukify.

Fixes: #24539
2024-09-10 06:49:08 +02:00
Mike Yuan
0d3787deac
networkctl: support editing netdev files by link and cat ":all"
Also, don't abuse RET_GATHER in verb_cat(), where the failures
are most likely unrelated to each other.

Closes #34281
2024-09-09 23:20:42 +02:00
Lennart Poettering
229d4a9806 shell: define three system credentials we can propagate into shell prompts and welcome messages 2024-09-09 19:03:48 +02:00
Daan De Meyer
fa693fdc7e core: Add support for PrivateUsers=identity
This configures an indentity mapping similar to
systemd-nspawn --private-users=identity.
2024-09-09 18:31:01 +02:00
Daan De Meyer
c1852f9d5f sysupdate: Add --transfer-source=
In mkosi, I want to add a sysupdate verb to wrap systemd-sysupdate.
The definitions will be picked up from mkosi.sysupdate/ and passed
to systemd-sysupdate. I want users to be able to write transfer
definitions that are independent of the output directory used by
mkosi. To make this possible, it should be possible to specify the
directory that transfer sources should be looked up in on the sysupdate
command line. Let's allow this via a new --transfer-source= option.

Additionally, transfer sources that want to take advantage of this
feature should specify PathRelativeTo=directory to indicate the configured
Path= is interpreted relative to the tranfer source directory specified
on the CLI.

This allows for the following transfer definition to be put in
mkosi.sysupdate:

"""
[Transfer]
ProtectVersion=%A

[Source]
Type=regular-file
Path=/
PathRelativeTo=directory
MatchPattern=ParticleOS_@v.usr-%a.@u.raw

[Target]
Type=partition
Path=auto
MatchPattern=ParticleOS_@v
MatchPartitionType=usr
PartitionFlags=0
ReadOnly=1
"""
2024-09-09 16:41:52 +02:00
Yu Watanabe
c8f2409574 man/varlinkctl: fix typo
Follow-up for 39ce86d19c.
2024-09-07 22:24:58 +09:00
Yu Watanabe
5573e067d0
Merge pull request #34295 from poettering/uki-with-many-ukify
ukify: add multi-profile UKI support
2024-09-07 08:08:48 +09:00
Lennart Poettering
39ce86d19c varlinkctl: add --timeout= switch to tweak time-out behaviour
Fixes: #33772
2024-09-07 07:35:39 +09:00