1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-10 16:58:28 +03:00

7602 Commits

Author SHA1 Message Date
Daan De Meyer
600bf76c17 repart: Allow target directory excludes
Currently, ExcludeFiles= supports excluding directories on the host
from being copied. Let's extend this to also support preventing files
from being copied into specific directories in the partition by adding
a new option ExcludeFilesTarget=. An example where this is useful is
when setting up btrfs subvolumes in the top level that are intended to
be mounted into specific locations, so /usr would be stored in @usr,
/home in @home, .... To accomplish this, we need to copy /usr to @usr
and prevent any files from being copied into /usr in the partition,
which with this commit, we'd be able to do as follows:

```
[Partition]
CopyFiles=/usr:@usr
ExcludeFilesTarget=/usr
```
2023-05-30 13:45:49 +02:00
Zbigniew Jędrzejewski-Szmek
5097077954
Merge pull request #27842 from keszybz/man-page-links
Man page formatting and links and such
2023-05-30 13:40:45 +02:00
Dmitry V. Levin
d4bfb78bfc man: mention that udevadm verify also checks for udev rules style issues
Starting with commit acc1954a0394, udevadm verify also checks token
delimiters, which are not necessarily a matter of udev rules syntax,
but rather a question of style and readability.  Mention that in the
documentation to avoid confusion.

Suggested-by: Martin Wilck <mwilck@suse.com>
Complements: acc1954a0394 ("udev-rules: check token delimiters")
2023-05-30 10:13:04 +02:00
Zbigniew Jędrzejewski-Szmek
706a297cd7 man/analyze: drop paths from output examples
They are not useful for the user but make the examples
wider than necessary.
2023-05-30 10:11:04 +02:00
Zbigniew Jędrzejewski-Szmek
9140404a12 man/analyze: reword description of malloc and fix link 2023-05-30 10:11:02 +02:00
Russell Harmon
bcc1ee56c0 Support no-journal for dm-integrity devices.
As documented in integritysetup.8, dm-integrity devices support running
without a journal whatsoever. This change allows the
CRYPT_ACTIVATE_NO_JOURNAL flag (the same as is used with `integritysetup
--integrity-no-journal`) to be passed in during dmsetup by specifying
the `no-journal` option in integritytab.5.
2023-05-30 16:35:46 +09:00
Zbigniew Jędrzejewski-Szmek
6a488fa7cc gpt-auto-generator: rework/simplify logic for picking /efi or /boot
I started looking into https://github.com/uapi-group/specifications/issues/35.

BLS says:
> Otherwise [no existing XBOOTLDR partition], if on GPT and an ESP is found and
> it is large enough (let’s say at least 1G) it should be used as $BOOT and
> used as primary location to place boot loader menu resources in.

> It is recommended to mount $BOOT to /boot/, and the ESP to /efi/.

DPS says:
> The ESP used for the current boot is automatically mounted to /efi/ (or
> /boot/ as fallback), unless a different partition is mounted there (possibly
> via /etc/fstab, or because the Extended Boot Loader Partition — see below —
> exists) or the directory is non-empty on the root disk.

I don't think we want to mount the same partition in two places.
If the same partition is not mounted in two places, then the two specs are
contradictory.

The code in gpt-auto-generator implemented the logic from the DPS. It is
modified to implement the logic from BLS.

Effectively:
- if both /boot and /efi are available:
  - if both XBOOTLDR and ESP exist:
    ESP on /efi, XBOOTLDR on /boot
  - if only ESP exists:
    ESP on /boot
  - if only XBOOTLDR exists:
    XBOOTLDR on /boot
- if only /boot is available:
  - if XBOOTLDR exists:
    XBOOTLDR on /boot
  - if only ESP exists:
    ESP on /boot
- if only /efi is available:
  - if ESP exists:
    ESP on /efi

"Available" means that it the mount point is not mounted over and does not
contain files. If the directory doesn't exist, it is also "available" and will
be created later when the mount or automount unit is started.

Thus, the generator attempts to match the partitions and mount points to the
extent possible. In all cases, /boot is the primary place to install kernels.
ESP can be found on /boot or /efi, depending on the situation.

