1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-11 20:58:27 +03:00

68009 Commits

Author SHA1 Message Date
Lennart Poettering
44c55e5a3f pidref: make signal sending calls take const PidRef 2023-10-18 14:38:07 +02:00
Lennart Poettering
bd389293f0 pidref: make pidref_verify() parameter const 2023-10-18 10:32:03 +02:00
Lennart Poettering
820fe745c7 cgroup-util: rename all return parameters in cgroup-util to ret_xyz 2023-10-18 10:02:43 +02:00
Yu Watanabe
87a768b801 tree-wide: fix typo 2023-10-18 12:40:25 +09:00
Ronan Pigott
06960d1719 network: include SSID in ipv6 stable prefix address generation
The SSID fills the role of the optional Network_ID input parameter
suggested by RFC7217. Including the SSID allows networkd to generate a
different pseudorandom address for different wireless networks, which
should help to obscure the host's identity when roaming between multiple
networks.
2023-10-18 09:48:09 +09:00
Daniel P. Berrangé
a3ad5c3140 repart: avoid use of uninitialized TPM2B_PUBLIC data
The 'TPM2B public' struct is only initialized if the public key
is non-NULL, however, it is unconditionally passed to
tpm2_calculate_sealing_policy, resulting in use of uninitialized
data. If the uninitialized data is lucky enough to be all zeroes,
this results eventually results in an error message from
tpm2_calculate_name about an unsupported nameAlg field value.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-10-17 23:47:02 +01:00
Luca Boccassi
cdc022802c
Merge pull request #29441 from evelikov/no-input-delay
sd-boot: add "menu-disabled" option to "timeout", disabling the 100ms input polling
2023-10-17 23:45:44 +01:00
Lennart Poettering
a104481144 cgroup: turn device cgroup controller "rwm" strings into proper flags
We generally prefer dealing with parsed data instead of original
strings, do so for the "rwm" strings too. We have to convert this to
flags for the primary backend implementation (BPF) anyway, hence we
can do this early to have simpler, shorter and more normalized code.
2023-10-17 23:27:01 +01:00
Luca Boccassi
8e3fb774ae
Merge pull request #29586 from poettering/read-stripped-line
add read_stripped_line() as trivial read_line() + strstrip() combo
2023-10-17 19:54:14 +01:00
Franck Bui
6495361c7d meson: add build option for install path of main config files
This allows distros to install configuration file templates in /usr/lib/systemd
for example.

Currently we install "empty" config files in /etc/systemd/. They serve two
purposes:

- The file contains commented-out values that show the default settings.
- It is easier to edit the right file if it is already there, the user doesn't
  have to type in the path correctly, and the basic file structure is already in
  place so it's easier to edit.

Things that have happened since this approach was put in place:

- We started supporting drop-ins for config files, and drop-ins are the
  recommended way to create local configuration overrides.
- We have systemd-analyze cat-config which takes care of iterating over
  all possible locations (/etc, /run, /usr, /usr/local) and figuring out
  the right file.
- Because of the first two points, systemd-analyze cat-config is much better,
  because it takes care of finding all the drop-ins and figuring out the
  precedence. Looking at files manually is still possible of course, but not
  very convenient.

The disadvantages of the current approach with "empty" files in /etc:

