1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-08 09:57:41 +03:00

74350 Commits

Author SHA1 Message Date
Luca Boccassi
ab11d7e177 mkosi: policykit-1 was renamed to polkitd
(cherry picked from commit bffd3c52ad7113f21523568120d84326151f4600)
2024-07-09 15:13:28 +02:00
Daan De Meyer
8dd54e5adc mkosi: Use the "default" root filesystem for each distribution
Let's not insist on btrfs everywhere. 93440db8b5eae1244aaf5fecfa68050a8b26f3e3
switched us back to btrfs as we wanted to rely on the fact it records
timestamps properly. Since we now prefer to do incremental builds on the host
with "mkosi -t none" we don't mind anymore that timestamps are not recorded
properly so we're not forced to use btrfs anymore.

This also increases test coverage as we'll now test with different root
filesystems.

(cherry picked from commit 5db8db5e346371c7f11805f1a07e7f3e1c48a96b)
2024-07-09 15:13:12 +02:00
Zbigniew Jędrzejewski-Szmek
d28aa922fd meson: add option to build systemd-executor "statically"
The new link-executor-shared option is similar to the existing
link-udev-shared: when set to false, we link to the static versions of our
internal libraries.

The resulting exuctor binary is fairly large, about as large as libsystemd-core
(14 MB without lto, 8 with lto).

This is intended as a workaround for the fuckup with the pinned executor
binary:
when an upgrade is performed, the package manager will install new version of
the libraries and new version of the code, and some time later reexecute the
managers. This creates a window when the pinned executor binary will fail to
execute. There are two factors which make the issue easier to hit:

- when the distribution uses a finely-grained shared-lib-tag. E.g. Fedora
  uses version-release as the tag, which means that the issue occurs on
  every package upgrade. This is the right thing to do, because the
  ABI of our internal libraries is not stable at all, so replacing the
  library from a different version in place creates a window where our
  programs may crash or misbehave.

- when the distribution doesn't immediately reexec all the managers after
  upgrade. In early versions of systemd, we used to hammer the machine during
  upgrade, doing daemon-reexecs repeatedly. This works, but is ugly and
  wasteful. Doing the reexecs while the upgrade is in progres also creates a
  window where a mix of old and new configs or both is loaded. Users are
  particularly annoyed by those reloads if there is some issue in the
  configuration causing us to emit warnings on every reexec. Doing the
  reexecs once after the new configuration and libraries have been put
  in place is nicer.

The pinning of the executor binary breaks upgrades and in particular
it penalizes the distributions which make use of the features which
were previously added to avoid bugs and inefficiency during upgrades.

When the executor is linked statically, there is a smaller chance that it'll
fail to load libraries. The issue can still occur because other libraries, not
our own, are linked dynamically.

(cherry picked from commit d59cae6cebd0fc25a16a020bd28e5303901f1b19)
2024-07-08 19:26:15 +02:00
Zbigniew Jędrzejewski-Szmek
c3b4032fc3 meson: build libsystemd-core via an intermediate static library
By itself, this is not useful. I'm making this a separate commit to
make debugging easier. It turns out that meson does static libraries
using references, so the "static library" a tiny stub stub that refers
to the object files on disk and this has negligible cost:
$ ls -lhd build/src/core/libsystemd-core-257.{a,so}
-rw-r--r-- 1 zbyszek zbyszek  36K Jul  3 16:54 build/src/core/libsystemd-core-257.a
-rwxr-xr-x 1 zbyszek zbyszek 6.1M Jul  3 16:54 build/src/core/libsystemd-core-257.so

(cherry picked from commit d0689ee5fbfafa736e6eca89bc80cb2d372f2229)
2024-07-08 19:26:15 +02:00
Zbigniew Jędrzejewski-Szmek
9be2fe707e meson: rename libbasic to libbasic_static
Our variables for internal libraries are named 'libfoo' for the shared lib
variant, and 'libfoo_static' for the static lib variant. The only exception was
libbasic, because we didn't have a shared variant for it. But let's rename it
for consitency. This makes the build config easier to understand.

