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

74665 Commits

Author SHA1 Message Date
Mike Yuan
67e0d09368 systemctl: skip triggering unit warning if unit vanished
(cherry picked from commit 701bd9d08a)
2024-07-20 00:33:14 +02:00
Mike Yuan
bb71d5dfb4 man/systemctl: --no-reload is honored by mask/unmask/preset too
(cherry picked from commit 399646faac)
2024-07-20 00:33:14 +02:00
Tom Yan
7122e226c3 logind-dbus: set gc_mode to USER_GC_BY_PIN when disable linger
The mode switch from any to pin is currently done in create_session().
However, if no (pinning) session is created before (or after) linger
is disabled, the user will not be gc'd after that. Therefore, also
perform the mode switch when linger is being disabled.

(cherry picked from commit 1df981a74a)
2024-07-20 00:33:14 +02:00
Mike Yuan
5d6bf58cf2 logind-user: take gc_mode into account when reporting user state
Prompted by #33650

Previously, if a user manually starts user@.service (which is
something we support), we'd track it as 'manager' session.
However, since user_get_state() ignores all non-pinning sessions,
if lingering is not enabled, the user state would always be
reported as 'closing', which is spurious.

Let's instead take gc_mode into consideration, and ignore
non-pinning sessions only if USER_GC_BY_PIN.

(cherry picked from commit 56f4ab2906)
2024-07-20 00:33:14 +02:00
Zbigniew Jędrzejewski-Szmek
bcb13a3fa2 test_ukify: do not use files from /boot
They might not be readable to the unprivileged user running the tests
and it shouldn't really matter what is used. OTOH, we need a real kernel
because we look at the header.

(cherry picked from commit 987f4bce93)
2024-07-20 00:33:14 +02:00
Zbigniew Jędrzejewski-Szmek
88264411b6 test_ukify: use sha384 in the signing tests
On Fedora, with crypto policy TEST-FEDORA41, sha1 is not allowed:

$ SYSTEMD_LOG_LEVEL=debug build/systemd-measure sign
  --linux=/lib/modules/6.9.7-200.fc40.x86_64/vmlinuz
  --osrel=/tmp/tmp.osrelbl2sr77f
  --cmdline=/tmp/tmp.cmdlineouc7hqtj
  --uname=/tmp/tmp.unamecbjgesty
  --pcrpkey=/tmp/tmpufiadu8l
  --initrd=/boot/3a9d668b4db749398a4a5e78a03bffa5/6.9.7-200.fc40.x86_64/initrd
  --sbat=/tmp/tmp.sbataz9arpy0
  --private-key=/tmp/tmppyf0gx6w
  --public-key=/tmp/tmpufiadu8l
  --bank=sha1
Measuring boot phases: enter-initrd, enter-initrd:leave-initrd, enter-initrd:leave-initrd:sysinit, enter-initrd:leave-initrd:sysinit:ready
Loaded 'libtss2-esys.so.0' via dlopen()
Loaded 'libtss2-rc.so.0' via dlopen()
Loaded 'libtss2-mu.so.0' via dlopen()
PolicyPCR calculated digest: cec1a2ccb188ddd171a2be7bfa6b31cb9148776647354eb1069e0f891ed2dbe7
Failed to initialize signature context: error:03000098:digital envelope routines::invalid digest
Failed to sign PCR policy: Input/output error

(cherry picked from commit 87204601df)
2024-07-20 00:33:14 +02:00
Zbigniew Jędrzejewski-Szmek
8b3bedd821 test_ukify: add instructions
Copied directly from a1d6dbb1c9.

(cherry picked from commit a669091a43)
2024-07-20 00:33:14 +02:00
Lennart Poettering
168b788104 terminal-util: don't issue "ESC c" sequence on reset, but only when erasing the screen
ESC c is a (vaguely defined) "reset to initial state" ANSI sequence.
Many terminals clear the screen in this case, but that's a bit drastic I
think for most resets.

