]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoman: clarify sd_bus_default 27357/head
Luca Boccassi [Sat, 22 Apr 2023 11:47:20 +0000 (12:47 +0100)] 
man: clarify sd_bus_default

It picks the bus based on the cgroup slice.

2 years agoman: add working example to LogControl1 manpage
Luca Boccassi [Fri, 21 Apr 2023 22:35:08 +0000 (23:35 +0100)] 
man: add working example to LogControl1 manpage

Add fully working and documented example that can be copied and pasted

2 years agosulogin-shell: Start initrd.target on exit in the initrd
Daan De Meyer [Fri, 21 Apr 2023 11:01:24 +0000 (13:01 +0200)] 
sulogin-shell: Start initrd.target on exit in the initrd

sulogin is documented to continue booting up on exit. To do that
in the initrd, we need to start initrd.target and not default.target.

2 years agoMerge pull request #27352 from poettering/devnum-more
Lennart Poettering [Fri, 21 Apr 2023 14:45:51 +0000 (16:45 +0200)] 
Merge pull request #27352 from poettering/devnum-more

devnum-util: port more things over

2 years agomkosi: Use authselect minimal if authselect is installed
Daan De Meyer [Thu, 20 Apr 2023 08:13:37 +0000 (10:13 +0200)] 
mkosi: Use authselect minimal if authselect is installed

We dropped this logic from mkosi itself, so let's configure it in
our postinst script instead. We also enable the with-homed feature
if we can find it. It doesn't exist for the minimal profile yet,
but might be added in the future.

2 years agomkosi: remove ?priority(required) from debian pkg list
Luca Boccassi [Thu, 20 Apr 2023 22:48:58 +0000 (23:48 +0100)] 
mkosi: remove ?priority(required) from debian pkg list

Requires apt 2.3.10 which is not available in stable, and also doesn't
seem necessary, same packages are installed anyway
Add tzdata manually, as that doesn't seem to be pulled in via the CI.

2 years agotre-wide: use FORMAT_DEVNUM() a bit more 27352/head
Lennart Poettering [Fri, 21 Apr 2023 10:39:28 +0000 (12:39 +0200)] 
tre-wide: use FORMAT_DEVNUM() a bit more

2 years agotree-wide: convert more cases do DEVNUM_FORMAT_STR()/DEVNUM_FORMAT_VAL()
Lennart Poettering [Fri, 21 Apr 2023 10:34:37 +0000 (12:34 +0200)] 
tree-wide: convert more cases do DEVNUM_FORMAT_STR()/DEVNUM_FORMAT_VAL()

Let's use our nice macros a bit more.

(Not comprehensive)

2 years agoMerge pull request #27349 from mrc0mmand/codespell
Luca Boccassi [Thu, 20 Apr 2023 21:02:17 +0000 (22:02 +0100)] 
Merge pull request #27349 from mrc0mmand/codespell

tree-wide: code spelling fixes

2 years agoREADME: add a Weblate badge 27349/head
Frantisek Sumsal [Thu, 20 Apr 2023 20:06:28 +0000 (22:06 +0200)] 
README: add a Weblate badge

2 years agotree-wide: code spelling fixes
Frantisek Sumsal [Thu, 20 Apr 2023 19:54:59 +0000 (21:54 +0200)] 
tree-wide: code spelling fixes

As reported by Fossies.

2 years agodetect-virt: add message at debug level
Zbigniew Jędrzejewski-Szmek [Thu, 20 Apr 2023 15:42:57 +0000 (17:42 +0200)] 
detect-virt: add message at debug level

Normal users do not have permissions to access /proc/1/root, so
'systemd-detect-virt -r' fails, but the output, even at debug level
is cryptic:

$ SYSTEMD_LOG_LEVEL=debug build/systemd-detect-virt -r
Failed to check for chroot() environment: Permission denied

Let's make this a bit easier to figure out:

$ SYSTEMD_LOG_LEVEL=debug build/systemd-detect-virt -r
Cannot stat /proc/1/root: Permission denied
Failed to check for chroot() environment: Permission denied

I looked over other users of files_same(), and I think in general the message
at debug level is OK for them too.

2 years agoApply known iocost solutions to block devices
Gustavo Noronha Silva [Mon, 2 May 2022 17:02:23 +0000 (14:02 -0300)] 
Apply known iocost solutions to block devices

Meta's resource control demo project[0] includes a benchmark tool that can
be used to calculate the best iocost solutions for a given SSD.

  [0]: https://github.com/facebookexperimental/resctl-demo

A project[1] has now been started to create a publicly available database
of results that can be used to apply them automatically.

  [1]: https://github.com/iocost-benchmark/iocost-benchmarks