- We clutter up /etc so it's harder to see what the local configuration actually is.
- If a user edits the file, package updates will not override the file (e.g.
  systemd.rpm uses %config(noreplace). This means that the "documented defaults"
  will become stale over time, if the user ever edits the main config file.

Thus, I think that it's reasonable to:

- Install the main config file to /usr/lib so that it serves as reference for
  syntax and option names and default values and is properly updated on package
  upgrades.
- Recommend to users to always use drop-ins for configuration and
  systemd-analyze cat-config to view the documentation.

This setting makes this change opt-in.

Fixes #18420.

[zjs: add more text to the description]
2023-10-17 18:57:45 +02:00
Zbigniew Jędrzejewski-Szmek
ee691c802b
Merge pull request #29242 from fbuihuu/update-main-config-file-headers
config files: update their header to reflect that they can be install…
2023-10-17 18:56:09 +02:00
Emil Velikov
6efdd7fec5 sd-boot: add way to disable the 100ms delay when timeout=0
Currently we have a 100ms delay which allows for people to enter/show
the boot menu even when timeout is set to zero.

In a handful of cases, that may not be needed - both in terms of access
policy, as well as latency.

For example: the option to provide the boot menu may be hidden behind an
"expert only" UX in the OS, to avoid end users from accidentally
entering it.

In addition, the current 100ms input polling may cause unexpected
additional delays in the boot. Some example numbers from my SteamDeck:

 - boot counting/rename/flush doubles 300us -> 600us
 - seed/hash setup doubles 900us -> 1800us
 - kernel/image load gets ~40% slower 107ms -> 167ms

It's not entirely clear why the UEFI calls gets slower, nevertheless the
information in itself proves useful.

This commit introduces a new option "menu-disabled", which omits the
100ms delay. The option is documented throughout the manual pages as
well as the Boot Loader Specification.

v2:
 - use STR_IN_SET

v3:
 - drop erroneous whitespace

v4:
 - add a new LoaderFeature bit,
 - don't change ABI keep TIMEOUT_* tokens the same
 - move new token in the 64bit range, update API and storage for it
 - change inc/dec behaviour to TIMEOUT_MIN : TIMEOUT_MENU_FORCE
 - user cannot opt-in from sd-boot itself, add assert_not_reached()

v5:
 - s/Menu disablement control/Menu can be disabled/
 - rewrap comments to 109
 - use SYNTHETIC_ERRNO(EOPNOTSUPP)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2023-10-17 15:09:53 +01:00
Emil Velikov
5b45fad4fc bootctl, sd-boot: cross document the menu-hidden/force ABI
Document the current state and how we got here.

v2:
 - rewrap command to 109 columns

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2023-10-17 15:01:27 +01:00
Emil Velikov
b9de6a7b94 docs/BOOT_LOADER_INTERFACE: mention that menu-* options are strings
To be on the safe side, explicitly mention that apart from the numerical
entries we can allow string ones.

Implementation-wise, bootctl will use internal numerical values that
match sd-boot's ABI. The latter also accepts the string options.

Going forward we'd like to avoid adding more internal magic and be more
explicit.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2023-10-17 14:59:26 +01:00
Frantisek Sumsal
41231bec0c test: don't restart journal-upload on an expected fail
In c08bec1587 the journal-upload unit gained Restart=on-fail, which goes
against this one particular test that expects the unit to fail, making
the test flaky. Let's disable the automatic restarts just for this test
to make it stable once again.
2023-10-17 14:55:12 +01:00
Lennart Poettering
0ff6ff2b29 tree-wide: port various parsers over to read_stripped_line() 2023-10-17 14:36:54 +02:00
Lennart Poettering
c56cb33f09 fileio: add read_stripped_line() as trivial read_line() + strstrip() combo 2023-10-17 14:36:54 +02:00
Mike Yuan
74b2c22fd7 docs/FILE_DESCRIPTOR_STORE: NotifyAccess=cgroup -> all
Fixes #29590
2023-10-17 11:59:38 +01:00
Mike Yuan
707ecf1423 core/mount: allow disabling stop propagation from backing device
With file systems that have volume management functionalities or
volume managers like LVM, it's fine for the backing device of a mount
to disappear after mounted. Currently, we enforce BindsTo= or
StopPropagatedFrom= on the backing device, thus prohibiting such
cases. Instead, let's make this configurable through x-systemd.device-bound.

Closes #16801
Closes #29543
2023-10-17 11:23:36 +01:00
Yu Watanabe
dced8fe402
Merge pull request #29588 from keszybz/net-naming-scheme-255
Untangle the net-naming-scheme mess with SR-IOV-R "representor" information
2023-10-17 19:18:29 +09:00
Matthias Schiffer
84ff5894db rules: add mtd/by-name symlinks
Add persistent symlinks for MTD devices like SPI-NOR flash, based on the
partition names specified on the cmdline, in a Device Tree, or by other
MTD partitioning parser drivers. Using the persistent name can be
preferable to using the numbered /dev/mtdX device, as the latter can
change depending on probe order or when partitioning has changed.
2023-10-17 11:43:30 +02:00
Daan De Meyer
37ba73b1b2
Merge pull request #28373 from DaanDeMeyer/udevadm-query
Add --json and filtering options for --export-db to udevadm info
2023-10-17 10:16:43 +02:00
Jan Janssen
79f4870384 meson: Fix unused format parameter warning 2023-10-17 12:15:07 +08:00
Nick Rosbrook
869c1cf88f nspawn: check if we can set CoredumpReceive= before doing so
If systemd-nspawn is newer than the running systemd, we might try to set
CoredumpReceive=yes when systemd doesn't know about it yet. Try and
check if the running systemd is aware of this setting, and if not, don't
try and use it.

Fixes 411d8c72ec
("nspawn: set CoredumpReceive=yes on container's scope when --boot is set").
2023-10-16 22:53:50 +02:00
Zbigniew Jędrzejewski-Szmek
386256e699 test: make sure that the default naming scheme name maps back to itself
We were testing the that C constant is defined, but we weren't actually testing
that the string name maps back to itself. This would catch the issue fixed by
the grandparent commit.

The test for the default name is moved to the test file to keep the tests
together. The define is renamed to not have "_TEST" in the name. The issue here
is complicated by the fact that we allow downstreams to inject additional
fields, so we don't know the name of the default scheme if it not set with
-Ddefault-net-naming-scheme=, so _DEFAULT_NET_NAMING_SCHEME[_TEST] is not
defined in all cases, but at least in principle it could be used in other
places. If it exists, it is fully valid.
2023-10-16 21:21:54 +02:00
Zbigniew Jędrzejewski-Szmek
8b01831950 shared/netif-naming-scheme: align tables 2023-10-16 21:21:54 +02:00
Zbigniew Jędrzejewski-Szmek
64f2cf77d1 NEWS, man: move description of SR-IOV-R net naming to v255
https://github.com/systemd/systemd/pull/29582 adds the "v254" name. This also
changes what the default is and what "latest" refers to. Without the name, the
code could be enabled via runtime configuration. Nevertheless, it could be
enabled at compilation time. In other words:
  meson setup build -Ddefault-net-naming-scheme=v254
would work, but
  net.naming-scheme=v254
would fail.

It is possible that people were using the compile-time override, so I think
we should allow "v254" scheme to stay and clearly document that it wasn't the
default.

Unfortunately, unless people manually introduced the compile-time override, we
were never actually testing the new code too. So all the pull request testing
was not useful.
2023-10-16 21:21:54 +02:00
Antonio Alvarez Feijoo
acd3f69217 net_id: add missing naming scheme name for v254
Follow up to 88d2bda8120dcc375a90e28b64de06b9646ab3b6
2023-10-16 21:19:54 +02:00
Lennart Poettering
e0eb051f95
Merge pull request #29546 from poettering/run-invoc-id
run: output invocation ID when starting service and scope units
2023-10-16 19:00:18 +02:00
Daan De Meyer
a6b4b2fa01 udev: Enable filtering the output of udevadm info --export-db
Let's support the same filtering options that we also support in
udevadm trigger in udevadm info to filter the devices produced by
--export-db.

One difference is that all properties specified by --propery-match=
have to be satisfied in udevadm info unlike udevadm trigger where just
one of them has to be satisfied.
2023-10-16 17:02:00 +02:00
Lennart Poettering
cde8cc946b
Merge pull request #29272 from enr0n/coredump-container
coredump: support forwarding coredumps to containers
2023-10-16 16:13:16 +02:00
Luca Boccassi
7c83d42ef8 mount-util: use mount beneath to replace previous namespace mount
Instead of mounting over, do an atomic swap using mount beneath, if
available. This way assets can be mounted again and again (e.g.:
updates) without leaking mounts.
2023-10-16 14:33:47 +01:00
Lennart Poettering
f5e6f3117c
Merge pull request #29548 from poettering/sysext-varlink
sysext: add a varlink IPC interface
2023-10-16 15:10:24 +02:00
Lennart Poettering
6c16c87baf
Merge pull request #29562 from poettering/namespace-fuckup-fix
namespace: normalize memory management of mount list
2023-10-16 15:10:08 +02:00
Lennart Poettering
4d4c4ae9cb update TODO 2023-10-16 14:30:11 +02:00
Lennart Poettering
49a510eba2 run: pin the unit we invoke continously while we are running
We read properties of the unit, hence it shouldn't be GC'ed as long as
we run. Hence, let's just set AddRef unconditionally for the units we
create.
2023-10-16 14:30:11 +02:00
Lennart Poettering
7693661a84 run: output invocation ID when starting service and scope units 2023-10-16 14:30:11 +02:00
Lennart Poettering
7fcd134399 namespace: add // FIXME comments on some suplicate logging
@bluca thinks duplicate logging as a feature, hence simply mark these
log messages as // FIXME, but don't bother.
2023-10-16 13:35:36 +02:00
Lennart Poettering
d4f0878e02 namespace: downgrade log messages to LOG_DEBUG
almost all code in namespace.c only logs at debug level as it is
"library-like" code. But there are some outliers. Adjust them to match
the rest of the code

(Well, there are some left)
2023-10-16 13:35:28 +02:00
Lennart Poettering
283eb4fdd1 namespace: don't retry to a mount if we didn't actually manage to create an inode 2023-10-16 13:18:03 +02:00
Lennart Poettering
3c36f7636c namespace: downgrade log message of error we ignore to LOG_WARNING
frankly, the log message shouldn't be there at all, but the error path
be propagated up, with a recognizable error code. But apparently this is
important to @bluca.
2023-10-16 13:17:59 +02:00
Lennart Poettering
3d1b999b53 namespace: convert ProtectHostname= logic to a static table
Let's simplify things, and make them more alike handling more similar to
the other ProtectXYZ= settings.
2023-10-16 13:12:48 +02:00
Daan De Meyer
d6e5f170ef Add --json switch to udevadm info
This allows getting the udevadm info --export-db and query "all" output
as JSON.
2023-10-16 13:01:54 +02:00
Lennart Poettering
063c977a79 namespace: normalize memory management of mount list
So far we calculated exactly how many mounts we will generate, which is
a bit fragile, and easy to get wrong.

Let's normalize this, and grow the array of mounts as we need.

Various other modernizations while we are at it, such as FOREACH_ARRAY
usage, or `_cleanup_` usage.
2023-10-16 12:17:56 +02:00
Lennart Poettering
dbf9e04591 update TODO 2023-10-16 12:08:40 +02:00
Lennart Poettering
f5151fb459 sysext: make some calls available via varlink 2023-10-16 12:08:39 +02:00
Lukas
c7fda70716 stub: NULL checks for DeviceHandle and FilePath
UKIs may be loaded in a way, that there can not be a device handle to
the filesystem, that contains the image, for example when using a
bootloader to load the image from a partition with a file system that is
not supported by the firmware.

With the current systemd stub, this causes a failed assertion, because
stub gets passed a NULL DeviceHandle and FilePath. Inserting two
explicit checks enables proper boot even in this case.

Fixes: #29331
2023-10-16 10:44:03 +02:00
Daan De Meyer
36d87065f2
Merge pull request #29558 from mrc0mmand/varlinkctl-tests
varlink: add a couple of tests + accompanying fixes
2023-10-16 09:49:42 +02:00
Vishal Chillara Srinivas
57cf92f741 resolve: fix no mDNS announcement after probing
According to RFC 6762 section 8, an mDNS responder is supposed to announce its
records after probing.
Currently, there is a check in dns_scope_announce which returns if there are any
pending transactions. This prevents announcements from being sent out even if there
are pending non-probe transactions.

To fix this, return only if there are active probe transactions.
2023-10-16 09:21:51 +02:00
Jan Janssen
e9e40862de fuzz: Add fuzzer for efi conf/osrel parsing 2023-10-15 17:41:25 +02:00