1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-01 09:47:35 +03:00

70561 Commits

Author SHA1 Message Date
Yu Watanabe
6f09031e4d network/route: introduce reverse map for route with nexthop ID
It is not used in this commit, but will be used later.
Preparation for later commits.

This is the one for routes of 531c7246829a41dd7e51847bd4d77aa012ff478f.
2024-01-25 16:43:44 +09:00
Yu Watanabe
97979ece0e network/route: also remove route on cancelling request
Otherwise, the route may arrive after we call
link_drop_foreign_address() or so on reconfiguring interface.

This is the one for routes of 4303e9806befc0c5b8067e45225e5d952f427b3a.
2024-01-25 16:43:44 +09:00
Yu Watanabe
d529b12a01 network/route: drop Route object even if we fail to remove the route
If we could not remove a route, then previously the corresponding
Route object was never removed, as it was freed only when we receive
remove notification from the kernel. So, we might confused that the
route still exists and being removed, and might block reconfiguring
the route.

With this change, even if we fail to remove a route, the corresponding
Route object will be freed.

This is the one for routes of 56a995fe8e50b2432ff930ed0431cc70adbe492d.
2024-01-25 16:43:44 +09:00
Yu Watanabe
74c301b9ee network/route: introduce ref/unref functions for Route object
Then, Route object can live if it is detached from the owner (Manager,
Network, or Wireguard object).

This is the one for routes of ebd96906477aac2bbc6b9de0d6e9bd0f39db5581.
2024-01-25 16:43:44 +09:00
Yu Watanabe
3caed9ea08 network/route: introduce route_remove_and_cancel()
Then, replace route_remove_and_drop() with it.

If a route is requested, and the request is already called,
we may not received its reply and notification from the kernel, and
the corresponding Route object may not be remembered. Even in such
case, we need to remove the route, otherwise the route will come
later after the function called.

This is the version for route of f22b586a215962416bdbd692aabb89b1ac2999d0.
2024-01-25 16:43:44 +09:00
Mike Yuan
6b7309b6fb
Merge pull request #31072 from YHNdnzj/va-arg-foreach
tree-wide: replace FOREACH_POINTER with FOREACH_ARGUMENT (VA_ARGS_FOREACH)
2024-01-25 15:22:07 +08:00
Frantisek Sumsal
0652cf8e7b test: use the default nsec3-iterations value
In Knot 3.2 the nsec3-iterations default was changed to 0 and Knot now
issues a warning if the value is > 0. Let's just use the default value,
since it's not something that's important for our tests.
2024-01-24 21:30:28 +00:00
Mikko Ylinen
7ff0e0a5e0 efi: Add EFI CC measurement protocol to stub
In confidential computing, a virtual firmware may support measurement and
event log based upon the hardware Trusted Execution Environment (TEE)
capability.

The UEFI specification defines an interface between the virtual guest OS
and virtual firmware as EFI_CC_MEASUREMENT_PROTOCOL. The (vendor specific)
measurements are captured in the CC eventlog that follows the TCG2 format.

OVMF virtual firmware has the EFI_CC_MEASUREMENT_PROTOCOL support for
Intel Trust Domain Extensions (TDX). Intel TDX has 4 runtime measurement
registers (RTMR) defined as:

RTMR[0] for TDVF configuration
RTMR[1] for the TD OS loader and kernel
RTMR[2] for the OS application
RTMR[3] reserved for special usage only

The RTMR to PCR mappings are defined in the UEFI Spec 2.10 Section 38.4.1
as follows:

TPM PCR Index | CC Measurement Register Index | TDX-measurement register
------------------------------------------------------------------------
0             |   0                           |   MRTD
1, 7          |   1                           |   RTMR[0]
2-6           |   2                           |   RTMR[1]
8-15          |   3                           |   RTMR[2]

The CC measurement eventlog is currently exposed as a raw CCEL ACPI table
by the guest OS and the events can be replayed to check log matches with
the RTMR values.

Add EFI CC measurement protocol to stub to get the UKI components measured
and included in the remote attestation reports when vTPMs are not available.
2024-01-24 21:30:12 +00:00
Luca Boccassi
d6bf9b612c mkosi: install libip4tc2 in debian/ubuntu
It's now a dlopen library and it is installed at build time via
libiptc-dev, but was never added to the running image.