This change adds a new tool that gets triggered by a udev rule for any
block device and queries the hwdb for known solutions. The format for
the hwdb file that is currently generated by the github action looks like
this:

  # This file was auto-generated on Tue, 23 Aug 2022 13:03:57 +0000.
  # From the following commit:
  # https://github.com/iocost-benchmark/iocost-benchmarks/commit/ca82acfe93c40f21d3b513c055779f43f1126f88
  #
  # Match key format:
  # block:<devpath>:name:<model name>:

  # 12 points, MOF=[1.346,1.346], aMOF=[1.249,1.249]
  block:*:name:HFS256GD9TNG-62A0A:fwver:*:
    IOCOST_SOLUTIONS=isolation isolated-bandwidth bandwidth naive
    IOCOST_MODEL_ISOLATION=rbps=1091439492 rseqiops=52286 rrandiops=63784 wbps=192329466 wseqiops=12309 wrandiops=16119
    IOCOST_QOS_ISOLATION=rpct=0.00 rlat=8807 wpct=0.00 wlat=59023 min=100.00 max=100.00
    IOCOST_MODEL_ISOLATED_BANDWIDTH=rbps=1091439492 rseqiops=52286 rrandiops=63784 wbps=192329466 wseqiops=12309 wrandiops=16119
    IOCOST_QOS_ISOLATED_BANDWIDTH=rpct=0.00 rlat=8807 wpct=0.00 wlat=59023 min=100.00 max=100.00
    IOCOST_MODEL_BANDWIDTH=rbps=1091439492 rseqiops=52286 rrandiops=63784 wbps=192329466 wseqiops=12309 wrandiops=16119
    IOCOST_QOS_BANDWIDTH=rpct=0.00 rlat=8807 wpct=0.00 wlat=59023 min=100.00 max=100.00
    IOCOST_MODEL_NAIVE=rbps=1091439492 rseqiops=52286 rrandiops=63784 wbps=192329466 wseqiops=12309 wrandiops=16119
    IOCOST_QOS_NAIVE=rpct=99.00 rlat=8807 wpct=99.00 wlat=59023 min=75.00 max=100.00

The IOCOST_SOLUTIONS key lists the solutions available for that device
in the preferred order for higher isolation, which is a reasonable
default for most client systems. This can be overriden to choose better
defaults for custom use cases, like the various data center workloads.

The tool can also be used to query the known solutions for a specific
device or to apply a non-default solution (say, isolation or bandwidth).

Co-authored-by: Santosh Mahto <santosh.mahto@collabora.com>
2 years agoMerge pull request #27327 from DaanDeMeyer/hotplug
Lennart Poettering [Thu, 20 Apr 2023 14:34:12 +0000 (16:34 +0200)] 
Merge pull request #27327 from DaanDeMeyer/hotplug

kmod-setup: Add early loading for virtio_console

2 years agokmod-setup: Add early loading for virtio_console 27327/head
Daan De Meyer [Tue, 18 Apr 2023 11:20:37 +0000 (13:20 +0200)] 
kmod-setup: Add early loading for virtio_console

getty-generator enables serial-getty@.service for virtualizer consoles
that it can find in /sys/class/tty. To make sure this works for
virtio consoles, let's make sure we load the module is loaded early
so that the /sys/class/tty/hvc0 exists before we run getty-generator.

2 years agocore: Parse logging environment earlier
Daan De Meyer [Tue, 18 Apr 2023 11:15:20 +0000 (13:15 +0200)] 
core: Parse logging environment earlier

Let's make sure we parse the logging environment ASAP so that the
options apply to more code. e.g. to allow debugging kmod-setup.c
for example.

2 years agokmod-setup: Introduce match_modalias_recurse_dir_cb()
Daan De Meyer [Tue, 18 Apr 2023 08:47:13 +0000 (10:47 +0200)] 
kmod-setup: Introduce match_modalias_recurse_dir_cb()

Let's make the logic around matching a modalias a bit more generic.

2 years agostring-util: Add startswith_strv()
Daan De Meyer [Tue, 18 Apr 2023 11:11:45 +0000 (13:11 +0200)] 
string-util: Add startswith_strv()

This is the function version of STARTSWITH_SET(). We also move
STARTSWITH_SET() to string-util.h as it fits more there than in
strv.h and reimplement it using startswith_strv().

2 years agomkosi: Disable kmsg ratelimiting
Daan De Meyer [Thu, 20 Apr 2023 08:33:10 +0000 (10:33 +0200)] 
mkosi: Disable kmsg ratelimiting

2 years agolog: Log when kmsg is being ratelimited
Daan De Meyer [Thu, 20 Apr 2023 08:43:21 +0000 (10:43 +0200)] 
log: Log when kmsg is being ratelimited

Let's avoid confusing developers and users when log messages suddenly
stop getting logged to kmsg because of ratelimiting by logging an
additional message if we start ratelimiting log messages to kmsg.

2 years agolog: Add knob to disable kmsg ratelimiting
Daan De Meyer [Thu, 20 Apr 2023 08:31:37 +0000 (10:31 +0200)] 
log: Add knob to disable kmsg ratelimiting

This allows us to disable kmsg ratelimiting in the integration tests
and mkosi for easier debugging.