(cherry picked from commit 732ed8a84e8b264fccd3f5c0fc68ec2894b6d8ea)
2024-07-08 19:26:15 +02:00
Luca Boccassi
fcbafc3ffe Bump meson version to 256.3~devel 2024-07-05 19:03:32 +01:00
Luca Boccassi
c7e144eb4a Finalize v256.2 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 5dfc88c12f541ff11ad53634be9ca40f13423467)
2024-07-05 20:00:04 +02:00
Mike Yuan
aa1eb0b066 labeler: match all mkosi files
(cherry picked from commit a3370d5d94167eddf9b0e6efd6a76bb5348afb9d)
2024-07-05 20:00:04 +02:00
Mike Yuan
32f2b9bba6 labeler: remove matches for dropped files (Makefile)
(cherry picked from commit 5e12de940a4220b22754c12668474462df64090e)
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 44ec70489f377d1fa9f4e19aed95a7e39da7d93d)
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 a79b6dc0706dd5fe76ec56b3308b402c133ead23)
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 fc9938d6f8e7081df5420bf88bf98f683b1391c0)
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 b4d6bc63e602048188896110a585aa7de1c70c9b, but
forgot to to update the table at the bottom to fully reflect the update.
Fix that.

(cherry picked from commit 72a6296b16a75d4e26eec972f2999e69c9967b9d)
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 39aafbd42ac3d9675098c8212261fa56261d9066)
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 26db8fe2478316825c5596e4b93b08176a8abddb)
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 37543971aff79f3a37646ffc2bb5845c9394797b

(cherry picked from commit 92d1fe3efac7b3a700317ec71b64cab5ebc17b42)
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 e81025970fed5673c631976711d45c67b0443bb4)
2024-07-05 20:00:04 +02:00
Ronan Pigott
cc4472c31e zsh: add run0 completions
(cherry picked from commit ef98603f4b88738be3c262ee4bd06209e5a3edf5)
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 a2403af3293aef9fa5cf32f5ab9fa4eebe5406db)
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 aa329b89223a79793cde8288b1bc6e93db174938)
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 2fda6f5fffcc05adaa5a08d976e09ad7cc97c1b3)
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 6851abe40381cd2c5f059eccc22c6967d0b034e5)
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 236cd4854657745e1a59b224a191a232a476527e)
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 48d6dad100d0b42c02aa21d897e913461f6b3cc3)
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 e6b2508275aac2951aedfc842735d8ebc29850bb)
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 62cc0aca1750e90dce20463fab03362c26d6df0f)
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 17ef81a764995dfd0f43daf34dcf2ab04806e760)
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 4b7249111a4c1d366f476bdbd6e03f7893eb9d42)
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 252542ffc3fda9b110d108a1bce1a1d562baebd4)
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 855bad331e28a03d7ad5831caacd3481db938180)
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 56a894e888002f44f3463b3188f9d5abdcca4bb0)
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 a09825ce9fb3bd315f35654b6e6ee4f92c675cde)
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 a9d472d6e4ae6c548dd24097b20563dc9c06b329)
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 4739539a7866f660cec5d746af65a951cdab8dc4)
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
278e815bfa3e4c2e3914e00121c37fc844cb2025, 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 29294d21cf82323bf04a9dbb5a03d48d6f758822)
2024-07-05 20:00:04 +02:00
Lennart Poettering
d1cd66ca97 repart: add sections to --help text
(cherry picked from commit 68debef4c12e7a25362e8ddbc752feee8c13762b)
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 98b1ecc9175a8bb241292f6f441a754b6759dd97)
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 c3f0f6f8bd812fee4b2ab658a5cc9ac9167d387d)
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 03c9e88fb7eb8973477c33aa63dc6bcf0cab52c9)
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 d34361149f897eac5c6a41854fa4edca4804b49b)
2024-07-05 20:00:04 +02:00
Daan De Meyer
3c88c94432 repart: Log more about filesystem sector size
(cherry picked from commit 0e445aaa8553ff4ddf8330913260e5f167b1690d)
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 740cd1e0f2ae5cc1a10d2111d63cc4e975761091)
2024-07-05 20:00:04 +02:00
Zbigniew Jędrzejewski-Szmek
9dec66fc5f meson: use less verbose quoting
(cherry picked from commit c96cb64dce2e15f50253b34538662845e25e8d1c)
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 436474dd4348d5f12f70d9032d1cc45171b335e7)
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 f392be9e7756268fc1b9d5204adc642bee10c8fa)
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 3cf38516bb765126fee80fed6d984ae963d075de)
2024-07-05 20:00:04 +02:00
Daan De Meyer
938f7b6f29 TEST-06-SELINUX: Explicitly pull in autorelabel.service
(cherry picked from commit 7c04137a6f09f8536ea3dfb667bd5a862fe945f1)
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 98f2a332cb1a3efc3b2e8a5914a895a0a051bda4)
2024-07-05 20:00:04 +02:00