1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-27 07:22:31 +03:00
Commit Graph

7993 Commits

Author SHA1 Message Date
Lennart Poettering
98d8c37595
Merge pull request #29427 from ddstreet/cryptenroll_specify_handle_index
Cryptenroll specify handle index
2023-10-11 10:47:01 +02:00
Roland Hieber
7c6dd20046 sd-gpt: add defines for big-endian MIPS/MIPS64
According to the respective change in the DPS:
<https://github.com/uapi-group/specifications/pull/86>

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
2023-10-11 10:10:49 +02:00
Laszlo Gombos
63947fede8 man: fix example for systemd.swap-extra 2023-10-10 21:44:45 +02:00
Mike Yuan
3759a17418 man/systemd.exec: document behavior of SetLoginEnvironment= when unset
Follow-up for 854eca4a95

Addresses https://github.com/systemd/systemd/pull/29493#discussion_r1351980046
2023-10-10 12:08:32 +01:00
Dan Streetman
382bfd90c3 cryptenroll: allow specifying handle index of key to use for sealing
This defaults to the SRK index.
2023-10-10 05:40:27 -04:00
Lennart Poettering
b5ac77e9a5
Merge pull request #29493 from YHNdnzj/unit-always-set-user-home
core/execute: always set $USER and introduce SetLoginEnvironment=
2023-10-10 10:16:07 +02:00
Luca Boccassi
68f85761e2 stub: add support for dtb addons
Same as kernel command line addons.
2023-10-09 22:22:09 +01:00
Mike Yuan
854eca4a95
core/execute: always set $USER and introduce SetLoginEnvironment=
Before this commit, $USER, $HOME, $LOGNAME and $SHELL are only
set when User= is set for the unit. For system service, this
results in different behaviors depending on whether User=root is set.

$USER always makes sense on its own, so let's set it unconditionally.
Ideally $HOME should be set too, but it causes trouble when e.g. getty
passes '-p' to login(1), which then doesn't override $HOME. $LOGNAME and
$SHELL are more like "login environments", and are generally not
suitable for system services. Therefore, a new option SetLoginEnvironment=
is also added to control the latter three variables.

Fixes #23438

Replaces #8227
2023-10-10 00:00:26 +08:00
Abderrahim Kitouni
3c1f396f69 man: support multiple versions of the documentation on the website
This changes the doc-sync meson target from a simple rsync command to a
script that:

* puts the documentation in a subdirectory according to the version
* injects a bit of javascript to add a drop-down to switch between versions
* updates an index.json file with the newly uploaded version
* keeps the latest/ directory up to date with the latest version
* supports a --no-latest switch to be used when uploading older versions
2023-10-09 11:16:20 +01:00
Yu Watanabe
939630ae28 varlink: fix typo
Follow-ups for #29325.
2023-10-07 15:48:22 +09:00
Emil Velikov
cb341090d0 sd-boot: add auto-reboot and auto-poweroff entries
Currently only an auto-reboot-to-firmware entry is available. For other
features - like reboot and power off - one needs to press the uppercase
B and O respectively.

Embedded devices may be missing a full fledged keyboard, so allow for
sd-boot to generate those entries.

v2:
 - add to the config parser/man/bootctl/sd-boot info screen
 - keep them off by default
 - add the (O)ff and re(B)oot help text if boot entries are not shown
 - drop irrelevant get_os_indications_supported() comment
 - s/ShutDown/Shutdown/

v3:
 - cast shutdown_system() reboot_system() to void

v4:
 - shutdown -> poweroff
 - add trailing ",ignoring" in parser message
 - drop explicit default state assignment to "false"

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2023-10-06 16:21:23 +01:00
Lennart Poettering
d408a53f78 varlinkctl: add new varlinkctl tool 2023-10-06 11:49:38 +02:00
Yu Watanabe
09ff0aadf9 backlight: support to specify percentage of minimum brightness
Closes #29328.
2023-10-06 11:21:20 +09:00
Yu Watanabe
4f4d7911cd man: fix typo
Follow-up for a121b331e3.
2023-10-06 11:18:47 +09:00
Luca Boccassi
85d0fd29af
Merge pull request #29438 from evelikov/document-rm-extra-uefi-vars
Document and purge LoaderConfigConsoleMode and LoaderEntryLastBooted
2023-10-06 00:12:49 +01:00
Lennart Poettering
a121b331e3 repart: make it easy to generate DDIs
This adds --make-ddi=confext, --make-ddi=sysext, --make-ddi=portable, to
make it really easiy to generate DDIs of the specified class. It
it's ultimately just a fancy wrapper around some defaults and in
particular --definitions=.