2 years agodissect: let's check for crypto_LUKS before fstype allowlist check
Lennart Poettering [Thu, 20 Apr 2023 09:14:50 +0000 (11:14 +0200)] 
dissect: let's check for crypto_LUKS before fstype allowlist check

When trying to mount a partition that is encrypted without the
encryption first having been set up we want to return a
recognizable error (EUNATCH). This was broken by
80ce8580f5aa6b03fa13a0b3b30207bc9b5c5fe0 which added an allowlist check
for permissible file systems first. Let's reverse the check order, so
that we get EUNATCH again, as before. (And leave EIDRM as error for the
failed allowlist check).

2 years agoratelimit: handle counter overflows somewhat sanely
Lennart Poettering [Thu, 20 Apr 2023 08:31:44 +0000 (10:31 +0200)] 
ratelimit: handle counter overflows somewhat sanely

An overflow here (i.e. the counter reaching 2^32 within a ratelimit time
window) is not so unlikely. Let's handle this somewhat sanely
and simply stop counting, while remaining in the "limit is hit" state until
the time window has passed.

2 years agoman: try to make clearer that /var/ is generally not available in /usr/lib/systemd...
Lennart Poettering [Thu, 20 Apr 2023 08:03:18 +0000 (10:03 +0200)] 
man: try to make clearer that /var/ is generally not available in /usr/lib/systemd/system-shutdown/ callouts

I made the mistake to look into what is installed into
/usr/lib/systemd/system-shutdown/ on Fedora. fwdupd among other things
assumes /var/ is available from these callouts, though it is not in the
general case.

Hence, let's emphasize this in the documentation a bit more.

2 years agodissect-image: issue BLKFLSBUF before probing an fs at block device offset != 0
Lennart Poettering [Thu, 20 Apr 2023 08:14:43 +0000 (10:14 +0200)] 
dissect-image: issue BLKFLSBUF before probing an fs at block device offset != 0

See added code comment for a longer explanation. TLDR: Linux maintains
distinct block device caches for partition and "whole" block devices,
and a simply BLKFLSBUF should make the worst confusions this causes go
away.

2 years agonetworkd: fallback to chaddr for static lease lookup when not found
Robert Meijers [Mon, 17 Apr 2023 20:16:05 +0000 (22:16 +0200)] 
networkd: fallback to chaddr for static lease lookup when not found

DHCP static leases are looked up by the client identifier as send by
the client, while configured based on MAC. As RFC 2131 states the client
identifier is an opaque key and must not be interpreted by the server
this means that DHCP clients can (/will) also use a client identifier
which is not a MAC address. One of these clients actually is
systemd-networkd which uses an RFC 4361 by default to generate the
client identifier. For these kind of DHCP clients static leases thus
don't work because of this mismatch between configuring a MAC address
but the server matching based on client identifier. This adds a fallback
to try to look up a configured static lease based on the "chaddr" of the
DHCP message as this will always contain the MAC address of the client.

Fixes #21368

2 years agocore/device: rewrite how device unit is removed from Manager.devices_by_sysfs
Yu Watanabe [Wed, 19 Apr 2023 18:20:34 +0000 (03:20 +0900)] 
core/device: rewrite how device unit is removed from Manager.devices_by_sysfs

If the device unit is not the head of the list saved in
Manager.devices_by_sysfs, then it is not necessary to replace the
existing hashmap entry. This should not change any behavior, just
refactoring.

2 years agolist: fix double evaluation
Yu Watanabe [Wed, 19 Apr 2023 19:04:03 +0000 (04:04 +0900)] 
list: fix double evaluation

2 years agoMerge pull request #27299 from yuwata/chase-absolute
Daan De Meyer [Thu, 20 Apr 2023 07:19:22 +0000 (09:19 +0200)] 
Merge pull request #27299 from yuwata/chase-absolute

chase: return absolute path when dir_fd points to the root directory

2 years agohwdb: disable entry for Logitech USB receiver used by G502 X
Yu Watanabe [Wed, 19 Apr 2023 13:05:43 +0000 (22:05 +0900)] 
hwdb: disable entry for Logitech USB receiver used by G502 X

Fixes a bug introduced by dede07d3d04007c70c78653a73e2bcd8616564a5.

Fixes #27118.

2 years agocore: add one missing assertion for release_resource_queue
Yu Watanabe [Wed, 19 Apr 2023 11:27:29 +0000 (20:27 +0900)] 
core: add one missing assertion for release_resource_queue

Follow-up for 6ac62d61db737b01ad3776a7688d8a4c57b3f7d9.

2 years agodissect-image: fix log level in dissect_log_error
Quintin Hill [Wed, 19 Apr 2023 11:36:00 +0000 (12:36 +0100)] 
dissect-image: fix log level in dissect_log_error

Actually use the log_level argument in this function!

Fixes 4953e39

