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

74345 Commits

Author SHA1 Message Date
Luca Boccassi
fcbafc3ffe Bump meson version to 256.3~devel 2024-07-05 19:03:32 +01:00
Luca Boccassi
c7e144eb4a Finalize v256.2 2024-07-05 19:02:52 +01:00
Luca Boccassi
709655ea0d mkosi: switch debian to ci/v256-stable branch
This branch will track changes for v256-stable
2024-07-05 20:00:04 +02:00
Mike Yuan
e8bbe635cd workflows/labeler: do not set labels on stable backport PRs
(cherry picked from commit 5dfc88c12f)
2024-07-05 20:00:04 +02:00
Mike Yuan
aa1eb0b066 labeler: match all mkosi files
(cherry picked from commit a3370d5d94)
2024-07-05 20:00:04 +02:00
Mike Yuan
32f2b9bba6 labeler: remove matches for dropped files (Makefile)
(cherry picked from commit 5e12de940a)
2024-07-05 20:00:04 +02:00
Lennart Poettering
9a2f16e4ed vmm: make sure we can handle smbios objects without variable part
An smbios object with no variable part is a special case, it's just
suffixed with two NUL btes. handle that properly.

This is inspired by a similar fix from https://github.com/systemd/systemd/pull/29726

(cherry picked from commit 44ec70489f)
2024-07-05 20:00:04 +02:00
Luca Boccassi
c32f71aa14 README: update requirements for signed dm-verity
The newest kconfig enabling DB-verified dm-verity images is queued
for 6.11:

https://patchwork.kernel.org/project/dm-devel/patch/20240617220037.594792-1-luca.boccassi@gmail.com/
(cherry picked from commit a79b6dc070)
2024-07-05 20:00:04 +02:00
Luca Boccassi
abba1e6bc2 sysusers: handle NSS errors gracefully
If the io.systemd.DynamicUser or io.systemd.Machine files exist,
but nothing is listening on them, the nss-systemd module returns
ECONNREFUSED and systemd-sysusers fails to creat the user/group.

This is problematic when ran by packaging scripts, as the package
assumes that after this has run, the user/group exist and can
be used. adduser does not fail in the same situation.

Change sysusers to print a loud warning but otherwise continue
when NSS returns an error.

(cherry picked from commit fc9938d6f8)
2024-07-05 20:00:04 +02:00
Lennart Poettering
df1ed3fbe2 man: fully adopt ~/.local/state/
The XDG base dir spec adopted ~/.local/state/ as a thing a while back,
and we updated our docs in b4d6bc63e6, but
forgot to to update the table at the bottom to fully reflect the update.
Fix that.

(cherry picked from commit 72a6296b16)
2024-07-05 20:00:04 +02:00
Lennart Poettering
9d40e5c9c6 man: mention that distinction between /usr/lib/ and /usr/share/ is really about shared *ownership*
(cherry picked from commit 39aafbd42a)
2024-07-05 20:00:04 +02:00
Lennart Poettering
8dbb7e2a72 man: drop version info from file hiearchy man page
This file doesn't document features of systemd, but is more a of a
general description that generalizes/modernizes FHS. As such, the items
listed in it weren't "added" in systemd versions, they simply reflect
general concepts independent of any specific systemd version. hence
let's drop this misleading and confusing version info.

Or in other words, the man page currently claims under "/usr/": "Added
in version 215." – Which of course is rubbish, the directory existed
since time began.

This also rebreaks all paragaphs this touches.

No content changes.

(cherry picked from commit 26db8fe247)
2024-07-05 20:00:04 +02:00
Luca Boccassi
160b539a9d os-util: avoid matching on the wrong extension-release file
The previous commit tries to extract a substring from the
extension-release suffix, but that is not right, it's only the
images that need to be versioned and extracted, use the extension-release
suffix as-is. Otherwise if it happens to contain a prefix that
matches the wrong image, it will be taken into account.

Follow-up for 37543971af

(cherry picked from commit 92d1fe3efa)
2024-07-05 20:00:04 +02:00
Topi Miettinen
0ff6d2cf47 load-fragment: allow MountImages= with paths starting with /dev
For MountImages=, if the source is a block device, it will most likely reside
in /dev. It should be also possible to mount a static device file system in
place of (or part of) /dev. So let's allow paths starting with /dev as an
exception for MountImages=.

(cherry picked from commit e81025970f)
2024-07-05 20:00:04 +02:00
Ronan Pigott
cc4472c31e zsh: add run0 completions
(cherry picked from commit ef98603f4b)
2024-07-05 20:00:04 +02:00
Daan De Meyer
d0a9cf084d docs: Update HACKING
Let's mention the new way to install the latest changes without
rebuilding the image. Let's also remove the duplicate info about
distribution packages that is already mentioned in its own section.

(cherry picked from commit a2403af329)
2024-07-05 20:00:04 +02:00
James Hilliard
a50e6c5709 README: add missing CONFIG_MEMCG kernel config option for oomd
We need to enable this otherwise systemd-oomd.service fails to start.