This makes it very easy to generate a confext:

 $ systemd-repart -C --private-key=privkey.pem --certificate=cert.crt -s mytree/ mytree.confext.raw
2023-10-05 19:08:11 +02:00
Lennart Poettering
607343a1ac repart: add new --copy-source= switch
This specifies a directory to which CopyFiles= is considered relative.
If unset defaults to the --root=/--image= setting, or host / otherwise.

This is very similar to --root= but is much more focussed: it is really
and exclusively about CopyFiles= (and related settings such as
ExcludeFiles=) and does not affect any of the settings, i.e. it doesn't
affect CopyBlocks=, the machine ID/seed handling, or where definitions
are read from.

In fact, --root= and --copy-source= may be combined for example to
use the machine ID and similar from one tree, but the copy the files
from another.
2023-10-05 19:07:19 +02:00
Emil Velikov
ef4976dc25 man: document LoaderEntryLastBooted
The option was introduced with systemd v250 although it went
undocumented. It effectively sits between Default and OneShot, in term
of priority.

It is repeatedly updated as long as loader.conf default is "@saved" and
the OneShot is not set.

v2:
 - squash some typos

v3:
 - special mention to default @saved + loader.conf reference
 - reword update side, to avoid misleading that it's needlessly
   overwritten

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2023-10-05 13:40:40 +01:00
Luca Boccassi
9482d34fb6
Merge pull request #29442 from yuwata/network-dhcp4-preferred-address
network: introduce [DHCPv4] PreferredAddress= setting
2023-10-05 12:25:42 +01:00
Daan De Meyer
0e70150be3 repart: Mention that xattrs are not copied when populating XFS with protofile 2023-10-05 12:54:02 +02:00
Emil Velikov
b207ad6344 man: document LoaderConfigConsoleMode
The variable was introduced with systemd v250 although it went
completely undocumented, even though sd-boot will honour and print it
separately (from the loader.conf one) in the boot help screen.

Document it in the systemd-boot and hint about it in loader.conf manual
pages.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2023-10-05 11:50:51 +01:00
Yu Watanabe
b93bf1bf9f network: introduce [DHCPv4] RequestAddress= setting
This may be useful when requesting a specific address.

Closes #29437.
2023-10-05 06:58:08 +09:00
Mike Yuan
723c3cd03c
man/systemd.exec: document that API fs are required to setup namespacing
Closes #27997
2023-10-05 05:31:05 +08:00
Mike Yuan
6460a89a1b
man/systemd.exec: suffix one more directory with / 2023-10-05 05:31:05 +08:00
Lennart Poettering
4c376e58da markdown: add document listing TPM2 PCR measurements we make comprehensively
This is useful to write TPM event log decoders.
2023-10-04 15:38:48 +02:00
Yu Watanabe
fcdd21ec6a tree-wide: fix typo 2023-10-04 08:58:10 +09:00
Yu Watanabe
fcf17d693c man: update the list of ignored options by Anonymize=yes
Closes #29362.
2023-10-03 10:02:02 +01:00
Abderrahim Kitouni
b8f7a53751 man: add version info for newly added systemd-tpm2-setup.service 2023-10-01 11:54:29 +01:00
Abderrahim Kitouni
8074a03656 man: re-add some version info for sd_pid_get_owner_uid.xml
These were mistakenly removed in 00f95506e2
2023-10-01 11:54:29 +01:00
Abderrahim Kitouni
2de0bb2fad man: add a couple missing version annotations
These were discovered by the newly added checks
2023-10-01 11:54:29 +01:00
Abderrahim Kitouni
3691e7fce7 man: add checks for missing version information
This adds a new script tools/check-version-history.py and a corresponding
test when building in developer mode. It checks manpages (except dbus
documentation which is handled by update-dbus-docs) for missing version
history information.