2 years agomkosi: Update to latest
Daan De Meyer [Tue, 18 Apr 2023 12:35:48 +0000 (14:35 +0200)] 
mkosi: Update to latest

2 years agotest: add regression tests for find_esp() and friend 27299/head
Yu Watanabe [Tue, 18 Apr 2023 19:04:40 +0000 (04:04 +0900)] 
test: add regression tests for find_esp() and friend

2 years agochase: replace path_prefix_root_cwd() with chaseat_prefix_root()
Yu Watanabe [Mon, 17 Apr 2023 15:09:54 +0000 (00:09 +0900)] 
chase: replace path_prefix_root_cwd() with chaseat_prefix_root()

The function path_prefix_root_cwd() was introduced for prefixing the
result from chaseat() with root, but
- it is named slightly generic,
- the logic is different from what chase() does.

This makes the name more explanative and specific for the result of the
chaseat(), and make the logic consistent with chase().

Fixes https://github.com/systemd/systemd/pull/27199#issuecomment-1511387731.

Follow-up for #27199.

2 years agofd-util: skip to check mount ID if kernel is too old and /proc is not mounted
Yu Watanabe [Mon, 17 Apr 2023 14:37:12 +0000 (23:37 +0900)] 
fd-util: skip to check mount ID if kernel is too old and /proc is not mounted

Now, dir_fd_is_root() is heavily used in chaseat(), which is used at
various places. If the kernel is too old and /proc is not mounted, then
there is no way to get the mount ID of a directory. In that case, let's
silently skip the mount ID check.

Fixes https://github.com/systemd/systemd/pull/27299#issuecomment-1511403680.

2 years agomountpoint-util: check /proc is mounted on failure
Yu Watanabe [Mon, 17 Apr 2023 14:26:47 +0000 (23:26 +0900)] 
mountpoint-util: check /proc is mounted on failure

2 years agochase: prefix with the root directory only when it is not "/"
Yu Watanabe [Mon, 17 Apr 2023 06:28:42 +0000 (15:28 +0900)] 
chase: prefix with the root directory only when it is not "/"

2 years agochase: drop repeated call of empty_to_root()
Yu Watanabe [Mon, 17 Apr 2023 06:24:05 +0000 (15:24 +0900)] 
chase: drop repeated call of empty_to_root()

2 years agochase: update outdated comment about result path
Yu Watanabe [Sun, 16 Apr 2023 20:47:25 +0000 (05:47 +0900)] 
chase: update outdated comment about result path

2 years agochase: make the result absolute when a symlink is absolute
Yu Watanabe [Sun, 16 Apr 2023 20:19:07 +0000 (05:19 +0900)] 
chase: make the result absolute when a symlink is absolute

As the path may be outside of the specified dir_fd.

2 years agochase: make chaseat() provides absolute path also when dir_fd points to the root...
Yu Watanabe [Sun, 16 Apr 2023 20:04:27 +0000 (05:04 +0900)] 
chase: make chaseat() provides absolute path also when dir_fd points to the root directory

Usually, we pass the file descriptor of the root directory to chaseat()
when `--root=` is not specified. Previously, even in such case, the
result was relative, and we need to prefix the path with "/" when we
want to pass the path to other functions that do not support dir_fd, or
log or show the path. That's inconvenient.

2 years agoMerge pull request #27323 from keszybz/gpt-auto-generator-warning-cleanup
Mike Yuan [Tue, 18 Apr 2023 18:06:06 +0000 (02:06 +0800)] 
Merge pull request #27323 from keszybz/gpt-auto-generator-warning-cleanup

gpt-auto-generator: do not error out when no partitions are found

2 years agotest: prefix the transient unit with test- to make coverage runs happy
Frantisek Sumsal [Tue, 18 Apr 2023 09:45:56 +0000 (11:45 +0200)] 
test: prefix the transient unit with test- to make coverage runs happy

See 9fd8226312 for more details.

Follow-up to c9210b7470.

2 years agoMerge pull request #27320 from poettering/kmod-setup-tweaks
Mike Yuan [Tue, 18 Apr 2023 11:25:08 +0000 (19:25 +0800)] 
Merge pull request #27320 from poettering/kmod-setup-tweaks

minor tweaks to kmod-setup.c

2 years agogpt-auto-generator: "translate" errno codes into proper messages 27323/head
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2023 09:33:08 +0000 (11:33 +0200)] 
gpt-auto-generator: "translate" errno codes into proper messages

E.g. in logs on jammy-ppc64el in https://github.com/systemd/systemd/pull/27294:
Apr 16 17:42:50 H systemd-gpt-auto-generator[300]: Failed to dissect partition table of block device /dev/sda: No message of desired type
Apr 16 17:42:50 H (sd-execu[295]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1.

ee0e6e476e61d4baa2a18e241d212753e75003bf made this particular condition not an
error. But for other errnos we want to print a better message too.
dissect_loop_device_and_warn() already does this, but it always prints the
error at error level. We want to suppress some of the errors, so let's make the
print helper public and do the error suppression in the caller.

2 years agofstab-generator: add missing phrase in comment
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2023 09:57:27 +0000 (11:57 +0200)] 
fstab-generator: add missing phrase in comment