Fixes:
ConditionControlGroupController=memory was not met

(cherry picked from commit aa329b8922)
2024-07-05 20:00:04 +02:00
Brenton Simpson
71de25f2df boot: cover for hardware keys on phones/tablets
The patch is originally from Brenton Simpson, I (Lennart) just added some
comments and rebased it.

I didn't test this, but the patch looks so obviously right to me, that
I think we should just merge it, instead of delaying this further. In
the worst case noone notices, in the best case this makes sd-boot work
reasonably nicely on devices that only have a hadware power key + volume
rocker.

Fixes: #30598
Replaces: #31135
(cherry picked from commit 2fda6f5fff)
2024-07-05 20:00:04 +02:00
Mike Yuan
243276f008 core/manager: invoke special targets on signal only for system manager
(cherry picked from commit 6851abe403)
2024-07-05 20:00:04 +02:00
Mike Yuan
efc44e0c3e core/dbus-manager: refuse SoftReboot() for user managers
Otherwise, busctl --user call ... SoftReboot results in
user manager broadcasting signal and initiating soft-reboot...

(cherry picked from commit 236cd48546)
2024-07-05 20:00:04 +02:00
Daan De Meyer
399e788553 meson: Define __TARGET_ARCH macros required by bpf
These are required by the bpf_tracing.h header in libbpf, see
https://github.com/libbpf/libbpf/blob/master/src/bpf_tracing.h.

bpf_tracing.h does have a few fallbacks in case __TARGET_ARCH_XXX
is not defined but recommends using the __TARGET_ARCH macros instead
so let's do that.

(cherry picked from commit 48d6dad100)
2024-07-05 20:00:04 +02:00
Luca Boccassi
a946258e9d coredump: correctly take tmpfs size into account for compression
We calculate the amount of uncompressed data we can write by taking the limits
into account and halving it to ensure there's room for switching to compression
on the fly when storing cores on a tmpfs (eg: due read-only rootfs).

But the logic is flawed, as taking into account the size of the tmpfs storage
was applied after the halving, so in practice when an uncompressed core file
was larger than the tmpfs, we fill it and then fail.

Rearrange the logic so that the halving is done after taking into account
the tmpfs size.

(cherry picked from commit e6b2508275)
2024-07-05 20:00:04 +02:00
Luca Boccassi
05dcd242dc docs: update RELEASE.md to use same repository for stable branches
(cherry picked from commit 62cc0aca17)
2024-07-05 20:00:04 +02:00
Daan De Meyer
0a97db8789 docs: Add section to HACKING.md on distribution packages
(cherry picked from commit 17ef81a764)
2024-07-05 20:00:04 +02:00
Mike Yuan
3c91ea49d2 docs/CODING_STYLE: document that we nowadays prefer (const char*) for func ret type
Addresses https://github.com/systemd/systemd/pull/33567#discussion_r1662818225

(cherry picked from commit 4b7249111a)
2024-07-05 20:00:04 +02:00
Franck Bui
ea92f16422 test: fix TEST-74-AUX-UTILS.ssh.sh on SUSE
(cherry picked from commit 252542ffc3)
2024-07-05 20:00:04 +02:00
Franck Bui
f52475dcf3 test: preserve symlink in inst_recursive()
On SUSE this function is used to copy symlinks installed in *.wants/
directories.

(cherry picked from commit 855bad331e)
2024-07-05 20:00:04 +02:00
Franck Bui
10b7e0a0af test: fix TEST-24-CRYPTSETUP on SUSE
/etc/systemd/journald.conf.d drop-in dir already exists on SUSE.

(cherry picked from commit 56a894e888)
2024-07-05 20:00:04 +02:00
Franck Bui
4f7d6885a1 test: install /etc/hosts
Needed for resolving the "localhost" hostname.

(cherry picked from commit a09825ce9f)
2024-07-05 20:00:04 +02:00
Daniel Rusek
e94e33b566 test: split the resolved test suite into separate test cases
Although being far from ideal and the first two test cases have to be run
before the setup phase otherwise they will fail, it still makes the test
suite look much better and easier to read

(cherry picked from commit a9d472d6e4)
2024-07-05 20:00:04 +02:00
Luca Boccassi
4d561a0e08 mkosi: update debian commit reference
* abf24e775c Add recommends on linux-sysctl-defaults
* 76cb4138d2 autopkgtest: skip qemu tests on arm64
* 0935d73526 Install new systemd-import generator

(cherry picked from commit 4739539a78)
2024-07-05 20:00:04 +02:00
Lennart Poettering
05c9bc547b units: add dep on systemd-logind.service by user@.service
Let's make sure logind is accessible by the time user@.service runs, and
that logind stays around as long as it does so.

Addresses an issue reported here:

https://lists.freedesktop.org/archives/systemd-devel/2024-June/050468.html

This addresses an issued introduced by
278e815bfa, which dropped the a dependency
from user@.service systemd-user-sessions.service without replacement.
While dropping that dependency does make sense, it should have been
replaced with the weaker dependency on systemd-logind.service, hence fix
that now.