It also adds ignore lists based on version 183 (the version that our version
annotations go back to). These can be augmented if we want to ignore other
elements if it doesn't make sense for them to have version annotations.
2023-10-01 11:54:29 +01:00
Jan Janssen
658394e826 man: Verify Microsoft keys 2023-09-30 09:30:46 +02:00
Jan Janssen
5f5160d3b2 man: Adjust Microsoft UEFI certificate links
The files were fixed to all be properly der encoded.
2023-09-30 09:30:46 +02:00
Lennart Poettering
2e64cb71b9 tpm2-setup: add new early boot tool for initializing the SRK
This adds an explicit service for initializing the TPM2 SRK. This is
implicitly also done by systemd-cryptsetup, hence strictly speaking
redundant, but doing this early has the benefit that we can parallelize
this in a nicer way. This also write a copy of the SRK public key in PEM
format to /run/ + /var/lib/, thus pinning the disk image to the TPM.
Making the SRK public key is also useful for allowing easy offline
encryption for a specific TPM.

Sooner or later we should probably grow what this service does, the
above is just the first step. For example, the service should probably
offer the ability to reset the TPM (clear the owner hierarchy?) on a
factory reset, if such a policy is needed. And we might want to install
some default AK (?).

Fixes: #27986
Also see: #22637
2023-09-29 19:36:04 +02:00
Lennart Poettering
9551aa707d tpm2: move measurement log to /run/log/ (from /var/log/)
I have no idea what went on in my mind when I used a path in /var/ for
the tpm2 event log we now keep for userspace measurements. The
measurements are only valid for the current boot, hence should not be
persisted (in particular as they cannot be rotated, hence should not
grow without bounds).

Fix that, simply move from /var/log/ to /run/log/.
2023-09-29 14:35:56 +02:00
Daan De Meyer
4444564a95
Merge pull request #29193 from keszybz/path-util-adjustment
Make unit mangling follow paths
2023-09-29 11:33:12 +02:00
Luca Boccassi
081c50ed3c
Merge pull request #29361 from keszybz/kernel-install-work
Advertise installkernel ↔ kernel-install duality
2023-09-28 17:16:15 +01:00
Luca Boccassi
1e49f4ed8b
Merge pull request #28545 from bluca/softreboot_survive
pid1: add SurviveFinalKillSignal= to skip units on final sigterm/sigkill spree
2023-09-28 17:12:03 +01:00
Luca Boccassi
3cb5d34ce0
Merge pull request #29295 from valentindavid/valentindavid/sysupdate-patterns-in-directory
sysupdate: Allow patterns to match path with directories
2023-09-28 15:18:45 +01:00
Luca Boccassi
559214cbbd pid1: add SurviveFinalKillSignal= to skip units on final sigterm/sigkill spree
Add a new boolean for units, SurviveFinalKillSignal=yes/no. Units that
set it will not have their process receive the final sigterm/sigkill in
the shutdown phase.

This is implemented by checking if a process is part of a cgroup marked
with a user.survive_final_kill_signal xattr (or a trusted xattr if we
can't set a user one, which were added only in kernel v5.7 and are not
supported in CentOS 8).
2023-09-28 13:48:14 +01:00
Zbigniew Jędrzejewski-Szmek
5342eb4633 Rework unit_name_mangle_with_suffix() to (very slightly) simplify the path
'systemctl status /../dev' now looks for 'dev.mount', not '-..-dev.service',
and 'systemctl status /../foo' looks for 'foo.mount', not '-..-foo.service'. I
think this much more useful. I think the escaping is not very useful, so I plan
to submit a later series which changes that behaviour. But I think this first
step here is already useful on its own.