2 years agohwdb: Fix rotation for BMAX Y13
Paolo Velati [Mon, 17 Apr 2023 20:27:28 +0000 (20:27 +0000)] 
hwdb: Fix rotation for BMAX Y13

2 years agokmod-setup: bypass heavy virtio-rng check if we are not running in a VM anyway 27320/head
Lennart Poettering [Tue, 18 Apr 2023 08:48:54 +0000 (10:48 +0200)] 
kmod-setup: bypass heavy virtio-rng check if we are not running in a VM anyway

detect_vm() is cheap, because cached, let's hence do that early before
we get out the big guns and sweep through sysfs.

2 years agokmod-setup: use STARTSWITH_SET() where appropriate
Lennart Poettering [Tue, 18 Apr 2023 08:48:50 +0000 (10:48 +0200)] 
kmod-setup: use STARTSWITH_SET() where appropriate

2 years agoRevert "getty-generator: Use device hotplug to instantiate virtualizer consoles"
Lennart Poettering [Tue, 18 Apr 2023 07:47:10 +0000 (09:47 +0200)] 
Revert "getty-generator: Use device hotplug to instantiate virtualizer consoles"

This reverts commit e7e6ce5f8d467304731a98e8a140e69713f1bf07.

2 years agoMerge pull request #27256 from medhefgo/boot-rdtsc
Lennart Poettering [Tue, 18 Apr 2023 08:38:15 +0000 (10:38 +0200)] 
Merge pull request #27256 from medhefgo/boot-rdtsc

boot: Improve timer frequency detection

2 years agogpt-auto: do not fail when no suitable partitions found
Yu Watanabe [Mon, 17 Apr 2023 21:36:42 +0000 (06:36 +0900)] 
gpt-auto: do not fail when no suitable partitions found

Follow-up for 598fd4da1cf9665834110583fd9133073cc12481.

2 years agogetty-generator: Use device hotplug to instantiate virtualizer consoles
Daan De Meyer [Mon, 17 Apr 2023 22:46:11 +0000 (00:46 +0200)] 
getty-generator: Use device hotplug to instantiate virtualizer consoles

If getty-generator runs in the initrd, the corresponding tty might not
have been instantiated yet in /dev, which means a serial getty is not
spawned on it. Instead, let's instantiate the serial-getty when the
device appears so that it always gets instantiated.

2 years agolsm-util: move detection of support of LSMs into a new lsm-util.[ch] helper
Lennart Poettering [Thu, 16 Mar 2023 16:56:23 +0000 (17:56 +0100)] 
lsm-util: move detection of support of LSMs into a new lsm-util.[ch] helper

This makes the bpf LSM check generic, so that we can use it elsewhere.
it also drops the caching inside it, given that bpf-lsm code in PID1
will cache it a second time a stack frame further up when it checks for
various other bpf functionality.

2 years agobpf-firewall: give a name to maps used
Dominique Martinet [Sun, 16 Apr 2023 07:14:49 +0000 (16:14 +0900)] 
bpf-firewall: give a name to maps used

Running systemd with IP accounting enabled generates many bpf maps (two
per unit for accounting, another two if IPAddressAllow/Deny are used).

Systemd itself knows which maps belong to what unit and commands like
`systemctl status <unit>` can be used to query what service has which
map, but monitoring these values all the time costs 4 dbus requests
(calling the .IP{E,I}gress{Bytes,Packets} method for each unit) and
makes services like the prometheus systemd_exporter[1] somewhat slow
when doing that for every units, while less precise information could
quickly be obtained by looking directly at the maps.

Unfortunately, bpf map names are rather limited:
- only 15 characters in length (16, but last byte must be 0)
- only allows isalnum(), _ and . characters

If it wasn't for the length limit we could use the normal unit escape
functions but I've opted to just make any forbidden character into
underscores for maximum brievty -- the map prefix is also rather short:
This isn't meant as a precise mapping, but as a hint for admins who want
to look at these.

(Note there is no problem if multiple maps have the same name)

Link: https://github.com/povilasv/systemd_exporter
2 years agoprocess-util: be more careful with pidfd_get_pid() special cases
Lennart Poettering [Fri, 14 Apr 2023 15:47:43 +0000 (17:47 +0200)] 
process-util: be more careful with pidfd_get_pid() special cases

Let's be more careful with generating error codes for (expected) error
causes.

This does not introduce new error conditions, it just changes what we
return under specific cases, to make things nicely recognizable in each
case. Most importantly this detects if fdinfo reports a pid of "-1" for
pidfds with processes that are already reaped (and thus have no PID
anymore)

None of our current users care about these error codes, but let's get
this right for the future.