user@.service is after all a logind concept, hence logind really should
be around for its lifetime.

systemd-user-sessions.service is a later milestone that only really
should apply to regular users (not root), hence it's too strong a
requirement.

(cherry picked from commit 29294d21cf)
2024-07-05 20:00:04 +02:00
Lennart Poettering
d1cd66ca97 repart: add sections to --help text
(cherry picked from commit 68debef4c1)
2024-07-05 20:00:04 +02:00
rhellstrom
c2f74defaa 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
(cherry picked from commit 98b1ecc917)
2024-07-05 20:00:04 +02:00
Luca Boccassi
df990be913 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

(cherry picked from commit c3f0f6f8bd)
2024-07-05 20:00:04 +02:00
Daan De Meyer
24987eb3cc 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.

(cherry picked from commit 03c9e88fb7)
2024-07-05 20:00:04 +02:00
Daan De Meyer
e34f436433 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.

(cherry picked from commit d34361149f)
2024-07-05 20:00:04 +02:00
Daan De Meyer
3c88c94432 repart: Log more about filesystem sector size
(cherry picked from commit 0e445aaa85)
2024-07-05 20:00:04 +02:00
Mike Yuan
86d47d63b0 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.

(cherry picked from commit 740cd1e0f2)
2024-07-05 20:00:04 +02:00
Zbigniew Jędrzejewski-Szmek
9dec66fc5f meson: use less verbose quoting
(cherry picked from commit c96cb64dce)
2024-07-05 20:00:04 +02:00
Daan De Meyer
6c8e99dedd 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.

(cherry picked from commit 436474dd43)
2024-07-05 20:00:04 +02:00
Daan De Meyer
78631dcafd 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.

(cherry picked from commit f392be9e77)
2024-07-05 20:00:04 +02:00
Daan De Meyer
71fb49d02c 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.

(cherry picked from commit 3cf38516bb)
2024-07-05 20:00:04 +02:00
Daan De Meyer
938f7b6f29 TEST-06-SELINUX: Explicitly pull in autorelabel.service
(cherry picked from commit 7c04137a6f)
2024-07-05 20:00:04 +02:00
Daan De Meyer
37412c952d 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.

(cherry picked from commit 98f2a332cb)
2024-07-05 20:00:04 +02:00
James Coglan
7ee60a8614 resolved: correct parsing of OPT extended RCODEs
The DNS_PACKET_RCODE() function works out the full RCODE by taking the
first octet from the OPT record TTL field and bitwise-OR-ing this with
the basic RCODE from the packet header. This results in RCODE values
being lower than they should be.

For example, if the first TTL octet is 0x7a and the basic RCODE is 3,
this function currently returns `0x7a | 3` = 123, rather than 0x7a3 =
1955.

The first TTL octet is supposed to form the upper 8 bits of a 12-bit
value, whereas the current implementation constraints the value to 8
bits and results in mis-interpreted RCODEs.

This fixes things by shifting the TTL 20 places instead of 24 and
masking off the low nibble that comes from the upper bits of the version
octet.

Note that dns_packet_append_opt() correctly converts the input RCODE
into the high octet of the OPT TTL field; this problem only affects
parsing of incoming packets.

(cherry picked from commit c40f3714c9)
2024-07-05 20:00:04 +02:00
Daan De Meyer
711f843e3a TEST-45-TIMEDATE: Use syslog identifier journalctl match
Using a unit match is racy whereas a syslog identifier match is
reliable.

(cherry picked from commit 24284098a4)
2024-07-05 20:00:04 +02:00
James Coglan
6ead24fcac resolved: allow the full TTL to be used by OPT records
Whereas RFC 1035 says the TTL field takes the "positive values of a
signed 32 bit number", and RFC 2181 says "Implementations should treat
TTL values received with the most significant bit set as if the entire
value received was zero,", the dns_packet_read_rr() function sets
rr->ttl to zero if the MSB is set.

However, EDNS(0) as specified in RFC 6891 repurposes the TTL field's 4
octets to store other information, c.f.:

                  +0 (MSB)                            +1 (LSB)
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
    0: |         EXTENDED-RCODE        |            VERSION            |
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
    2: | DO|                           Z                               |
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

The first octet extends the usual 4-bit RCODE from the packet header by
providing an additional 8 bits of space, extending the RCODE to 12 bits.
But, our handling of the TTL field means that the high bit in the first
octet is not actually usable, since setting it will mean these 4 octets
are replaced with 0. This may have the effect of making us believe a
server does not support DNSSEC when it actually set the DO bit in its
OPT record.

Here we change things so that the TTL is only set to zero for record
types other than OPT.

(cherry picked from commit 131787979c)
2024-07-05 20:00:04 +02:00
Daan De Meyer
dc0167b674 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.

(cherry picked from commit 72d121b601)
2024-07-05 20:00:04 +02:00
Zbigniew Jędrzejewski-Szmek
fb747bd8cd 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.

(cherry picked from commit bd7236912f)
2024-07-05 20:00:04 +02:00