ESC c was added to the reset logic in
00bc83a275 (i.e. very recently), and I
don't think the effect was clear at that time.

Let's keep the ESC c in place however when we actually want to clear the
screen. Hence move it from reset_terminal_fd() into vt_disallocate().

Fixes: #33689
(cherry picked from commit 841eb9c186)
2024-07-20 00:33:14 +02:00
Daan De Meyer
5e4464bb64 mkosi: Bump default device timeout a little
We've been getting some integration test failures due to timeouts
on finding the root partition device. Let's bump the default device
timeout a little to see if it mitigates these failures.

(cherry picked from commit 70510bf282)
2024-07-20 00:33:14 +02:00
Daan De Meyer
0009ed8ee1 meson: Drop version from 256.3 to v256.2
Let's keep the stable version at the version of the previous release
until we do a new stable release. Unlike the main branch, there's no
need to immediately bump the version to the next version as the only
reason we do that in the main branch is to make sure the version from
the main branch sorts higher than any stable releases for the previous
version. This does not apply for stable releases and so we can safely
keep the old version in meson.version until we do a new stable release.
2024-07-19 14:51:47 +02:00
Daan De Meyer
1354f6194c meson: Drop ~devel suffix from systemd-stable version
Every commit in systemd-stable can be considered stable since CI has
to pass for every merge to stable and we don't do any RC releases or
extra testing when doing a new stable release. So let's reflect that
in the versioning by dropping the "~devel" suffix from meson.version.

This allows distributions to do releases from arbitrary commits in
systemd-stable without ending up with ~devel in their versions.
2024-07-19 13:30:40 +02:00
Daan De Meyer
fe37213c55
Merge pull request #33774 from DaanDeMeyer/mkosi-backport
v256-stable: Backport various mkosi changes
2024-07-18 22:35:11 +02:00
Daan De Meyer
677126d300 mkosi: Fix indentation
(cherry picked from commit 2315c6996f)
2024-07-18 21:14:47 +02:00
Daan De Meyer
4c25e572a9 mkosi: Fix typo
Our config parsing is flexible enough that this kind of worked surprisingly
enough.

(cherry picked from commit ac31804db7)
2024-07-18 21:14:41 +02:00
Daan De Meyer
400222fa1c mkosi: Drop util-linux from centos/fedora packages
It's already included in the packages list in mkosi.conf.

(cherry picked from commit 91cc65c5ad)
2024-07-18 21:14:33 +02:00
Daan De Meyer
dc3543a391 mkosi: Drop udev from Packages= list
It's pulled in via VolatilePackages=, no need to put it in Packages=.

(cherry picked from commit 1d914b268c)
2024-07-18 21:14:26 +02:00
Daan De Meyer
82e2a5f47f mkosi: Fix formatting
All of our lists start on the next line, so let's make KernelCommandLine=
fit that as well.

(cherry picked from commit 1250dc6a1d)
2024-07-18 21:14:20 +02:00
Daan De Meyer
11f065d3ee mkosi: Build CentOS Stream 10 images by default
CentOS Stream 10 has a newer util-linux which means the terminal
gets correctly resized to the size specified by mkosi. This is a
much nicer experience than CentOS Stream 9 where you're stuck on
80x24 so let's make CentOS Stream 10 the default release to build.

(cherry picked from commit 773f2e9633)
2024-07-18 21:14:11 +02:00
Daan De Meyer
c54eab5dd0 mkosi: Streamline running the integration tests without building systemd
Let's document in detail how to build the integration test image and run
the integration tests without building systemd. To streamline the process,
we stop automatically using binaries from build/ when invoking mkosi directly
and don't automatically use a tools tree anymore if systemd on the host is too
old. Instead, we document these options in HACKING.md and change the mkosi meson
target to automatically use the current build directory as an extra binary search
path for mkosi.