2 years agofsck: use execv_p_ and execl_p_
Florian Klink [Mon, 17 Apr 2023 12:46:05 +0000 (14:46 +0200)] 
fsck: use execv_p_ and execl_p_

Instead of invoking find_executable on our own, use the variants of exec
provided by glibc which does this for us.

2 years agocreds: make available to all ExecStartPre= and ExecStart= processes
Luca Boccassi [Sat, 15 Apr 2023 02:01:52 +0000 (03:01 +0100)] 
creds: make available to all ExecStartPre= and ExecStart= processes

Fixes https://github.com/systemd/systemd/issues/27275

2 years agouser-util:remove duplicate includes
jcg [Mon, 17 Apr 2023 12:41:00 +0000 (20:41 +0800)] 
user-util:remove duplicate includes

2 years agovirt: Further improve detection of EC2 metal instances
Benjamin Herrenschmidt [Thu, 13 Apr 2023 03:51:31 +0000 (13:51 +1000)] 
virt: Further improve detection of EC2 metal instances

Commit f90eea7d18d9ebe88e6a66cd7a86b618def8945d
virt: Improve detection of EC2 metal instances

Added support for detecting EC2 metal instances via the product
name in DMI by testing for the ".metal" suffix.

Unfortunately this doesn't cover all cases, as there are going to be
instance types where ".metal" is not a suffix (ie, .metal-16xl,
.metal-32xl, ...)

This modifies the logic to also allow those new forms.

Signed-off-by: Benjamin Herrenschmidt <benh@amazon.com>
2 years agomkosi: Use kernel-core for Fedora and CentOS images
Daan De Meyer [Mon, 17 Apr 2023 08:18:42 +0000 (10:18 +0200)] 
mkosi: Use kernel-core for Fedora and CentOS images

Let's reduce image size by using a smaller kernel package.

2 years agohwdb: add accelerometer mount matrix for Lenovo Yoga Tablet 2 851F/L
Hans de Goede [Sun, 16 Apr 2023 13:57:55 +0000 (15:57 +0200)] 
hwdb: add accelerometer mount matrix for Lenovo Yoga Tablet 2 851F/L

Add an accelerometer mount matrix for Lenovo Yoga Tablet 2 851F/L, to fix
screen rotation now that the kernel has support for the LSM303D IMU.

2 years agoMerge pull request #27298 from mrc0mmand/test-async-tweaks
Luca Boccassi [Sun, 16 Apr 2023 22:32:33 +0000 (23:32 +0100)] 
Merge pull request #27298 from mrc0mmand/test-async-tweaks

test: modernize test-async a bit

2 years agoprocess-util: make safe_fork() unset $NOTIFY_SOCKET
Yu Watanabe [Sun, 16 Apr 2023 17:09:38 +0000 (02:09 +0900)] 
process-util: make safe_fork() unset $NOTIFY_SOCKET

Propagating $NOTIFY_SOCKET is typically dangerous. Let's unset it unless
explicitly requested to keep it.

Fixes #27288.
Replaces #27291.

2 years agodocs: add a missing $ sign 27298/head
Frantisek Sumsal [Sun, 16 Apr 2023 18:29:41 +0000 (20:29 +0200)] 
docs: add a missing $ sign

Addresses https://github.com/systemd/systemd/pull/27283#pullrequestreview-1386816102.
Follow-up to 1a127aa02b.

2 years agotest: modernize test-async a bit
Frantisek Sumsal [Sun, 16 Apr 2023 18:21:37 +0000 (20:21 +0200)] 
test: modernize test-async a bit

Mainly to give it some debug output to, hopefully, see why it sometimes
gets stuck in CI when run with sanitizers.

2 years agomkosi: default to Fedora 38
Zbigniew Jędrzejewski-Szmek [Sun, 16 Apr 2023 10:34:49 +0000 (12:34 +0200)] 
mkosi: default to Fedora 38

It'll be out this week. We can't update the man pages before it is realeased,
but we can use it for mkosi builds and do some very late testing.

Also, use filepath specification for /bin/pkg-config. We need it for meson, and
meson calls it directly by this path. pkgconfig is a virtual Provides on
pkgconf-pkg-config, and the indirection here just obfuscates things with no
benefit.

