1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00
Commit Graph

64962 Commits

Author SHA1 Message Date
Daan De Meyer
5fbcad01c1 sd-daemon: Add debug logging 2023-05-31 14:19:25 +02:00
Daan De Meyer
bdee762b8c sd-daemon: Introduce pid_notify_with_fds_internal()
No change in behavior, just refactoring
2023-05-31 14:19:25 +02:00
Daan De Meyer
a0807bdc23 sysv-generator-test: Bump log level to info
Otherwise, non-fatal debug error logs might interfere with the test.
2023-05-31 14:19:25 +02:00
Daan De Meyer
cc11107fd2 test-udev: Skip running in container
Containers generally don't have permission to mknod() which is
required by test-udev so let's skip the test as well if we detect
we're running in a container.
2023-05-30 14:48:38 +02:00
Daan De Meyer
5dcb40a1b0 oom: Make sure temporary test file is in /tmp 2023-05-30 14:48:38 +02:00
Daan De Meyer
abf25fae90 kmod-setup: Load virtio-vsock kernel module early
We might want to send sd-notify over vsock very early on so let's
make sure we load the relevant kernel module as early as possible.
2023-05-30 14:48:38 +02:00
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
afbe20b7d4 shared/loop-util: use longer delay when waiting for loop device
The kernel may be syncing a file system or doing something else that requires
more time. So make the delay a bit longer, but provide some feedback and also
grow the delay exponentially (though with a long exponent). If the kernel is
doing something else, no need to repeat so often. With 38 attempts, we get a
total of slightly above 5000 ms.