If this patch is merged, I'll submit fixes for BLS and DPS to describe the
same logic.
2023-05-29 22:53:08 +02:00
Zbigniew Jędrzejewski-Szmek
d2149f6c76 man/tmpfiles: add more man page citerefs
This was supposed to be part of 8fb350049bb7a7305589f201df9d37482e544f24, but
I forgot to save the file.
2023-05-29 12:12:45 +02:00
Vitaly Kuznetsov
ce8dc0bd6b man: fix UKI filename suffix in 'tries' description
Boot Loader Type #2 entries (UKIs in $BOOT/EFI/Linux/) have '.efi' suffix,
not '.conf'.
2023-05-26 17:04:37 +02:00
Zbigniew Jędrzejewski-Szmek
5287b3a87a
Merge pull request #27746 from yuwata/unit-bidirectional-dep
core/unit: make unit dependency always bidirectional
2023-05-26 16:20:48 +02:00
Lennart Poettering
0706718c07
Merge pull request #27563 from yuwata/fstab-generator
fstab-generator: support defining mount units through kernel command line
2023-05-26 02:52:19 -07:00
Yu Watanabe
a60f96fcf5 core/unit: make JoinsNamespaceOf= implies the inverse dependency
Previously, even if a.service has JoinsNamespaceOf=b.service, the
inverse direction of reference was not introduced.
Hence, a.service is started earlier than b.service, the namespace will
not shared with b.service.
Also, even if a.service had the reference to b.service, b.service did not.
If b.service is freed earlier, then unit_clear_dependencies() does not clear
the reference from a to b, and will cause use-after-free on unit_free() for
a.service.

Let's make JoinsNamespaceOf=b.service in a.service implies the inverse
dependency, i.e. JoinsNamespaceOf=a.service for b.service. Then, we can safely
free b.service.
2023-05-26 11:50:08 +09:00
David Tardon
9a2982b687 gpt-auto-generator: also honor systemd.swap=no 2023-05-25 19:30:32 +02:00
David Tardon
30765fcb16 man: add trailing = 2023-05-25 19:30:32 +02:00
Lennart Poettering
be2e63159f
Merge pull request #27358 from bluca/pe_mule
stub: allow loading and verifying kernel command line addons
2023-05-25 03:56:06 -07:00
Luca Boccassi
05c9f9c251 stub: allow loading and verifying cmdline addons
Files placed in /EFI/Linux/UKI.efi.extra.d/ and /loader/addons/ are
opened and verified using the LoadImage protocol, and will thus get
verified via shim/firmware.
If they are valid signed PE files, the .cmdline section will be
extracted and appended. If there are multiple addons in each directory,
they will be parsed in alphanumerical order.

Optionally the .uname sections are also matched if present, so
that they can be used to filter out addons as well if needed, and only
addons that correspond exactly to the UKI being loaded are used.
It is recommended to also always add a .sbat section to addons, so
that they can be mass-revoked with just a policy update.

The files must have a .addon.efi suffix.

Files in the per-UKI directory are parsed, sorted, measured and
appended first. Then, files in the generic directory are processed.
2023-05-24 15:02:36 +01:00
Luca Boccassi
c67d5a027d ukify: add default .sbat section for addons
In order to ensure addons can always be revoked via SBAT, and it is not
left out by mistake, have a default metadata entry if none is specified
by the caller.
https://github.com/rhboot/shim/blob/main/SBAT.md
2023-05-24 11:09:03 +01:00
Luca Boccassi
b6f2e68602 stub/measure: document and measure .uname UKI section 2023-05-24 11:06:36 +01:00
Lennart Poettering
2fdc274c66 sd-event: add an explicit API for leaving the ratelimit state
Sometimes, it might make sense to end the ratelimit window early.
2023-05-24 10:52:08 +02:00
Yu Watanabe
55365b0a23 fstab-generator: support defining mount units through kernel command line
Now, the following kernel command line options are supported:
  systemd.mount-extra=what:where:fstype:options
  systemd.swap-extra=what:options