Add it explicitly for centos too. (I think it is pulled in by packages which
contain pkg-config modules anyway, but it's better to be explicit).

2 years agoexec-util: make execute_strv() optionally take root directory
Yu Watanabe [Sun, 16 Apr 2023 06:31:10 +0000 (15:31 +0900)] 
exec-util: make execute_strv() optionally take root directory

Preparation for rewriting kernel-install in C.

2 years agoMerge pull request #27283 from mrc0mmand/assorted-test-tweaks
Yu Watanabe [Sun, 16 Apr 2023 10:39:58 +0000 (19:39 +0900)] 
Merge pull request #27283 from mrc0mmand/assorted-test-tweaks

test: a bunch of assorted tweaks, Saturday edition

2 years agoMerge pull request #27253 from yuwata/cmsg-find-and-copy-data
Yu Watanabe [Sun, 16 Apr 2023 07:28:26 +0000 (16:28 +0900)] 
Merge pull request #27253 from yuwata/cmsg-find-and-copy-data

socket-util: introduce CMSG_FIND_AND_COPY_DATA()

2 years agotest: add a couple of tests with invalid UTF-8 characters 27283/head
Frantisek Sumsal [Sat, 15 Apr 2023 20:22:56 +0000 (22:22 +0200)] 
test: add a couple of tests with invalid UTF-8 characters

2 years agotest: add a simple test for getenv_path_list()
Frantisek Sumsal [Sat, 15 Apr 2023 20:04:37 +0000 (22:04 +0200)] 
test: add a simple test for getenv_path_list()

2 years agotest: add a couple of basic sanity tests for the security verb
Frantisek Sumsal [Sat, 15 Apr 2023 19:33:02 +0000 (21:33 +0200)] 
test: add a couple of basic sanity tests for the security verb

2 years agotest: add a couple of basic sanity tests for timedatectl
Frantisek Sumsal [Sat, 15 Apr 2023 17:51:44 +0000 (19:51 +0200)] 
test: add a couple of basic sanity tests for timedatectl

2 years agotest: add a simple test for secure-bits stuff
Frantisek Sumsal [Sat, 15 Apr 2023 17:12:45 +0000 (19:12 +0200)] 
test: add a simple test for secure-bits stuff

2 years agoshared: add a missing include
Frantisek Sumsal [Sat, 15 Apr 2023 16:24:13 +0000 (18:24 +0200)] 
shared: add a missing include

2 years agotest: add tests for uuid/uint64 specifiers
Frantisek Sumsal [Sat, 15 Apr 2023 16:02:10 +0000 (18:02 +0200)] 
test: add tests for uuid/uint64 specifiers

They're used in repart, but are not part of the "common" specifier
lists, so cover them explicitly.

2 years agotree-wide: also use CMSG_TYPED_DATA() on writing message header 27253/head
Yu Watanabe [Thu, 13 Apr 2023 09:34:59 +0000 (18:34 +0900)] 
tree-wide: also use CMSG_TYPED_DATA() on writing message header

2 years agosd-dhcp-server: use CMSG_FIND_DATA() at one more place
Yu Watanabe [Thu, 13 Apr 2023 09:34:09 +0000 (18:34 +0900)] 
sd-dhcp-server: use CMSG_FIND_DATA() at one more place

2 years agotree-wide: copy timestamp data from cmsg
Yu Watanabe [Thu, 13 Apr 2023 09:02:48 +0000 (18:02 +0900)] 
tree-wide: copy timestamp data from cmsg

On RISCV32, time_t is 64bit and size_t is 32bit, hence the timestamp
data in message header may not be aligned.

Fixes #27241.

2 years agosocket-util: introduce CMSG_FIND_AND_COPY_DATA()
Yu Watanabe [Thu, 13 Apr 2023 09:00:41 +0000 (18:00 +0900)] 
socket-util: introduce CMSG_FIND_AND_COPY_DATA()

The cmd(3) man page says about CMSG_DATA():
> The pointer returned cannot be assumed to be suitably aligned for
> accessing arbitrary payload data types. Applications should not cast
> it to a pointer type matching the payload, but should instead use
> memcpy(3) to copy data to or from a suitably declared object.

Hence, if we want to use unaligned data in cmsg, we need to copy it
before use. That's typically important for reading timestamps in
RISCV32, as the time_t is 64bit and size_t is 32bit on the system.

2 years agotest: add a test case for table_dup_cell()
Frantisek Sumsal [Sat, 15 Apr 2023 11:58:20 +0000 (13:58 +0200)] 
test: add a test case for table_dup_cell()

Also, sneak in coverage for "less popular" cell types.

2 years agomkosi: Always disable sshd, dnsmasq and isc-dhcp-server
Daan De Meyer [Sat, 15 Apr 2023 16:51:28 +0000 (18:51 +0200)] 
mkosi: Always disable sshd, dnsmasq and isc-dhcp-server

2 years agodocs: a couple of typo fixes & formatting tweaks
Frantisek Sumsal [Sat, 15 Apr 2023 11:12:43 +0000 (13:12 +0200)] 
docs: a couple of typo fixes & formatting tweaks

2 years agomkosi: Update to latest
Daan De Meyer [Sat, 15 Apr 2023 07:34:46 +0000 (09:34 +0200)] 
mkosi: Update to latest

mkosi now installs a "ignore *" default preset on Debian. We also
switch Debian to dbus-broker now that preset doesn't disable it
anymore.

2 years agofsck: look for fsck binary not just in /sbin
Florian Klink [Thu, 13 Apr 2023 20:54:54 +0000 (22:54 +0200)] 
fsck: look for fsck binary not just in /sbin

This removes remaining hardcoded occurences of `/sbin/fsck`, and instead
uses `find_executable` to find `fsck`.

We also use `fsck_exists_for_fstype` to check for the `fsck.*`
executable, which also checks in `$PATH`, so it's fair to assume fsck
itself is also available.

2 years agoMerge pull request #27273 from mrc0mmand/test-generators
Luca Boccassi [Fri, 14 Apr 2023 20:31:55 +0000 (21:31 +0100)] 
Merge pull request #27273 from mrc0mmand/test-generators

test: add a couple of tests for getty/run/system-update generators

2 years agopreset: Add ignore directive
Daan De Meyer [Thu, 13 Apr 2023 17:03:43 +0000 (19:03 +0200)] 
preset: Add ignore directive

The ignore directive specifies to not do anything with the given
unit and leave existing configuration intact. This allows distributions
to gradually adopt preset files by shipping a ignore * preset file.

2 years agotest: stop the test unit when it's not needed anymore
Frantisek Sumsal [Fri, 14 Apr 2023 19:10:18 +0000 (21:10 +0200)] 
test: stop the test unit when it's not needed anymore

Otherwise it keeps printing stuff to the journal/console, adding
unnecessary noise.

2 years agotest: check the colored --version output
Frantisek Sumsal [Fri, 14 Apr 2023 19:07:51 +0000 (21:07 +0200)] 
test: check the colored --version output

2 years agopo: Translated using Weblate (Galician)
Fran Diéguez [Fri, 14 Apr 2023 18:20:43 +0000 (20:20 +0200)] 
po: Translated using Weblate (Galician)

Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Fran Diéguez <frandieguez@gnome.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/gl/
Translation: systemd/main

2 years agoman/systemd-cryptenroll: update list of PCRs, link to uapi docs
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2023 07:30:52 +0000 (09:30 +0200)] 
man/systemd-cryptenroll: update list of PCRs, link to uapi docs