Follow-up for 5b5f8f8b9aef405cdc42771e7876988d5aefb51e
2024-01-24 19:58:07 +00:00
Andrew Sayers
cd752b2590 Make RestartPreventExitStatus= documentation resemble SuccessExitStatus=
The documentation for `RestartPreventExitStatus=` differs from that for `SuccessExitStatus=` in ways that are sometimes confusing (e.g. using `numeric exit codes` instead of `numeric termination statuses`), and other times plain incorrect (e.g. not mentioning `termination status names`, which I've just confirmed to work in systemd 255).

This patch modifies the documentation to be as similar as possible, so as to reduce the reader's cognitive load.
2024-01-24 18:00:53 +01:00
Daan De Meyer
98118c44ae Remove a few references to dracut
Let's remove some explicit references to dracut as we prefer initrds
built with mkosi these days.
2024-01-24 17:54:38 +01:00
Mike Yuan
2d70878162
tree-wide: replace FOREACH_POINTER with FOREACH_ARGUMENT
The latter is more generic and while being compatible with
the former.
2024-01-24 21:29:11 +08:00
Mike Yuan
e9a46668c3
macro: rename VA_ARGS_FOREACH to FOREACH_ARGUMENT
"VA_ARGS" is kinda confusing, as the macro just iterates through
all arguments passed and has nothing to do with va_arg.
2024-01-24 21:21:57 +08:00
Yu Watanabe
8d01e44c1f network/route: manage all routes by Manager object
Previously, a Route object is owned by a Link object corresponding to the
outgoing interface of the route, and a Route object that does not have
outgoing interface is owned by the Manager object.

However, there were several issues:
- if a route has a nexthop ID, then the corresponding nexthop may be
  changed to use another interface, hence the outgoing interface of the
  route may be changed.
- if a route requested with MultiPathRoute=, then the link who requests
  the route is different from the outgoing interface of the configured
  route. So, we need to find routes on other interfaces on reconfiguring
  or so.

By this change, the limit of the number of routes per-interface is
tentatively dropped. Let's re-introduce the limit later in a nicer way.
2024-01-24 21:52:33 +09:00
Takashi Sakamoto
bd922111fd hwdb: ieee1394-unit-function: adjustment of entries with device attributes available in Linux v6.8
The series of changes[1] has been merged to Linux v6.8-rc1[2], which
alters the parser of the content of configuration ROM. As a result, some
device attributes for model information in the legacy layout of
configuration ROM are finally available for node and unit devices. The
change enables to distinguish the devices by model information, and what
is required in systemd PR 30205[3]. It can improve the hwdb for IEEE 1394
functions in the point addressed at issue 25029[4].

This commit fulfills some entries for the hwdb, which corresponds to some
devices with the legacy layout of configuration ROM. They provides both
vendor and model names to udev applications.

[1] https://lore.kernel.org/lkml/20240110111331.GA138108@workstation.local/
[2] https://lore.kernel.org/lkml/CAHk-=wiB4iHTtfZKiy5pC24uOjun4fbj4kSX0=ZnGsOXadMf6g@mail.gmail.com/
[3] https://github.com/systemd/systemd/pull/30205
[4] https://github.com/systemd/systemd/issues/25029
2024-01-24 19:37:09 +09:00
Mike Yuan
f789041c4a
id128-util: use FOREACH_STRING where appropriate 2024-01-24 17:09:45 +08:00
Lennart Poettering
8a9bf03bd7
Merge pull request #31003 from enr0n/skip-test-when-apparmor-restricts-userns
Skip more tests when apparmor restricts unprivileged user namespaces
2024-01-24 09:58:07 +01:00
Lennart Poettering
ed4498a193
Merge pull request #31067 from RA-Kooi/xen-uuid
machine-id-setup: Generate stable machine IDs on Xen virtual machines.
2024-01-24 09:35:30 +01:00
Yu Watanabe
6f5c0fafcc
Merge pull request #31070 from yuwata/core-cleanups
core: several trivial cleanups
2024-01-24 16:31:37 +09:00
Yu Watanabe
330c080eeb core/exec-invoke: drop unused pam_pid 2024-01-24 14:43:18 +09:00
Yu Watanabe
c917a80701 core/service: declare 'int r' at the beginning 2024-01-24 14:43:18 +09:00
Yu Watanabe
ae6a9e650c unit: modernize unit_pid_set() 2024-01-24 14:43:18 +09:00
Yu Watanabe
b826e31754 core: use helper functions like unit_main_pid() in unit_kill_context()
No functional changes. Just refactoring.
2024-01-24 14:43:18 +09:00
Yu Watanabe
3e22239da7 core: introduce unit_main_pid_full() which optionally provides if the PID is alien or not 2024-01-24 14:43:18 +09:00
Yu Watanabe
d70dfe1b27 core: constify PidRef arguments 2024-01-24 14:43:18 +09:00
Rafaël Kooi
9fe1f1ca95 man: Describe how machine ID is initialized on Xen 2024-01-24 02:19:00 +01:00
Lennart Poettering
269f70de78 nspawn: fix separating empty lines in --help text
When I added the --background= switch I placed the empty line that was
supposed to separate the options from the next section before the switch
rather than after. Fix that.

To make issues like this harder to run into next time, let's move the \n
from the end of the preceeding line to the beginning of the section
title, since that's pretty much where they belong to.

Follow-up for: 3d8ba7b83f254ec9e137210630a602001674e4d0
2024-01-23 23:24:19 +00:00
Ivan Shapovalov
a97476c8ac hostname-setup: read hostname from system.hostname credential
`system.hostname` credential is treated similarly to the pre-existing
`system.machine_id` credential. It is considered after /etc/hostname,
but prior to the kernel defaults or os-release defaults.

Fixes #30667.

Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
2024-01-23 22:03:06 +00:00
Luca Boccassi
f70daee8f2
Merge pull request #30130 from poettering/pcrlock-root
pcrlock: add support for unlocking a root fs with a pcrlock file
2024-01-23 21:41:02 +00:00
Lennart Poettering
e944d3ab92
Merge pull request #31026 from poettering/nspawn-tint
nspawn: allow tinting the background of interactive tty sessions
2024-01-23 22:32:00 +01:00
Lennart Poettering
a575f2148f repart: don't try to determine sector size from a disk image we should consider empty
If we are told to start from scratch we shouldn't look into the old
image to determine sector size. Looking there is confusing at best, but
plain wrong in many other cases.
2024-01-23 19:58:08 +00:00
Lennart Poettering
ab36d7c975 preset: add some alphabetical sorting
I think the existing sections in the preset file make sense, but
alphabetical ordering is kinda cool too.

try to find a middle ground, and at least sort within each section.

No actual change of behaviour, just some reordering of lines.
2024-01-23 19:57:23 +00:00
Nick Rosbrook
d0c6136f51 test-execute: skip tests that are broken without unprivileged userns
With newer versions of AppArmor, unprivileged user namespace creation
may be restricted by default, in which case user manager instances will
not be able to apply PrivateUsers=yes (or the settings which require it).
Additionally, if a kernel has the kernel.unprivileged_userns_clone
sysctl patch, and that sysctl is 0, then unprivileged userns creation
will always fail.

If a test unit is going to be run in a user manager, and that unit
requires PrivateUsers=yes (explicitly or implicitly), then skip it if
we do not have user namespace privileges.
2024-01-23 14:19:56 -05:00
Rafaël Kooi
98d550baa9 machine-id-setup: Generate stable machine IDs based on Xen hypervisor UUID 2024-01-23 18:55:15 +01:00
Rafaël Kooi
d2f2c20a6d id128-util: Attempt to read UUID from /sys/hypervisor/uuid
When using the Xen hypervisor the virtual machine UUID is exposed here.
This is useful when one needs stable IPv4 address assignment, e.g. for a
set of RAM nodes that are built from a template.
2024-01-23 18:55:15 +01:00
Lennart Poettering
9603fd29f8 dissect: show image name separately from filename
If the image name is different from the filename then show it in the
output, since it's relevant for finding sysext/confext release files.

(Image name is typically the filename without the ".raw" suffix and
similar).
2024-01-24 01:33:48 +08:00
Lennart Poettering
a609b3eab7 unit: systemd-creds.socket is statically enabled, hence drop [Install]
This is statically enabled, hence needs to [Install] section.
2024-01-24 01:31:13 +08:00
Frantisek Sumsal
5ed55a9bad packit: use the closest matching tag for the checked out revision
Packit otherwise tries to get the latest tag by creation date, which
doesn't work well in the systemd-stable repo:

2024-01-23 13:40:47.858 upstream.py       DEBUG  No ref given or is not glob pattern
2024-01-23 13:40:47.859 upstream.py       DEBUG  We're about to get latest matching tag in the upstream repository /tmp/tmp07g2beo8.
2024-01-23 13:40:47.859 commands.py       DEBUG  Command: git tag --list --sort=-creatordate
2024-01-23 13:40:47.866 logging.py        DEBUG  v248.13
2024-01-23 13:40:47.866 logging.py        DEBUG  v249.17
2024-01-23 13:40:47.866 logging.py        DEBUG  v250.14
2024-01-23 13:40:47.866 logging.py        DEBUG  v251.20
2024-01-23 13:40:47.867 logging.py        DEBUG  v252.21
2024-01-23 13:40:47.867 logging.py        DEBUG  v253.15
2024-01-23 13:40:47.867 logging.py        DEBUG  v254.8
2024-01-23 13:40:47.867 logging.py        DEBUG  v255.2
2024-01-23 13:40:47.868 logging.py        DEBUG  v255.1
2024-01-23 13:40:47.868 logging.py        DEBUG  v255
...
2024-01-23 18:15:13 +01:00
Lennart Poettering
8bf3891e8e nspawn: tint the terminal bg blue if we are in a container
Let's give people a hint that they are not operating on the host.
2024-01-23 16:45:37 +01:00
Lennart Poettering
3ef072ee26 pretty-print: split out color tinting into a helper of its own 2024-01-23 16:45:37 +01:00
Lennart Poettering
f9bc96f657 color-util: make return values of rgb_to_hsv() optional
When we want to tint the bg color we don't care about the hue, we want
to set it ourself after all, hence make the arguments optional, so that
we don't even have to ask for it.
2024-01-23 16:45:37 +01:00
Lennart Poettering
3d8ba7b83f nspawn: optionally tint the background color of a container 2024-01-23 16:45:37 +01:00
Lennart Poettering
9ebd1153ef
Merge pull request #31061 from yuwata/pidref_copy
pidref: add basic tests for PidRef, and split out pidref_copy() from pidref_dup()
2024-01-23 16:28:01 +01:00
Frantisek Sumsal
43b238f1c1 man: suffix signals with ()
Since signals can take arguments, let's suffix them with () as we
already do with functions. To make sure we remain consistent, make the
`update-dbus-docs.py` script check & fix any occurrences where this is
not the case.

Resolves: #31002
2024-01-23 16:27:50 +01:00
Lennart Poettering
3bda8bc58c
Merge pull request #31057 from aafeijoo-suse/bootctl-print-fix
bootctl: return earlier with `--print-esp-path`
2024-01-23 14:26:25 +01:00
Yu Watanabe
232e66217d pidref: split out pidref_copy() from pidref_dup() 2024-01-23 22:21:44 +09:00
Lennart Poettering
03a83186be varlink: make sure varlink_server_detach_event() doesn't leave invalid pointer around 2024-01-23 14:17:43 +01:00
Yu Watanabe
d203659a13 test: add basic tests for PidRef 2024-01-23 22:09:32 +09:00
Lennart Poettering
0db917f759
Merge pull request #31019 from poettering/hostnamed-full-os-release
hostnamed: expose full /etc/os-release data in hostnamectl's --json= output
2024-01-23 12:28:41 +01:00
Martin Trigaux
3af9d86eb7 Remove duplicated command in help message
"systemctl reboot" was present twice in the message, should be halt instead
2024-01-23 10:44:36 +00:00