Note that the patch is smaller than it seems: before, is_device_path() would
return true only for absolute paths, so moving of is_device_path() under the
path_is_absolute() conditional doesn't influence the logic.
2023-09-28 13:09:25 +02:00
Zbigniew Jędrzejewski-Szmek
eb25844f83 kernel-install: describe usage as installkernel
For us, this is a compatibility mode, but most likely it is there to stay: the
kernel Makefile's install target expects to be able to call /bin/installkernel.
We want people who build their own kernels to use this, so that they use
kernel-install and get support for all the functionality provided by it,
including building of UKIs and other new features. So let's actually advertise
that this exists and works.
2023-09-28 12:40:28 +02:00
Valentin David
deafbeb0b9
sysupdate: Add documentation for new MatchPattern behavior 2023-09-28 11:41:29 +02:00
Mike Yuan
d708bb7c02
systemctl-enable: warn if disabled/masked units has active triggering units
Closes #311
2023-09-28 05:24:51 +08:00
Mike Yuan
0b675f97d6
systemctl-start: suppress the triggering unit warning when --no-warn 2023-09-28 05:24:51 +08:00
Mike Yuan
6bd8340d11
man/org.freedesktop.systemd1: add version info for NFTSet
Follow-up for dc7d69b3c1
2023-09-28 03:04:28 +08:00
Topi Miettinen
3bb48b19bd core: add user and group to NFTSet=
The benefit of using this setting is that user and group IDs, especially dynamic and random
IDs used by DynamicUser=, can be used in firewall configuration easily.

Example:

```
[Service]
NFTSet=user:inet:filter:serviceuser
```

Corresponding NFT rules:

```
table inet filter {
        set serviceuser {
                typeof meta skuid
        }
        chain service_output {
                meta skuid @serviceuser accept
                drop
        }
}
```

```
$ cat /etc/systemd/system/dunft.service
[Service]
DynamicUser=yes
NFTSet=user:inet:filter:serviceuser
ExecStart=/bin/sleep 1000

[Install]
WantedBy=multi-user.target
$ sudo nft list set inet filter serviceuser
table inet filter {
        set serviceuser {
                typeof meta skuid
                elements = { 64864 }
        }
}
$ ps -n --format user,group,pid,command -p `systemctl show dunft.service -P MainPID`
    USER    GROUP     PID COMMAND
   64864    64864   55158 /bin/sleep 1000
```
2023-09-27 18:10:11 +00:00
Topi Miettinen
dc7d69b3c1 core: firewall integration of cgroups with NFTSet=
New directive `NFTSet=` provides a method for integrating dynamic cgroup IDs
into firewall rules with NFT sets. The benefit of using this setting is to be
able to use control group as a selector in firewall rules easily and this in
turn allows more fine grained filtering. Also, NFT rules for cgroup matching
use numeric cgroup IDs, which change every time a service is restarted, making
them hard to use in systemd environment.

This option expects a whitespace separated list of NFT set definitions. Each
definition consists of a colon-separated tuple of source type (only "cgroup"),
NFT address family (one of "arp", "bridge", "inet", "ip", "ip6", or "netdev"),
table name and set name. The names of tables and sets must conform to lexical
restrictions of NFT table names. The type of the element used in the NFT filter
must be "cgroupsv2". When a control group for a unit is realized, the cgroup ID
will be appended to the NFT sets and it will be be removed when the control
group is removed.  systemd only inserts elements to (or removes from) the sets,
so the related NFT rules, tables and sets must be prepared elsewhere in
advance.  Failures to manage the sets will be ignored.

If the firewall rules are reinstalled so that the contents of NFT sets are
destroyed, command systemctl daemon-reload can be used to refill the sets.

Example:

```
table inet filter {
...
        set timesyncd {
                type cgroupsv2
        }

        chain ntp_output {
                socket cgroupv2 != @timesyncd counter drop
                accept
        }
...
}
```

/etc/systemd/system/systemd-timesyncd.service.d/override.conf
```
[Service]
NFTSet=cgroup:inet:filter:timesyncd
```

```
$ sudo nft list set inet filter timesyncd
table inet filter {
        set timesyncd {
                type cgroupsv2
                elements = { "system.slice/systemd-timesyncd.service" }
        }
}
```
2023-09-27 18:10:11 +00:00
Lennart Poettering
174e8e9897
Merge pull request #29345 from poettering/measured-uki-condition
pid1: introduce ConditionSecurity=measured-uki
2023-09-27 16:39:46 +02:00
Luca Boccassi
93bd6e3714
Merge pull request #29134 from nabijaczleweli/short-iso-timestamp
journalctl -o short-iso[-precise]: timezone as +02:00 instead of +0200
2023-09-27 14:42:27 +01:00