Entia non sunt multiplicanda praeter necessitatem. We had a list of PCRs in the
man page which was already half out-of-date. Instead, link to web page with the
"authoritative" list. Here, drop the descriptions of what shim and grub do. Instead,
just give some short descriptions and mention what systemd components do.
systemd-pcrmachine.service and systemd-pcrfs@.service are now mentioned too.

https://github.com/uapi-group/specifications/commit/d0e590b1e2648e76ece66157ceade3f45b165b14
extended the table in the specs repo.
https://github.com/uapi-group/specifications/pull/59 adds some more text there
too.

Also, rework the recommendation: hint that PCR 11 is useful, and recommend
binding to policy signatures instead of direct PCR values. This new text is
intentionally vague: doing this correctly is hard, but let's at least not imply
that just binding to PCR 7 is useful in any way.

Also, change "string alias" to "name" in discussion of PCR names.

Inspired by https://discussion.fedoraproject.org/t/future-of-encryption-in-fedora/80397/17

2 years agoMerge pull request #27269 from poettering/statx-dont-sync
Luca Boccassi [Fri, 14 Apr 2023 15:23:51 +0000 (16:23 +0100)] 
Merge pull request #27269 from poettering/statx-dont-sync

mountpoint-util: don't go to the network when doing statx() to detect mountpoints/mnt_id

2 years agotest: add a couple of tests for run-generator 27273/head
Frantisek Sumsal [Fri, 14 Apr 2023 15:05:55 +0000 (17:05 +0200)] 
test: add a couple of tests for run-generator

2 years agostring-util: add strstrafter()
Lennart Poettering [Fri, 14 Apr 2023 10:48:14 +0000 (12:48 +0200)] 
string-util: add strstrafter()

strstrafter() is like strstr() but returns a pointer to the first
character *after* the found substring, not on the substring itself.
Quite often this is what we actually want.

Inspired by #27267 I think it makes sense to add a helper for this,
to avoid the potentially fragile manual pointer increment afterwards.

2 years agotest: add a couple of tests for system-update-generator
Frantisek Sumsal [Fri, 14 Apr 2023 14:09:32 +0000 (16:09 +0200)] 
test: add a couple of tests for system-update-generator

2 years agotest: properly distinguish between generator phases
Frantisek Sumsal [Fri, 14 Apr 2023 13:15:13 +0000 (15:15 +0200)] 
test: properly distinguish between generator phases

Let's make sure the units generated by generators are generated at the
right stage.

2 years agoMerge pull request #27252 from yuwata/chase-mkdir
Daan De Meyer [Fri, 14 Apr 2023 13:19:57 +0000 (15:19 +0200)] 
Merge pull request #27252 from yuwata/chase-mkdir

chase: refuse CHASE_MKDIR_0755 without CHASE_NONEXISTENT or CHASE_PARENT

2 years agoMerge pull request #27266 from dtardon/take-struct
Luca Boccassi [Fri, 14 Apr 2023 13:15:35 +0000 (14:15 +0100)] 
Merge pull request #27266 from dtardon/take-struct

Use TAKE_STRUCT() to copy and reset structs