(cherry picked from commit d279ec4a50)
2024-07-18 21:14:03 +02:00
Daan De Meyer
3bde2db7a4 meson: Drop genkey target
In mkosi.images/system/mkosi.conf, we configure the certificate as
an extra tree so it's available inside the image. However, we pick up
the certificate from the top level repository directory and not from the
build directory where it is generated by the genkey meson target.

We currently have no way to access the build directory that mkosi was
invoked from when parsing the configuration file. Thus we have no way to
specify the correct location to the certificate when it's located in the
build directory.

For now, let's look for the key and certificate in the top level repository
root directory and drop the genkey target.

We don't have to change the Github Actions CI because it already runs genkey
manually before the image build (which is something we forgot to remove when
introducing the genkey target and is the reason this didn't cause issues before).

(cherry picked from commit b00f44c3cf)
2024-07-18 21:13:38 +02:00
Daan De Meyer
baad1c0d0e mkosi: Skip sync script if NO_BUILD is enabled
If we're not doing a build, there's no point in syncing either so
lets skip it.

(cherry picked from commit bb8f6ac445)
2024-07-18 21:12:48 +02:00
Daan De Meyer
102ed56c61 mkosi: Remove enforcing=0 from default kernel command line
We already have selinux=0 in the default kernel command line so
enforcing=0 is redundant. Instead, pass in enforcing=0 when we
enable selinux in TEST-06-SELINUX.

(cherry picked from commit f5c44df929)
2024-07-18 21:12:25 +02:00
Daan De Meyer
611e82e660 mkosi: Stop setting apparmor=0
It doesn't get pulled in as a dependency anyway and kernel command
line space is precious so let's remove apparmor=0 as it's a noop
anyway.

(cherry picked from commit 5319be5f0c)
2024-07-18 21:12:19 +02:00
migleeson
fa7892a690 docs: update mkosi version mentioned in HACKING.md (#33723)
* fix: update docs since the default config uses a setting only available in v23

* fix: update docs to only refer to installing from the mkosi repo

(cherry picked from commit cb2d6214ca)
2024-07-18 21:11:36 +02:00
Daan De Meyer
ad444842e0
Merge pull request #33735 from DaanDeMeyer/backport-mkosi
v256-stable: Backport mkosi and test related changes
2024-07-16 17:51:55 +02:00
Daan De Meyer
a63e82ca4a repart: Allow overriding fstype per partition designator
$SYSTEMD_REPART_OVERRIDE_FSTYPE is too invasive. Often you want to
override the fstype only for a specific designator, so let's support
that as well.

(cherry picked from commit 90a255779d)
2024-07-16 15:35:36 +02:00
Daan De Meyer
9d05f2d559 mkosi: List library packages explicitly in VolatilePackages=
These should already get pulled in as dependencies, but it doesn't
hurt to be explicit.

(cherry picked from commit b209fff3a5)
2024-07-16 15:15:43 +02:00
Daan De Meyer
4a55046779 mkosi: Build initrd as a subimage
Let's make things a little more consistent and build the initrd
explicitly as a subimage as well instead of relying on mkosi building
it as part of the main image build.

We drop the opensuse initrd postinst script as we don't use erofs by
default anymore. We can always reintroduce it again later if needed.

(cherry picked from commit 68ee977114)
2024-07-16 15:15:36 +02:00
Daan De Meyer
81bafc8dd9 mkosi: Drop CacheOnly=always from two subimages
This is a universal setting and can only be configured in the main
image so let's drop it from the subimages.

(cherry picked from commit 244952b1ea)
2024-07-16 15:15:30 +02:00
Daan De Meyer
1be0b1f54b TEST-13-NSPAWN: make sure we don't load libnss_systemd
Let's make sure we don't load libnss_systemd.so from bash as the
necessary environment variables aren't set to make that work when
we're running with sanitizers enabled.

We can't add a sanitizer wrapper for bash as the wrapper runs using
bash so you end up in a loop.

(cherry picked from commit 5ac0dc70ff)
2024-07-16 15:15:21 +02:00
Daan De Meyer
0b9df91ce2 mkosi: Disable unique debug source names
We use -fdebug-prefix-map= because debugedit doesn't work for us (for
a currently unknown reason since it's the most obtuse code I've ever
had the pleasure of reading). With all the unique macros enabled, the
destination directory we pass to -fdebug-prefix-map= includes the package
release. The release is either the timestamp of the current commit or
the current time if the working tree is dirty. This means it generally
changes every time we rerun the build script. However, meson only reads
compiler arguments the first time it is invoked or if --wipe is specified.
This means that on a rerun -fdebug-prefix-map= will be configured wrong
and the build will fail.

Let's prevent this from happening by disabling the unique debug source
names by overriding the --unique-debug-src-base option that is passed to
find-debuginfo.sh by rpm via the _find_debuginfo_opts macro.

(cherry picked from commit 88221219a3)
2024-07-16 15:15:14 +02:00
Daan De Meyer
89904fc10c systemd-networkd-tests: Skip tests requiring dhcpd if it is not available
dhcpd is not available on CentOS Stream 10

See https://github.com/systemd/systemd/issues/33717

(cherry picked from commit 985d5b4bc2)
2024-07-16 15:15:08 +02:00
Daan De Meyer
c3342c3dc7 TEST-55-OOMD: Remove the opensuse user@ dropin
Required to make TEST-55-OOMD pass on OpenSUSE.

(cherry picked from commit f65ec2e904)
2024-07-16 15:15:01 +02:00
Daan De Meyer
127f8362c1 mkosi: Install binutils
(cherry picked from commit a1071c1249)
2024-07-16 15:14:55 +02:00
Daan De Meyer
1a995b9d66 TEST-64-UDEV-STORAGE: Use max_ioqpairs instead of num_queues
Fixes a deprecation warning from qemu.

(cherry picked from commit d97b48176b)
2024-07-16 15:14:47 +02:00
Daan De Meyer
367ad876a6 mkosi: Use clang --print-runtime-dir
(cherry picked from commit 6e212a6db9)
2024-07-16 15:14:41 +02:00
Daan De Meyer
8b859fa29d mkosi: Extend arch build script comment about symlinks
(cherry picked from commit 54ab97e59d)
2024-07-16 15:14:35 +02:00
Daan De Meyer
a8a7a6716e test: do not attempt to set xattr on tmpfs
This is only possible since a recent kernel version, and fails otherwise,
like on CentOS 9

(cherry picked from commit ff8c89aa5a)
2024-07-16 15:14:28 +02:00
Daan De Meyer
3fc259ae25 mkosi: Add CI for CentOS Stream 10
We switch to the c10s-sig-hyperscale branch of the spec repository
as it will receive all the latest changes the earliest before they
end up in the c9s-sig-hyperscale branch.

(cherry picked from commit 8b32cc79ec)
2024-07-16 15:14:21 +02:00
Daan De Meyer
945013a092 mkosi: Use squashfs for sysext if mkfs.erofs is not available
CentOS Stream 10 does not have erofs-utils so let's add a fallback
to squashfs when building the sysext.

(cherry picked from commit 3cfb020cb9)
2024-07-16 15:14:13 +02:00
Daan De Meyer
480f8fa839 mkosi: Make epel repositories optional for CentOS Stream 9
This allows us to add CI for CentOS Stream 10 as EPEL 10 doesn't
exist yet and won't exist for quite some time.

CentOS Stream 10 will be enabled later as soon as
https://issues.redhat.com/browse/RHEL-46604 is resolved.

(cherry picked from commit 0e4a7ab6d5)
2024-07-16 15:14:05 +02:00
Daan De Meyer
76e14148f6 mkosi: Introduce build image
We want the exitrd image to be built with the latest systemd as well.
As the exitrd image is built as part of mkosi.images, and all subimages
are built before the main image, this implies the packages must be built
as a subimage in mkosi.images/ as well. So we introduce the build image and
move all logic related to building distribution packages there.

This also has the nice side effect of slimming down the main image as the
build dependencies are not installed into the main image anymore. It also
makes sure the packages are built in a "clean" chroot without any of the
other packages which we install in the main image available.

(cherry picked from commit 7205fc7dc3)
2024-07-16 15:13:42 +02:00
Daan De Meyer
abc3a61e59 mkosi: update fedora commit reference
* a3524fc837 Use a more precise Recommends for libkxbcommon
* 980ede8c0f Drop machined revert
* d569018a92 Rebuilt for the bin-sbin merge
* 8881fa94ee Version 256.2
* 1cc4f83002 Link systemd-executor statically
* 0319e62d9c Update dracut workaround
* c96f54de22 Fix ELN build
* 3f68c5d802 Only exclude dracut conflicts on non-fedora on upstream builds
* 7db154308b Conditionalize dracut Conflicts more

(cherry picked from commit 72a8f508e5)
2024-07-16 15:10:28 +02:00
Daan De Meyer
748cd5a703 mkosi: Update to latest
(cherry picked from commit 9e8cfe5daa)
2024-07-16 15:10:20 +02:00
Daan De Meyer
6d07d59237
Merge pull request #33691 from DaanDeMeyer/backport-mkosi
Backport mkosi and integration test changes to v256-stable
2024-07-11 16:42:06 +02:00
Daan De Meyer
180814f22f mkosi: Switch back to code.opensuse.org for opensuse
The commits on src.opensuse.org keep disappearing so let's switch
back to code.opensuse.org.

(cherry picked from commit a86211b7ca)
2024-07-11 14:13:20 +02:00
Luca Boccassi
976a0d998e test: install split-out sshd-session binary if present
Archlinux split out one ssh binary, install it in the legacy test
setup if present for the tests that need ssh

(cherry picked from commit aaa7b36bd1)
2024-07-11 13:48:52 +02:00
Daan De Meyer
ca97b9a7e6 mkosi: update opensuse commit reference
*   8c025c3bdf Accepting request 1184267 from Base:System
|\
| * 735f8c4ba4 - Import commit 5a8eadd0c021758337a020c423f25a353bdb9b3c (merge of v255.8)   For a complete list of changes, visit:   603cd1d4d8...5a8eadd0c0 - Drop 5003-Revert-run-pass-the-pty-slave-fd-to-transient-servic.patch as v255.8   contains the workaround (commit 639c922ede9485) for the broken commit   28459ba1f4.
* | 37853fecc3 Accepting request 1183029 from Base:System
|/
* 638de11012 - Don't automatically clean unmodified config files up (bsc#1226415)
* 369c023c24 reorder one more time...
* ffa9f0ac80 reorder the runtime deps of the testsuite package so the format_spec_file thingy stop screwing up the spec file...
* 12c1190a79 fix rev 1529: the devel packages are really needed by the testsuite script to install the dlopened libs into the image
* ca8e7f54ce - systemd.spec: move a misplaced %endif in the testsuite sub-package.
* b7944f5b14 - Merge systemd-coredump back into the main package (bsc#1091684)
* 3fa0dea84a - Don't pull the devel packages in when installing the testsuite package.

(cherry picked from commit eb6f177ae4)
2024-07-11 12:48:58 +02:00
Daan De Meyer
fef4746218 tools/update-distro-hash: Fix path
(cherry picked from commit dfea7a8d26)
2024-07-11 12:48:49 +02:00
Daan De Meyer
54eb9b9301 TEST-06-SELINUX: Various fixes
- Stop installing the policy in the initramfs as it's not really
supported anyway (https://github.com/fedora-selinux/selinux-policy/issues/2221)
- Stop relabeling on first boot and prefer to do it at image build time
- Disable mkosi relabeling by default but enable it in CI
- Build image as root in CI so the SELinux relabeling works properly

(cherry picked from commit dedd712dd9)
2024-07-11 12:48:41 +02:00