Closes #27260.
2023-05-24 08:23:22 +09:00
Luca Boccassi
2c90b5ec63 stub: measure SMBIOS kernel-cmdline-extra in PCR12
PCR1, where SMBIOS strings are measured, is filled with data that is not
under the control of the machine owner. Measure cmdline extensions in
PCR12 too, where we measure other optional addons that are loaded by
sd-stub.
2023-05-23 23:22:51 +01:00
Zbigniew Jędrzejewski-Szmek
a3256ea8f4 man: extend description of --boot 2023-05-23 15:09:39 +02:00
Zbigniew Jędrzejewski-Szmek
e0ea6af3b3 tmpfiles: add --graceful
See the man page diff for description.
2023-05-23 15:09:22 +02:00
Zbigniew Jędrzejewski-Szmek
fd6ee7ed42 firstboot: clarify that machine-id options are only offline, add missing docs
Let's flat out refuse to configure machine-id on a running system with
systemd-firstboot. It wouldn't work anyway, because by the time firstboot is
started, pid1 has created /etc/machine-id, possibly with "unitialized", so
firstboot wouldn't touch the file. (If --force is specified, it works. So
let's allow that in case people want to do crazy things.)

While at it, add missing descriptions of various things that were added over
time, and group descriptions of similar options together.
2023-05-23 12:39:34 +02:00
Daan De Meyer
ab45e83fb6 repart: Default to vfat for ESP/XBOOTLDR partitions
vfat makes a lot more sense than ext4 for these partitions.
2023-05-22 22:16:32 +02:00
Luca Boccassi
fa63798a2e man: use setlogmask in LogControl1 example
Useful to show programs using syslog() how to easily set a mask.
2023-05-22 18:05:29 +01:00
Zbigniew Jędrzejewski-Szmek
cb1cc1acd4
Merge pull request #27703 from keszybz/systemd-vconsole-ordering
Order systemd-vconsole-setup before getty units
2023-05-22 13:27:33 +02:00
Yu Watanabe
f8c5301e44 man: AllowedIPs= can be specified multiple times
Closes #27507.
2023-05-22 14:18:46 +09:00
Dmitry V. Levin
9e36da1541 udevadm-verify: introduce --no-summary option
When udevadm verify is invoked by an analyzer tool like rpminspect
to verify individual udev rules files, the summary just clutters the
output, so provide an option to turn the summary off.
2023-05-21 23:20:30 +09:00
Mike Yuan
96bab8fd63
networkctl: add verb edit and cat to operate on network configs
This adds two verbs, edit and cat, to networkctl for
operating on network configs (namely .network, .netdev
and .link files). Specially, if the config name is
prefixed by @, it will be treated as network interface
name, and operations will be performed on config files
associated with the link.

Closes #26906
2023-05-21 15:48:57 +08:00
Zbigniew Jędrzejewski-Szmek
e019ea738d pid1: order units using TTYVHangup= after vconsole setup
The goal of this change is to delay getty services until after
systemd-vconsole-setup has finished. systemd-vconsole-setup starts loadkeys,
and it seems that when loadkeys is interrupted by the TTY hangup call we do
when starting tty services [1], so that loadkeys starts getting EIO from the
ioctl("/dev/tty1", KDSKBENT) syscall it does.

Fixes #26908.

[1] https://github.com/legionus/kbd/issues/92#issuecomment-1554451788

Initially I wanted to add ordering dependencies to individual units, but
TTYVHangup= can be added to other various external units too. The solution with
an implicit dependency should cover those cases too.
2023-05-19 17:46:30 +02:00
Luca Boccassi
d936595672 manager: restrict Dump*() to privileged callers or ratelimit
Dump*() methods can take quite some time due to the amount of data to
serialize, so they can potentially stall the manager. Make them
privileged, as they are debugging tools anyway. Use a new 'dump'
capability for polkit, and the 'reload' capability for SELinux, as
that's also non-destructive but slow.