I wrote this when I thought that the the delay is not long enough. It turned
out that we were blocking the file system on the loop device, so waiting longer
wasn't helpful. But I think it's nicer to do it this way anyway.
2023-05-30 13:41:56 +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 acc1954a03, 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: acc1954a03 ("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
Mike Yuan
dd3775ab88
Merge pull request #27687 from keszybz/boot-efi-choices
gpt-auto-generator: rework/simplify logic for picking /efi or /boot
2023-05-30 15:21:42 +08:00
James Hilliard
e4086f7dc9 bpf: test with GCC BPF compiler on opensuse 2023-05-30 13:30:28 +09:00
Frantisek Sumsal
e4ab2db9df home: move the assert back to the intended place
98d81cf974 moved the assertion at the beginning of home_dispatch_acquire(),
which is however before we even check for any ongoing operation, hence we
might hit it even in legitimate cases.

Let's move it back to after we check for any possibly ongoing operation, to
make it once again a safety check.

Follow-up to 98d81cf974.
Resolves: #22443 and #24036
2023-05-30 10:00:29 +09:00
James Hilliard
4a7a13b5a0 bpf: stabilize GCC BPF support
Now that we have a GCC release which should support our bpf programs
lets set the minimum version and stabilize it.
2023-05-30 09:27:56 +09:00
Zbigniew Jędrzejewski-Szmek
1d96dae716 dissect: implement the same logic as gpt-auto-generator
gpt-auto-generator does three checks: 1. whether the directory doesn't have
files, 2. whether it's not in fstab, and 3. whether it is not a mount point.
For dissect logic, 3. is not relevant, and it ignores 2.
But the check whether files exists was done only partially: it was done
for /efi, but not for /boot.

Two changes are made:
- the check whether /boot is empty is now done.
- for ESP, /boot is used in preference to /efi, if not used for XBOOTLDR.

With those changes, the logic in dissect matches what gpt-auto-generator does.
There are the two intentional differences described in the first paragraph,
2023-05-30 00:21:44 +02: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 8fb350049b, but
I forgot to save the file.
2023-05-29 12:12:45 +02:00
David Tardon
e30b4c1357 resolvectl: drop extra colon 2023-05-29 11:37:18 +09:00
Yu Watanabe
7b975e9f45 basic/syscall: update syscall list
Only notable change is that memfd_secret is now defined on s390(x).
2023-05-29 06:59:10 +08:00
Luca Boccassi
8340d5003d gpt/DPS: add more aliases for python's machine
In mkosi we set the default architecture to platform.machine() which
is again slightly incompatible for a few architectures, so add more
aliases, so that repart works by default with these names.
2023-05-28 18:33:31 +01:00
Piotr Drąg
059b1b31ad po: add a false positive to POTFILES.skip
Scripts used to detect files that should be in POTFILES.in, like
intltool-update -m used on https://l10n.gnome.org/module/systemd/,
falsely detect this file as containing translations. Avoid this
behavior by putting the file in POTFILES.skip.
2023-05-27 17:17:57 +01:00
Daan De Meyer
30868c1c8d tree-wide: Downgrade a few more noisy log messages to trace 2023-05-27 14:47:56 +02:00
Dan Streetman
b2efe28658 boot/measure: replace TPM PolicyPCR session with calculation
Instead of using a trial policy with a TPM to calculate the measurement hash,
this uses a function to calculate the hash with no TPM needed.
2023-05-27 08:50:04 +02:00
Yu Watanabe
9e39cb2855
Merge pull request #27721 from yuwata/journalctl-cleanup
journalctl: split get_boots() into three
2023-05-27 07:59:22 +09:00
Rene Hollander
58fa558ae4 Add DHCPServer information to JSON output.
Adds a new JSON object called DHCPServer for each interface that has a
DHCPServer configured. It has the following attributes:
- PoolSize and PoolOffset from the configuration
- List of offered leases
- List of static leases from the configuration
2023-05-27 07:58:12 +09:00
Frantisek Sumsal
837773add4 Revert "test: add test case for systemd-update-utmp vs daemon-reexec"
Temporarily revert the test case for #27167, as the additional
daemon-reexecs exacerbate #27287, making CIs fail quite often.
As the #27167 is also covered by TEST-01-BASIC itself, since we do
daemon-reexec there anyway, we shouldn't lose any coverage, but it
should make CIs more stable until #27287 is figured out.

Resolves (or more like works around): #27807

This reverts commit d689f70a2c.
2023-05-27 07:57:20 +09:00
Daan De Meyer
dcc5547b8b
Merge pull request #27517 from ddstreet/tpm2_calculate_policy
Tpm2 calculate policy
2023-05-26 23:08:15 +02:00
Yu Watanabe
e44f06065b journalctl: split get_boots() into three
Previously, get_boots() used for three ways; finding boot entry by
boot ID, finding boot entry by offset, listing up all boot IDs.

Let's split it into three for each usecase.

No functional change, just refactoring.
2023-05-27 03:57:39 +09:00
Yu Watanabe
c93d3c0512 logs-show: introduce add_match_boot_id() helper function 2023-05-27 03:57:01 +09:00
Mike Yuan
97d822abac
Merge pull request #27787 from keszybz/firstboot-synchronous-restart
firstboot: make restart of vconsole-setup synchronuous
2023-05-27 02:30:45 +08:00
Yu Watanabe
d4fd160f69
Merge pull request #27786 from YHNdnzj/format-timestamp-monotonic
time-util,format-table: add relative_monotonic variant for timestamp
2023-05-27 03:05:34 +09:00
Yu Watanabe
f254238204
Merge pull request #27803 from mrc0mmand/even-more-nalloc-shenanigans
A couple more fixes for potential OOM-related issues
2023-05-27 02:58:32 +09:00
Luca Boccassi
08a2bb7b82 gpt/DPS: alias amd64 to x86-64 and aarch64 to arm64
The DSP and our implementation mixes Debian terminology with CPU
terminology. It uses arm64 which is a Debian thing instead of
aarch64, but x86-64 which is a CPU thing instead of amd64.
Add some convenience and transparent aliasing, so that we don't
need to maintain architecture-specific and tool-specific translation
layers in mkosi among other places, while at the same time the DDIs
still look the same (ie: the partlabel does not change depending on
which alias is used, the canonical label is used on disk).
2023-05-26 18:33:35 +01:00
Lennart Poettering
719771adca test-gpt: verify that alias entries are identical to the primary ones
Given we allow aliases we better check for consistency of alias entries
and the primary one.
2023-05-27 02:21:17 +09:00
Dan Streetman
d9a1f1a724 tpm2: add tpm2_calculate_sealing_policy()
This adds a function to fully calculate the authPolicy needed to seal a secret,
and updates tpm2_seal() to use the new function instead of a trial policy.
2023-05-26 11:12:22 -04:00
Dan Streetman
524cef3ff5 tpm2: use tpm2_policy_authorize()
This updates the function to build the sealing policy to use the dedicated
function to perform PolicyAuthorize.

This is separate from the previous commit to make each commit easier to read.
2023-05-26 11:12:22 -04:00
Dan Streetman
5c7852f78c tpm2: add tpm2_policy_authorize()
This adds functions to get the digest for a PolicyAuthorize operation. For
building a policy hash, this provides a function to calculate the hash; and for
building a policy hash to satisfy the authPolicy for an existing object, this
provides a function to perform PolicyAuthorize with an existing session.
2023-05-26 11:12:12 -04:00
Dan Streetman
8a716354bb tpm2: add tpm2_policy_auth_value()
This adds functions to get the digest for a PolicyAuthValue operation. For
building a policy hash, this provides a function to calculate the hash; and for
building a policy hash to satisfy the authPolicy for an existing object, this
provides a function to perform PolicyAuthValue with an existing session.
2023-05-26 11:11:50 -04:00
Dan Streetman
dcbc4674e3 tpm2: add tpm2_policy_pcr()
This adds functions to get the digest for a PolicyPCR operation. For building
a policy hash, this provides a function to calculate the hash; and for building
a policy hash to satisfy the authPolicy for an existing object, this provides a
function to perform PolicyPCR with an existing session.
2023-05-26 11:11:25 -04:00
Dan Streetman
c648a4b85e tpm2: rename pcr_values_size vars to n_pcr_values
Using the n_ prefix is more appropriate/conventional than the _size suffix.

No functional change, this is cosmetic only.
2023-05-26 11:06:53 -04:00
Dan Streetman
dbae4b9535 tpm2: add tpm2_get_name()
This adds functions to get the "name" of a key. The key "name", as defined
by the TPM2 spec, includes its entire public area (with attribute fields),
not only its key fingerprint.

A function is added to calculate the name of a provided key public area,
as well as a function to get the name of a key which is present in the TPM.
2023-05-26 11:06:53 -04:00
Dan Streetman
409a65f829 tpm2: add tpm2_set_auth()
This provides a function to perform the SetAuth TPM function, which provides
the authValue for a key.
2023-05-26 11:06:53 -04:00
Dan Streetman
94a4ff2dc1 tpm2: replace hash_pin() with tpm2_digest_*() functions
The hash_pin() function is just a specific use case of the digest functions.
2023-05-26 11:06:53 -04:00
Dan Streetman
da92d39a85 tpm2: add tpm2_digest_*() functions
These functions allow extending (or initializing) a TPM2B_DIGEST with additional
data, using a specified hash operation. This is needed to perform hash
calculations instead of relying on the TPM to perform the calculations in
trial sessions.
2023-05-26 11:06:20 -04: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
Daan De Meyer
61f695f40a mount-util: Downgrade another noisy debug log to trace level 2023-05-26 17:01:58 +02:00
Luca Boccassi
af262e5fa2 nspawn: restore cross-architecture booting
The check added by 4c27749b8c breaks
booting an arm64 image on x86 using qemu-bin-fmt, so remove it.
Without it, the image built with mkosi --architecture=aarch64
boots fine in nspawn.
2023-05-26 17:00:58 +02:00