Commit graph

74734 commits

Author SHA1 Message Date
Lennart Poettering a89690f719 mountpoint-util: make is_name_to_handle_at_fatal_error() an exported API
And while we are at it, make it use ERRNO_IS_xyz() where appropriate.

And move it up a bit, so we can use in the whole of mountpoint-util.c
(which we want to later).
2024-07-01 15:45:15 +02:00
dependabot[bot] 502fbea8c1 build(deps): bump actions/checkout from 4.1.6 to 4.1.7
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](a5ac7e51b4...692973e3d9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 13:18:45 +02:00
rhellstrom 98b1ecc917 Conditional PSI check to reflect changes done in 5.13
cpu.pressure 'full' is undefined for system-wide checks since 5.13 but still reported with values set to 0 for backwards compatibility. Made changes to reflect this for system-wide checks so that the conditional comparison is not made against the 0 value and instead fall back to 'some'.

https://www.kernel.org/doc/html/latest/accounting/psi.html
2024-07-01 11:21:46 +02:00
Luca Boccassi c3f0f6f8bd core: try again bind mounting if the destination was already created
If the destination mount point is on a shared filesystem and is
missing on the first attempt, we try to create it, but then
fail with -EEXIST if something else created it in the meanwhile.
Enter the retry logic on EEXIST, as we can just use the mount
point if it was already created.

Fixes https://github.com/systemd/systemd/issues/29690
2024-06-30 00:44:03 +02:00
Luca Boccassi c5822010ae
Merge pull request #33544 from DaanDeMeyer/sector-size
repart: Two sector size improvements
2024-06-29 21:31:04 +02:00
Mike Yuan 6498a25a6d
NEWS: fix typo 2024-06-29 16:48:18 +02:00
Mike Yuan 2e7b407539
NEWS: nscd has been dropped for good
Follow-up for 28f1f1a5e6
2024-06-29 16:35:26 +02:00
Mike Yuan 7fee3dd4c6
Merge pull request #33258 from YHNdnzj/cg-runtime-accounting
core/cgroup: various fixes for accounting
2024-06-29 16:11:44 +02:00
Daan De Meyer 03c9e88fb7 mkfs-util: Set sector size for btrfs as well
btrfs used to default the sector size to the page size and didn't
support anything else. Since 6.7, it defaults to 4K and using 4K
makes the filesystem compatible with all page sizes. So let's make
sure we use minimum 4K as well (lower causes failures on systems with
a 4K page size) but still allow larger sector sizes if specified by
the user.
2024-06-29 16:11:34 +02:00
Daan De Meyer d34361149f repart: Don't set filesystem sector size to 512
We want to use 4K as the default sector size for filesystems so they
don't have to be regenerated to work on 512, 2048 or 4096 sector sizes.
2024-06-29 15:37:49 +02:00
DocNITE a76d88644f Added mised EVDEV_ABS_35 & EVDEV_ABS_36 for GAOMON s620 2024-06-29 12:22:01 +02:00
Luca Boccassi 2e1203ddbe
Merge pull request #30360 from keszybz/nscd-drop
Drop support for nscd
2024-06-29 10:36:16 +02:00
Luca Boccassi 317b0255ed
Merge pull request #33536 from teknoraver/hashmap_ensure_replace
Hashmap ensure replace
2024-06-29 10:31:11 +02:00
Daan De Meyer 0e445aaa85 repart: Log more about filesystem sector size 2024-06-29 02:09:55 +02:00
Luca Boccassi 1c74db68e4
Merge pull request #33518 from DaanDeMeyer/aarch64
Various integration test fixes
2024-06-29 02:09:21 +02:00
Mike Yuan 740cd1e0f2 core/unit: follow merged units before updating SourcePath= timestamp too
Currently, we only follow merged units for unit_load_dropin() call.
But if the unit is an alias, we should always perform operations
on the "canonical" unit.
2024-06-28 21:10:16 +02:00
Matteo Croce e1226a9b48 Use hashmap_ensure_replace()
Use the new function `hashmap_ensure_replace()` where we're using
`hashmap_ensure_allocated()` and `hashmap_ensure_replace()`.

Signed-off-by: Matteo Croce <teknoraver@meta.com>
2024-06-28 19:07:24 +02:00
Luca Boccassi 3f1764dcfc
Merge pull request #33517 from keszybz/a-few-unrelated-cleanups
A few unrelated cleanups
2024-06-28 19:06:31 +02:00
Matteo Croce afb1fe36b8 introduce hashmap_ensure_replace()
Similar to hashmap_ensure_put(), but replace existing items in the map,
as hashmap_replace().
2024-06-28 18:55:31 +02:00
Zbigniew Jędrzejewski-Szmek c96cb64dce meson: use less verbose quoting 2024-06-28 18:52:59 +02:00
Zbigniew Jędrzejewski-Szmek 28f1f1a5e6 Drop support for nscd
nscd is known to be racy [1] and it was already deprecated and later dropped in
Fedora a while back [1,2]. We don't need to support obsolete stuff in systemd,
and the cache in systemd-resolved provides a better solution anyway.

We announced the plan to drop nscd in d44934f378.

[1] https://fedoraproject.org/wiki/Changes/DeprecateNSCD
[2] https://fedoraproject.org/wiki/Changes/RemoveNSCD

The option is kept as a stub without any effect to make the transition easier.
2024-06-28 18:51:56 +02:00
Luca Boccassi 127e600a6c
Merge pull request #33202 from bluca/extension_dedup
core: deduplicate identical dm-verity ExtensionImages=
2024-06-28 18:25:36 +02:00
Daan De Meyer 436474dd43 TEST-54-CREDS: Use UEFI firmware if available
On aarch64, SMBIOS is only available when using UEFI, so let's make
sure that the creds test uses UEFI when available so that it can
read creds from SMBIOS when running in a virtual machine.
2024-06-28 16:23:27 +02:00
Daan De Meyer f392be9e77 TEST-18-FAILUREACTION: Set auto firmware
This test runs in nspawn by default but will still run in qemu when
tests are run unprivileged so make sure we use UEFI if available to
avoid hangs when using the linux firmware.
2024-06-28 16:23:25 +02:00
Daan De Meyer 3cf38516bb TEST-09-REBOOT: Set auto firmware
This test runs in nspawn by default but will still run in qemu when
tests are run unprivileged so make sure we use UEFI if available to
avoid hangs when using the linux firmware.
2024-06-28 16:21:39 +02:00
Daan De Meyer 7c04137a6f TEST-06-SELINUX: Explicitly pull in autorelabel.service 2024-06-28 15:50:35 +02:00
Daan De Meyer 98f2a332cb TEST-70-TPM2: Use UEFI firmware if available
On x86 this doesn't matter but on aarch64 we need to make sure UEFI
is used so that /sys/kernel/security/tpm0/binary_bios_measurements
is there which is required for TEST-70-TPM2.
2024-06-28 15:47:33 +02:00
Mike Yuan f26b2ec461
core: do not set up cgroup runtime on coldplug
Currently, unit_setup_cgroup_runtime() is called in
various _coldplug() functions if the unit is not inactive.
That seems unnecessary though, and kinda defeats the purpose
of CGroupRuntime. If we need to fork off a process for the unit
or got something during deserialization, the CGroupRuntime
would be automatically set up by unit_prepare_exec() /
cgroup_runtime_deserialize_one(). Otherwise it would mean
the cgroup doesn't exist and we don't need to allocate
that in the first place.

Plus, note that socket units might also carry a cgroup with
ExecStartPre=/ExecStartPost=/... Hence the existing code
is really inconsistent.
2024-06-28 15:43:21 +02:00
Mike Yuan 8d178f702d
core: cast ignored retval of unit_realize_cgroup to void 2024-06-28 15:43:21 +02:00
Mike Yuan 4918f14ada
core: do not drop CGroupRuntime when unit stops, but only on GC
Fixes #33149
Replaces #33145
2024-06-28 15:43:21 +02:00
Mike Yuan 4c1fc52d2a
core/cgroup: drop spurious ", ignoring" for unit_cgroup_is_empty 2024-06-28 15:43:21 +02:00
Mike Yuan 3849d1f56b
core/cgroup: actually make use of the cached accounting values
If cgroup is already gone, i.e. CGRuntime.cgroup_path is NULL,
do not return -ENODATA prematurely, but check for cached values
first.

For #33149
2024-06-28 15:43:21 +02:00
Mike Yuan d3d035395e
core/cgroup: check root cgroup earlier for unit_get_memory_accounting 2024-06-28 15:43:20 +02:00
Mike Yuan bc347edfe0
core: unify reset_accounting handling
Since the introduction of CGroupRuntime, there's no need
to call *_reset_accounting in unit_new(), hence make those
static. While at it, refrain from hardcoding default values
in cgroup_runtime_new(), but call the corresponding funcs.

This also corrects the default value of io_accounting_base.

Fixes #33482
2024-06-28 15:43:08 +02:00
Mike Yuan 5a8c2c9559
core/cgroup: call bpf_firewall_close in cgroup_runtime_free
No functional change, just deduplicate default values
in cgroup_runtime_free() and remove pointless call in
unit_free() (at the time it's called the CGRuntime has
been destroyed already).
2024-06-28 15:38:56 +02:00
Mike Yuan 4442aef08e
core/cgroup: make unit_has_host_root_cgroup take const Unit* 2024-06-28 15:38:42 +02:00
Mike Yuan c97c79aded
core/cgroup: check CGroupRuntime.cgroup_path rather than _realized for freezer
The same check is used everywhere else.
2024-06-28 15:38:42 +02:00
Mike Yuan 8153be97c4
core/cgroup: use > 0 comparison rather than == 1 2024-06-28 15:38:41 +02:00
Mike Yuan 38f3b737dc
core/cgroup: correct macro alignment 2024-06-28 15:38:41 +02:00
Luca Boccassi e478fa2a0c TODO: add note about DDI deduplication 2024-06-28 14:37:58 +01:00
Luca Boccassi a1a40297db core: deduplicate identical dm-verity ExtensionImages=
It turns out OverlayFS doesn't handle gracefully when the same source is
specified multiple times in lowerdir= and it fails with ELOOP:

Failed to mount overlay (type overlay) on /run/systemd/mount-rootfs/opt (MS_RDONLY "lowerdir=/run/systemd/unit-extensions/1/opt:/run/systemd/unit-extensions/0/opt:/run/systemd/mount-rootfs/opt"): Too many levels of symbolic links

This happens even if we mount each image in a different internal mount
path, as OverlayFS will resolve it and look for the backing device, which
will be the same device mapper entity, and return a hard error.
This error does not appear if dm-verity is not used, so it is very
confusing for users, and unnecessary.

When mounting ExtensionImages, check if an image is dm-veritied,
and drop duplicates if the root hashes match, to avoid this user-unfriendly
hard error.
2024-06-28 14:37:58 +01:00
Antonio Alvarez Feijoo b268a71069 man/varlinkctl: add list-methods command to synopsis and fix typo
Follow-up for 16cfe84c24
2024-06-28 15:14:59 +02:00
Daan De Meyer 24284098a4 TEST-45-TIMEDATE: Use syslog identifier journalctl match
Using a unit match is racy whereas a syslog identifier match is
reliable.
2024-06-28 14:51:10 +02:00
Zbigniew Jędrzejewski-Szmek cddbd730cb
Merge pull request #33370 from grawity/run-title
run: add option to prevent the setting of terminal title
2024-06-28 14:46:27 +02:00
Luca Boccassi 164e2952ec
Merge pull request #33516 from poettering/more-stub-tweaks
sd-stub: three more tweaks
2024-06-28 14:46:16 +02:00
Daan De Meyer 72d121b601 TEST-64-UDEV-STORAGE: Make nvme_subsystem expected pci symlinks more generic
When running the test on aarch64 the symlinks look as follows:

"""
[root@H ~]# ls /dev/disk/by-path
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0       platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part1  platform-4010000000.pcie-pci-0000:00:05.0-nvme-16
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part  platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part2  platform-4010000000.pcie-pci-0000:00:05.0-nvme-17
"""

So let's make the PCI patterns a little more generic so they match
both the x86 and the aarch64 paths.
2024-06-28 14:20:34 +02:00
Zbigniew Jędrzejewski-Szmek bd7236912f LICENSES/README: expand text to summarize state for binaries and libs
We would say how *sources* are licensed, but actually most user care about the
resulting binaries. So say how the *binaries* are licensed. I used the word
"effectively" because the permissive licenses don't set any requirements on the
binaries, so the license of sources is a complex mix, but the resulting
binaries have a simple effective license.

Also, make it clear that the GPLv2 license applies to udev programs, but not
the shared library. Based on private correspondence, there's some confusion
about this.
2024-06-28 13:46:58 +02:00
Daan De Meyer 3cdc8da5ad mkosi: Install pciutils 2024-06-28 13:41:12 +02:00
Daan De Meyer 32f3617fd7 test: pull in multi-user.target explicitly
Let's make sure we pull in multi-user.target so that we get a console
when a test fails and we're running meson test with --interactive.
2024-06-28 13:34:37 +02:00
Daan De Meyer 4e469c0af2 TEST-64-UDEV-STORAGE: Fix python 3.9 compatibility
Using double quotes in f-strings only works from python 3.12 onwards.
Use single quotes to make sure python 3.9 works as well.

Also clean up quotes a little in general.
2024-06-28 13:18:29 +02:00