If the caller is not privileged, allow it but rate limited to 10 calls
every 10 minutes.
2023-05-19 15:18:23 +01:00
Yu Watanabe
65f2ff7998
Merge pull request #27685 from keszybz/the-semiannual-excercise-in-output-narrowing
The semiannual excercise in output narrowing
2023-05-19 03:04:47 +09:00
Zbigniew Jędrzejewski-Szmek
02e0f430a0 meson: rename "dist-check" suite to "dist"
*Now* one of those tests is the longest, let's make them a bit shorter.
2023-05-18 17:18:11 +02:00
Yu Watanabe
837dfea5ed
Merge pull request #27673 from YHNdnzj/restartsteps-transient
core,bus-unit-util: add missing RestartSteps and RestartMaxDelaySec to bus_append_service_property
2023-05-18 17:54:33 +09:00
Mike Yuan
2200cf47ce Revert (partially) "man: Clarify when OnFailure= activates after restarts (#7646)"
This reverts part of commit bd2538b50ba283c9ce39142d5d16d90184a55b90,
specifically changes to the description of service state between auto-restarts.

Fixes #27594
2023-05-18 15:10:26 +09:00
Mike Yuan
e9f17fa8dd
core: rename RestartSecMax to RestartMaxDelaySec 2023-05-18 00:23:49 +08:00
Zbigniew Jędrzejewski-Szmek
ffcdd3194d
Merge pull request #27669 from keszybz/man-fixes-254
Some simple man page fixes to reduce the list of issues tagged for v254
2023-05-17 14:12:33 +02:00
Zbigniew Jędrzejewski-Szmek
8fb350049b man: fixes for assorted issues reported by the manpage-l10n project
Fixes #26761.
2023-05-17 12:25:01 +02:00
Zbigniew Jędrzejewski-Szmek
f90360eb74 man/tmpfiles: fix off-by-one in example
Reported and diagnosed by gitterman. Fixes #26617.
2023-05-17 11:18:37 +02:00
Zbigniew Jędrzejewski-Szmek
2f76f1cfae man: explain allowed values for /sys/power/{disk,state}
Also fix the grammar: "neither" can only be used with two values, and
here we have an inderminate number >= 1.

Fixes #26460.
2023-05-17 11:18:26 +02:00
Zbigniew Jędrzejewski-Szmek
42eccfec6e man: say that ProtectClock= also affects reads
Fixes #26413: the docs said that the filter prevents writes, but it just a
filter at the system call level, and some of those calls are used for writing
and reading. This is confusing esp. when a higher level library call like
ntp_gettime() is denied.

I don't think it's realistic that we'll make the filter smarter in the near
future, so let's change the docs to describe the implementation.

Also, split out the advice part into a separate paragraph.
2023-05-17 11:17:39 +02:00
Antonio Alvarez Feijoo
79567763a2 man/systemd-sysext: correct explanation of confexts directories 2023-05-16 18:43:21 +01:00
Mike Yuan
0313c41068
Merge pull request #27638 from YHNdnzj/upheldby-unit-file
unit-file: support UpheldBy= in [Install] settings (adding Upholds= deps from .upholds/)
2023-05-16 21:53:24 +08:00
Lennart Poettering
7e0aaeb244 man: indicate that the JOB parameter to "systemctl cancel" is optional
As per:

https://social.treehouse.systems/@grawity/110376583742207755
2023-05-16 20:18:38 +08:00
Zbigniew Jędrzejewski-Szmek
f44744ff51
Merge pull request #27652 from keszybz/readme-more
Add man page for libsystemd, extend readme and stability promise
2023-05-16 08:51:19 +02:00
nikstur
916db27f16 man: use correct name for --bank option 2023-05-15 23:15:15 +01:00
Zbigniew Jędrzejewski-Szmek
4bc96dc162 man: add libsystemd(3)
Before libsystemd-daemon, libsystemd-journal, libsystemd-id128, etc., were
merged into libsystemd, it was enough to have individual man pages for them.
But they have been delivered as one thing for many years, so it's better to
have a landing page for libsystemd. It mostly directs to individual pages
anyway.
2023-05-15 22:53:22 +02:00
Zbigniew Jędrzejewski-Szmek
778816f4c8 meson: add sd_pid_notify_barrier link
Fixup for 0de343187127f6a5a93602608812e60fc4092c9a.
2023-05-15 22:51:49 +02:00
Mike Yuan
38f901791f
unit-file: support UpheldBy= in [Install] settings (adding Upholds= deps
from .upholds/)

Closes #26896
2023-05-15 15:04:38 +08:00