systemd/.git
16 months agozsh/_networkctl: remove duplicated argument for completion (#31926)
Collin L [Mon, 22 Jul 2024 09:36:47 +0000 (17:36 +0800)]
zsh/_networkctl: remove duplicated argument for completion (#31926)

It is unnecessary, which will mess the completion.

(cherry picked from commit 733518b41350ce781c7e41a4c866eafb9e549e1f)

16 months agoimport-creds: when we hit ENOENT on SMBIOS 11 do not even debug log
Lennart Poettering [Thu, 11 Jul 2024 12:32:09 +0000 (14:32 +0200)]
import-creds: when we hit ENOENT on SMBIOS 11 do not even debug log

We'll *always* hit ENEOENT when iterating through SMBIOS type #11
fields, on the last one. it's very confusing to debug log about that,
let's just not do it.

(cherry picked from commit 5202ee42d5da0ae3a6655d2bc959a19d8c347e9d)

16 months agocore/unit: ignore dropins for masked units completely when checking need_reload
Mike Yuan [Mon, 8 Jul 2024 15:12:20 +0000 (17:12 +0200)]
core/unit: ignore dropins for masked units completely when checking need_reload

Follow-up for 19a44dfe4525ab01caf593a9c2beada4b412910d

If a drop-in is set from upper level, e.g. global unit_type.d/,
even if a unit is masked, its dropin_paths would still be partially
populated. However, unit_need_daemon_reload() would always
compare u->dropin_paths with empty strv in case of masked units,
resulting in it always returning true. Instead, let's ignore
dropins entirely here.

Fixes #33672

(cherry picked from commit 11b3775f514f521f353741ff6ac4d66cf0e928e8)

16 months agotest: add a reproducer for #33672
David Tardon [Fri, 12 Jul 2024 12:38:08 +0000 (14:38 +0200)]
test: add a reproducer for #33672

(cherry picked from commit 8b6de9e6381b39f59c936d2b0c6ce47f1b70a19e)

16 months agoshared: log error when execve fail
Mauri de Souza Meneguzzo [Tue, 25 Jun 2024 02:47:15 +0000 (23:47 -0300)]
shared: log error when execve fail

If there is an error with the execv call in fork_agent the
program exits without any meaningful log message. Log the
command and errno so the user gets more information about
the failure.

Fixes: #33418

Signed-off-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
(cherry picked from commit a408d4453145621902b9a3ef78a552f83b09bd8d)

16 months agotest-execute: ExecStop= and friends should not get credentials
Mike Yuan [Tue, 30 Apr 2024 13:55:05 +0000 (21:55 +0800)]
test-execute: ExecStop= and friends should not get credentials

See #32583

(cherry picked from commit 60b218e36e96236e6ba386686f130fe34d3e1c2a)

16 months agotest: override blocking localed policy in TEST-73-LOCALE
Luca Boccassi [Sat, 20 Jul 2024 10:34:51 +0000 (11:34 +0100)]
test: override blocking localed policy in TEST-73-LOCALE

On Debian and derivatives writing calls to localed are blocked as other
tools are used to change settings, override that policy for the tests

(cherry picked from commit 7b5c38a91def6cf236605010a0a93a1cd4c137e9)

16 months agomeson: fix missing failure if bpf-framework was enabled
Dominique Martinet [Sat, 20 Jul 2024 11:38:37 +0000 (20:38 +0900)]
meson: fix missing failure if bpf-framework was enabled

If building with clang and clang does not support bpf, then enabling
-Dbpf-framework=enabled would silently drop the feature (even printing
bpf-framework: enabled in the meson build recap, and no message anywhere
that'd hint at the failure!)

This is unexpected, so add check to fail hard in this case.

All other code paths (gcc, missing bpftool) properly check for the
option, but it is not as easy for a custom command so check explicitly

(cherry picked from commit 8da20e3fe2a544979922cea457de3031aa74d64c)

16 months agozsh: add varlinkctl completions
Ronan Pigott [Fri, 19 Jul 2024 08:20:15 +0000 (01:20 -0700)]
zsh: add varlinkctl completions

(cherry picked from commit af63b4b769bfb86ff7848af980268901e9c0b47d)

16 months agodocs: Document how to do stable releases
Daan De Meyer [Fri, 19 Jul 2024 12:00:04 +0000 (14:00 +0200)]
docs: Document how to do stable releases

(cherry picked from commit 518ea76ecdf4855a2db2c0d31ee45f4db48e3242)

16 months agoman: Mention Type=oneshot timeout directive
Lucas Werkmeister [Tue, 16 Jul 2024 16:15:32 +0000 (18:15 +0200)]
man: Mention Type=oneshot timeout directive

Make the warning for oneshot services (where RuntimeMaxSec= has no
effect) more actionable by pointing to the directive people can use
instead to effectively limit their runtime.

(cherry picked from commit 8c4aa0f1c6a78b35712fa6a7acf6d755d0c0bd86)

16 months agol10n: fix credits for the French translation
Léane GRASSER [Thu, 18 Jul 2024 13:15:16 +0000 (15:15 +0200)]
l10n: fix credits for the French translation

(cherry picked from commit 0d8b38415c4b192c1a4e608da8dc16c7340e31ba)

16 months agosd-device: remove debug log message when dirs are missing
Lennart Poettering [Wed, 17 Jul 2024 13:56:59 +0000 (15:56 +0200)]
sd-device: remove debug log message when dirs are missing

This is a common case, and nothing noteworthy at all. For example, if we
establish an enumerator for listing all devices tagged by some tag, then
the per-tag dir is not going to exist if there are currently no devices
tagged that way, but that's a really common case, and doesn't really
deserve any mention, not even at debug level.

(cherry picked from commit a68c97a54527cacaeeac0c117493639fc455ef5e)

16 months agoid128: refuse --app-specific= if we're listing GPT types
Mike Yuan [Tue, 16 Jul 2024 19:10:46 +0000 (21:10 +0200)]
id128: refuse --app-specific= if we're listing GPT types

Prompted by #33737

The intention of b37e8184a5a376749fbf68674ed6d7a4fc9901aa
is to expose sd_id128_get_app_specific() on command line.
But combining that with GPT type list makes little sense.

(cherry picked from commit fa96c55b7b0d19a7f72908ee7d3f8a1ef630be96)

16 months agogpt: add more architecture aliases
Luca Boccassi [Tue, 16 Jul 2024 16:46:54 +0000 (17:46 +0100)]
gpt: add more architecture aliases

Same as the other aliases. Allows chaining commands like:

$ systemd-id128 show -P root-$(dpkg-architecture --query DEB_HOST_ARCH)
4f68bce3e8cd4db196e7fbcaf984b709

(cherry picked from commit f0b151ce864371da06a4d4a63a2a8b5282817b7e)

16 months agokernel-install: Remove existing loader entries and UKIs
Jörg Behrmann [Fri, 12 Jul 2024 08:43:54 +0000 (10:43 +0200)]
kernel-install: Remove existing loader entries and UKIs

When boot counting is enabled, adding a new loader entry or UKI can conflict
with an existing one that has booted successfully and therefore has its boot
counter removed. systemd-bless-boot will fail to bless the new successful boot,
since a file without a boot counter already exists. Since kernel-install will
clobber existing files without boot counting, we should therefore remove files
without a boot count as well, when we add a file with one.

Fixes: #33504
(cherry picked from commit 99d4575e541fa1fb00dc80f7aad572f3a66db461)

16 months agobootspec: correct log level for fatal errors
Lennart Poettering [Fri, 5 Jul 2024 08:13:35 +0000 (10:13 +0200)]
bootspec: correct log level for fatal errors

(cherry picked from commit 7b7f4c26089ab7c34c854a2713f35ccd262cc15a)

16 months agobootspec: implement sorting by tries left/done, to match what sd-boot does
Lennart Poettering [Fri, 5 Jul 2024 07:52:58 +0000 (09:52 +0200)]
bootspec: implement sorting by tries left/done, to match what sd-boot does

(cherry picked from commit 35451a32043504013eed5725c8be46b36ccdf71a)

16 months agoboot: compare filename suffixes without case
Lennart Poettering [Thu, 4 Jul 2024 15:07:59 +0000 (17:07 +0200)]
boot: compare filename suffixes without case

This is VFAT world after all.

(cherry picked from commit 764faf60400bafb1764b728aafe0dcf4cbf07364)

16 months agoman: some fixes
Lennart Poettering [Fri, 5 Jul 2024 16:52:07 +0000 (18:52 +0200)]
man: some fixes

Addons are called addons, say so. And some other fixes.

(cherry picked from commit 40d9c16d1ee98c16af5804bab256b62c37feac3b)

16 months agoman: fix typo in unit options section
Kuntal Majumder [Tue, 9 Jul 2024 17:11:52 +0000 (19:11 +0200)]
man: fix typo in unit options section

Fixes #32918

(cherry picked from commit f9572d2b89341dfb224aa2c7222a316e59627bc9)

16 months agofsck: do not pull down mount units on soft-reboot
Luca Boccassi [Mon, 8 Jul 2024 15:23:06 +0000 (16:23 +0100)]
fsck: do not pull down mount units on soft-reboot

Otherwise they will pull down the disk too, which we don't want on soft-reboot

(cherry picked from commit bbb0b72849ebbeeb8e252d9aeed94521df4f0ae8)

16 months agoman: fix typo in the alias symlink name
ZHANG Yuntian [Fri, 5 Jul 2024 09:04:44 +0000 (17:04 +0800)]
man: fix typo in the alias symlink name

Symlink created by Alias will use the value as the file name.

(cherry picked from commit 3f0e7fd4fd1d20e3f4be18f485c76d25ce10f41b)

16 months agovmspawn: define default machines for mips targets
Henry Chen [Fri, 5 Jul 2024 03:19:35 +0000 (11:19 +0800)]
vmspawn: define default machines for mips targets

All mips variants of qemu-system default to malta.

Signed-off-by: Henry Chen <henry.chen@oss.cipunited.com>
Signed-off-by: Henry Chen <chenx97@aosc.io>
(cherry picked from commit 3bff57b7651caab41021dbcdf658c1a92c8fdf52)

16 months agopath: drop IN_ATTRIB from parent directory watches
Ronan Pigott [Mon, 1 Jul 2024 21:07:28 +0000 (14:07 -0700)]
path: drop IN_ATTRIB from parent directory watches

When watching a given pathspec, systemd unconditionally installs
IN_ATTRIB watches to track the link count of the resolved file. This
way, we are notified if the watched path disappears, even if the
resolved file inode is not removed.

Similarly, systemd installs inotify watches on each parent directory, to
be notified when the specified path appears. However, for these watches
IN_ATTRIB is an unnecessary addition to the mask. In inotify, IN_ATTRIB
on a directory is emitted whenever the attributes of any child changes,
which, for many paths, has the potential to cause a high number of
spurious wakeups in systemd. Let's remove IN_ATTRIB from the mask when
installing watches on the parent directories of the specified path.

(cherry picked from commit 8bf8c7d83dcffffa55b5f534fb98db6b01315dc1)

16 months agoRemove extra period at the end of systemd-bsod's unit description. (#33632)
fwfy [Sat, 6 Jul 2024 09:17:20 +0000 (05:17 -0400)]
Remove extra period at the end of systemd-bsod's unit description. (#33632)

* Remove extra period at end of unit description.

Having an extra period at the end of this unit description makes log entries pertaining to it appear weirdly, as it seems the default expectation is that there is not to be a period at the end of a unit description.

e.g.: `systemd[1]: Started Displays emergency message in full screen..`

(cherry picked from commit 496b4fa0e974d7a1b10b8af966da445a28f512c5)

16 months agotest: Set priority for TEST-73-LOCALE
Daan De Meyer [Fri, 5 Jul 2024 20:31:55 +0000 (22:31 +0200)]
test: Set priority for TEST-73-LOCALE

I don't know why yet, but TEST-73-LOCALE can take more than 10
minutes. Until we figure out why, let's give it a higher priority
so it doesn't bottleneck the test run.

(cherry picked from commit 14963ea90d72300d3e27b5776d1aa45594b10a94)

16 months agoTEST-06-SELINUX: Disable RuntimeBuildSources=
Daan De Meyer [Fri, 5 Jul 2024 17:20:42 +0000 (19:20 +0200)]
TEST-06-SELINUX: Disable RuntimeBuildSources=

Otherwise fixfiles will try to relabel it which could potentially
lead to disaster. We also change the recommendation in HACKING.md
to set the default so that TEST-06-SELINUX can override it.

(cherry picked from commit 575f954b5d0e03d41fe08ce2a7d85b868e89b904)

16 months agotest: Add missing --no-rebuild to doc
Daan De Meyer [Fri, 5 Jul 2024 14:06:34 +0000 (16:06 +0200)]
test: Add missing --no-rebuild to doc

Otherwise meson will try to rebuild all targets.

(cherry picked from commit b5eaa52d4958f24aba21a4a34e585156079d4abb)

16 months agomeson: Bump version to 256.3
Daan De Meyer [Fri, 19 Jul 2024 13:58:04 +0000 (15:58 +0200)]
meson: Bump version to 256.3

16 months agocore/cgroup: check root cgroup earlier for unit_get_memory_accounting
Mike Yuan [Thu, 13 Jun 2024 09:00:26 +0000 (11:00 +0200)]
core/cgroup: check root cgroup earlier for unit_get_memory_accounting

(cherry picked from commit d3d035395eeced715c9609aeb8bfac7157dd0aa9)

16 months agocore/cgroup: make unit_has_host_root_cgroup take const Unit*
Mike Yuan [Sat, 15 Jun 2024 11:15:08 +0000 (13:15 +0200)]
core/cgroup: make unit_has_host_root_cgroup take const Unit*

(cherry picked from commit 4442aef08e0fe8ba381b580455f7eb281c5a28a1)

16 months agocore: unify reset_accounting handling
Mike Yuan [Sat, 1 Jun 2024 23:50:09 +0000 (07:50 +0800)]
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

(cherry picked from commit bc347edfe075f36bada0e1e7aefd62b10fcad4a7)

16 months agocore: do not drop CGroupRuntime when unit stops, but only on GC
Mike Yuan [Wed, 5 Jun 2024 18:06:46 +0000 (20:06 +0200)]
core: do not drop CGroupRuntime when unit stops, but only on GC

Fixes #33149
Replaces #33145

(cherry picked from commit 4918f14adabba71913cf3abb8b5d50a8ca0fe844)

16 months agocore/cgroup: use > 0 comparison rather than == 1
Mike Yuan [Sat, 1 Jun 2024 22:37:08 +0000 (06:37 +0800)]
core/cgroup: use > 0 comparison rather than == 1

(cherry picked from commit 8153be97c46dec725fdfaa3358d518ce350bb2ec)

16 months agocore/cgroup: actually make use of the cached accounting values
Mike Yuan [Thu, 13 Jun 2024 09:01:03 +0000 (11:01 +0200)]
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

(cherry picked from commit 3849d1f56b7ff9db94656ca84156eb9fe1574ecb)

16 months agotest-install-root: introduce test case for #33411
Mike Yuan [Wed, 19 Jun 2024 19:28:05 +0000 (21:28 +0200)]
test-install-root: introduce test case for #33411

(cherry picked from commit 9fb5a8ca24e677e10f8c2b8973b5e2a11676bda0)

16 months agoshared/install: correctly report changes in install_info_symlink_alias()
Mike Yuan [Wed, 19 Jun 2024 16:45:14 +0000 (18:45 +0200)]
shared/install: correctly report changes in install_info_symlink_alias()

Follow-up for b2751cf0394d36c24590b5f7b33e9f864b57ba0d

Also make the conditions consistent for install_info_symlink_wants().

Fixes #33411

(cherry picked from commit 4441cf330b3847d6c553fb230e8e4c86aa75ebb9)

16 months agoshared/install: propagate all errors in install_info_apply()
Mike Yuan [Wed, 19 Jun 2024 16:59:15 +0000 (18:59 +0200)]
shared/install: propagate all errors in install_info_apply()

Currently, install_info_apply() only updates r if it's 0,
meaning that if one of the earlier install_info_symlink_alias/wants()
calls returns > 0, errors generated by later calls will be discarded.
Fix that.

(cherry picked from commit a159aa07e1548367d2fde80cb0d45b869c591864)

16 months agoshared/install: drop unneeded initialization
Mike Yuan [Wed, 19 Jun 2024 16:44:26 +0000 (18:44 +0200)]
shared/install: drop unneeded initialization

(cherry picked from commit dd6b325a05c4caccd1a17dd4147f48a916eee386)

16 months agosystemctl: do not try to acquire triggering units for template units
Mike Yuan [Sun, 30 Jun 2024 11:12:45 +0000 (13:12 +0200)]
systemctl: do not try to acquire triggering units for template units

(cherry picked from commit 09d6038d833468ba7c24c658597387ef699ca4fd)

16 months agosystemctl: skip triggering unit warning if unit vanished
Mike Yuan [Thu, 29 Feb 2024 15:45:54 +0000 (23:45 +0800)]
systemctl: skip triggering unit warning if unit vanished

(cherry picked from commit 701bd9d08ac1d16f74e2b453ca0826e85b1c8491)

16 months agoman/systemctl: --no-reload is honored by mask/unmask/preset too
Mike Yuan [Fri, 28 Jun 2024 13:56:44 +0000 (15:56 +0200)]
man/systemctl: --no-reload is honored by mask/unmask/preset too

(cherry picked from commit 399646faac8ca91a46287e40280f56055c9e0fe8)

16 months agologind-dbus: set gc_mode to USER_GC_BY_PIN when disable linger
Tom Yan [Mon, 8 Jul 2024 14:10:43 +0000 (22:10 +0800)]
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 1df981a74ae19513b40167c6b320c30bd166ac34)

16 months agologind-user: take gc_mode into account when reporting user state
Mike Yuan [Sat, 6 Jul 2024 17:05:57 +0000 (19:05 +0200)]
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 56f4ab290643547853276fb72b4e6960586c3e7c)

16 months agotest_ukify: do not use files from /boot
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2024 12:43:32 +0000 (14:43 +0200)]
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 987f4bce938e790622a4b4b89d37daa7adfdc141)

16 months agotest_ukify: use sha384 in the signing tests
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2024 12:48:37 +0000 (14:48 +0200)]
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 87204601df305c270ffa05430081bc5b76dede04)

16 months agotest_ukify: add instructions
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2024 12:50:43 +0000 (14:50 +0200)]
test_ukify: add instructions

Copied directly from a1d6dbb1c94685d7972f63ed2762fe4ba0251287.

(cherry picked from commit a669091a436c4f0c8537c83bba05a1e33d263dad)

16 months agoterminal-util: don't issue "ESC c" sequence on reset, but only when erasing the screen
Lennart Poettering [Thu, 11 Jul 2024 07:34:11 +0000 (09:34 +0200)]
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
00bc83a275fa3ca8d90579fe9597d8b651d47332 (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 841eb9c186816acfef8f3f724647a7f0649f214d)

16 months agomkosi: Bump default device timeout a little
Daan De Meyer [Fri, 19 Jul 2024 11:24:35 +0000 (13:24 +0200)]
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 70510bf2823b6fcad504d67c3e3eb2b11c5ef6c9)

16 months agomeson: Drop version from 256.3 to v256.2
Daan De Meyer [Fri, 19 Jul 2024 11:49:01 +0000 (13:49 +0200)]
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.

16 months agomeson: Drop ~devel suffix from systemd-stable version
Daan De Meyer [Fri, 19 Jul 2024 09:41:28 +0000 (11:41 +0200)]
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.

16 months agoMerge pull request #33774 from DaanDeMeyer/mkosi-backport
Daan De Meyer [Thu, 18 Jul 2024 20:35:11 +0000 (22:35 +0200)]
Merge pull request #33774 from DaanDeMeyer/mkosi-backport

v256-stable: Backport various mkosi changes

16 months agomkosi: Fix indentation
Daan De Meyer [Thu, 18 Jul 2024 11:01:27 +0000 (13:01 +0200)]
mkosi: Fix indentation

(cherry picked from commit 2315c6996f198b44034fab7a02dc4b8a21c13248)

16 months agomkosi: Fix typo
Daan De Meyer [Thu, 18 Jul 2024 10:53:53 +0000 (12:53 +0200)]
mkosi: Fix typo

Our config parsing is flexible enough that this kind of worked surprisingly
enough.

(cherry picked from commit ac31804db7b679ae4a4ea028642b87e528ed3a6b)

16 months agomkosi: Drop util-linux from centos/fedora packages
Daan De Meyer [Thu, 18 Jul 2024 10:51:44 +0000 (12:51 +0200)]
mkosi: Drop util-linux from centos/fedora packages

It's already included in the packages list in mkosi.conf.

(cherry picked from commit 91cc65c5ad6135f428cd6500d19268581ece70b2)

16 months agomkosi: Drop udev from Packages= list
Daan De Meyer [Thu, 18 Jul 2024 10:48:48 +0000 (12:48 +0200)]
mkosi: Drop udev from Packages= list

It's pulled in via VolatilePackages=, no need to put it in Packages=.

(cherry picked from commit 1d914b268c116f5491f02bb554e45483404ed82a)

16 months agomkosi: Fix formatting
Daan De Meyer [Thu, 18 Jul 2024 10:47:51 +0000 (12:47 +0200)]
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 1250dc6a1d4fe1dbb8bcd21fc642c4ffdc60e0c7)

16 months agomkosi: Build CentOS Stream 10 images by default
Daan De Meyer [Thu, 18 Jul 2024 06:46:14 +0000 (08:46 +0200)]
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 773f2e9633677298985c1f2991556aeed60c2843)

16 months agomkosi: Streamline running the integration tests without building systemd
Daan De Meyer [Thu, 11 Jul 2024 14:09:47 +0000 (16:09 +0200)]
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 d279ec4a50d83ab44200ea410fa09d7ba2e5c824)

16 months agomeson: Drop genkey target
Daan De Meyer [Fri, 28 Jun 2024 07:58:56 +0000 (09:58 +0200)]
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 b00f44c3cff083972b0458359bbb5b80f0d10931)

16 months agomkosi: Skip sync script if NO_BUILD is enabled
Daan De Meyer [Thu, 11 Jul 2024 14:09:15 +0000 (16:09 +0200)]
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 bb8f6ac445b80f9621503bec7a22caa57bb10ee4)

16 months agomkosi: Remove enforcing=0 from default kernel command line
Daan De Meyer [Wed, 17 Jul 2024 16:56:02 +0000 (18:56 +0200)]
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 f5c44df92922d74cfff40989d6617e3a9e4c5904)

16 months agomkosi: Stop setting apparmor=0
Daan De Meyer [Wed, 17 Jul 2024 16:55:24 +0000 (18:55 +0200)]
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 5319be5f0c68d7edb09438419ca4171e4692c859)

16 months agodocs: update mkosi version mentioned in HACKING.md (#33723)
migleeson [Wed, 17 Jul 2024 07:45:26 +0000 (03:45 -0400)]
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 cb2d6214caa25b8297bde01bb8bb925957b04ba7)

16 months agoMerge pull request #33735 from DaanDeMeyer/backport-mkosi
Daan De Meyer [Tue, 16 Jul 2024 15:51:55 +0000 (17:51 +0200)]
Merge pull request #33735 from DaanDeMeyer/backport-mkosi

v256-stable: Backport mkosi and test related changes

16 months agorepart: Allow overriding fstype per partition designator
Daan De Meyer [Tue, 2 Jul 2024 16:34:39 +0000 (18:34 +0200)]
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 90a255779d1f8e6697e08e91918df88bb52274ad)

16 months agomkosi: List library packages explicitly in VolatilePackages=
Daan De Meyer [Tue, 16 Jul 2024 12:15:38 +0000 (14:15 +0200)]
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 b209fff3a51b8e57ea5970575bf8d4db4790b620)

16 months agomkosi: Build initrd as a subimage
Daan De Meyer [Tue, 16 Jul 2024 10:07:38 +0000 (12:07 +0200)]
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 68ee9771145464949d36d62a0ec687ecfb39290a)

16 months agomkosi: Drop CacheOnly=always from two subimages
Daan De Meyer [Tue, 16 Jul 2024 09:45:43 +0000 (11:45 +0200)]
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 244952b1ead7bb14058a873fded2cb9709c82a95)

16 months agoTEST-13-NSPAWN: make sure we don't load libnss_systemd
Daan De Meyer [Mon, 15 Jul 2024 21:07:52 +0000 (23:07 +0200)]
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 5ac0dc70ff330a531539a92552fbeb0f542edfb5)

16 months agomkosi: Disable unique debug source names
Daan De Meyer [Mon, 15 Jul 2024 15:15:43 +0000 (17:15 +0200)]
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 88221219a3290ee20de27aa030c2b23f03d8238a)

16 months agosystemd-networkd-tests: Skip tests requiring dhcpd if it is not available
Daan De Meyer [Mon, 15 Jul 2024 10:26:04 +0000 (12:26 +0200)]
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 985d5b4bc23f791bdc79d4c2a9a949cc5d3bc27a)

16 months agoTEST-55-OOMD: Remove the opensuse user@ dropin
Daan De Meyer [Mon, 15 Jul 2024 07:21:51 +0000 (09:21 +0200)]
TEST-55-OOMD: Remove the opensuse user@ dropin

Required to make TEST-55-OOMD pass on OpenSUSE.

(cherry picked from commit f65ec2e90483689546d4d700c5ad8475f19a3ab7)

16 months agomkosi: Install binutils
Daan De Meyer [Sun, 14 Jul 2024 20:56:43 +0000 (22:56 +0200)]
mkosi: Install binutils

(cherry picked from commit a1071c12499c7a5d918f5a6c93d052efbcaec803)

16 months agoTEST-64-UDEV-STORAGE: Use max_ioqpairs instead of num_queues
Daan De Meyer [Sun, 14 Jul 2024 20:27:09 +0000 (22:27 +0200)]
TEST-64-UDEV-STORAGE: Use max_ioqpairs instead of num_queues

Fixes a deprecation warning from qemu.

(cherry picked from commit d97b48176b072211be099318f75dfea62820b4f8)

16 months agomkosi: Use clang --print-runtime-dir
Daan De Meyer [Fri, 12 Jul 2024 14:45:04 +0000 (16:45 +0200)]
mkosi: Use clang --print-runtime-dir

(cherry picked from commit 6e212a6db9fb04ebb5dd4f365e7cb3a9a9b59e2b)

16 months agomkosi: Extend arch build script comment about symlinks
Daan De Meyer [Fri, 12 Jul 2024 14:42:00 +0000 (16:42 +0200)]
mkosi: Extend arch build script comment about symlinks

(cherry picked from commit 54ab97e59dfa048dd563e2918b594db267efd698)

16 months agotest: do not attempt to set xattr on tmpfs
Daan De Meyer [Fri, 12 Jul 2024 14:04:22 +0000 (16:04 +0200)]
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 ff8c89aa5a84733dd777f3e9113df33ce6c1ab1e)

16 months agomkosi: Add CI for CentOS Stream 10
Daan De Meyer [Thu, 11 Jul 2024 13:49:17 +0000 (15:49 +0200)]
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 8b32cc79ec028fa783072676346141821444b638)

16 months agomkosi: Use squashfs for sysext if mkfs.erofs is not available
Daan De Meyer [Thu, 11 Jul 2024 14:19:20 +0000 (16:19 +0200)]
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 3cfb020cb9ce5958ac39a7fd586cc4e893a7b190)

16 months agomkosi: Make epel repositories optional for CentOS Stream 9
Daan De Meyer [Fri, 5 Jul 2024 09:56:44 +0000 (11:56 +0200)]
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 0e4a7ab6d5601785e326851b3f1b6a3367ec98ec)

16 months agomkosi: Introduce build image
Daan De Meyer [Fri, 12 Jul 2024 13:33:49 +0000 (15:33 +0200)]
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 7205fc7dc31eb2be3075ee6ba23ebe84324aa5cb)

16 months agomkosi: update fedora commit reference
Daan De Meyer [Sun, 14 Jul 2024 15:50:23 +0000 (17:50 +0200)]
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 72a8f508e54188c64687633f96021c185a79938c)

16 months agomkosi: Update to latest
Daan De Meyer [Fri, 12 Jul 2024 14:09:21 +0000 (16:09 +0200)]
mkosi: Update to latest

(cherry picked from commit 9e8cfe5daacce9e74a1f063b1048d71f7843f90e)

16 months agoMerge pull request #33691 from DaanDeMeyer/backport-mkosi
Daan De Meyer [Thu, 11 Jul 2024 14:42:06 +0000 (16:42 +0200)]
Merge pull request #33691 from DaanDeMeyer/backport-mkosi

Backport mkosi and integration test changes to v256-stable

16 months agomkosi: Switch back to code.opensuse.org for opensuse
Daan De Meyer [Thu, 11 Jul 2024 11:19:11 +0000 (13:19 +0200)]
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 a86211b7cad84cde6c9e330e3bbba7b538fa7f1a)

16 months agotest: install split-out sshd-session binary if present
Luca Boccassi [Tue, 9 Jul 2024 17:42:06 +0000 (18:42 +0100)]
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 aaa7b36bd15ca3a96a1e11a557482b0bc59c769f)

16 months agomkosi: update opensuse commit reference
Daan De Meyer [Wed, 10 Jul 2024 12:20:34 +0000 (14:20 +0200)]
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:   https://github.com/openSUSE/systemd/compare/603cd1d4d81147d4f2eccd5e352064a4215119b4...5a8eadd0c021758337a020c423f25a353bdb9b3c - 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   28459ba1f4df.
* | 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 eb6f177ae4ec25ba8efaab5268a7c36195f0bf62)

16 months agotools/update-distro-hash: Fix path
Daan De Meyer [Wed, 10 Jul 2024 12:34:32 +0000 (14:34 +0200)]
tools/update-distro-hash: Fix path

(cherry picked from commit dfea7a8d2655988e30c0d8ca56a1c7aeefc47d80)

16 months agoTEST-06-SELINUX: Various fixes
Daan De Meyer [Tue, 9 Jul 2024 10:26:11 +0000 (12:26 +0200)]
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 dedd712dd9b4883678765b9bc1a8ac349cf24f3b)

16 months agomkosi: Don't fail if /var/log/journal does not exist
Daan De Meyer [Fri, 5 Jul 2024 09:24:27 +0000 (11:24 +0200)]
mkosi: Don't fail if /var/log/journal does not exist

(cherry picked from commit 877842ed521c5cdf5dd0b50127b51466959a606e)

16 months agotest: Switch to ncat instead of nc
Daan De Meyer [Fri, 5 Jul 2024 08:27:56 +0000 (10:27 +0200)]
test: Switch to ncat instead of nc

ncat is available in CentOS Stream 9 without having to enable EPEL.

(cherry picked from commit e842deeac64b22903a3532728c11cefb640d94ba)

16 months agoTEST-55-OOMD: Switch to stress-ng
Daan De Meyer [Fri, 5 Jul 2024 07:58:17 +0000 (09:58 +0200)]
TEST-55-OOMD: Switch to stress-ng

stress-ng is available in OpenSUSE and in CentOS Stream without needing
EPEL so let's switch to it instead of stress.

(cherry picked from commit 3e3a15c06e03f1bec209066da5b1340e1dd03dc8)

16 months agodocs: Simplify update commands in HACKING.md
Daan De Meyer [Wed, 10 Jul 2024 15:03:59 +0000 (17:03 +0200)]
docs: Simplify update commands in HACKING.md

Let's make use of mkosi ssh to give everyone a one liner to run instead
of having to execute two commands (one outside the VM, one inside).

(cherry picked from commit 00acdb314768fac76b563857e2ab4a8e33b7be23)

16 months agomkosi: Update to latest
Daan De Meyer [Wed, 10 Jul 2024 14:52:54 +0000 (16:52 +0200)]
mkosi: Update to latest

(cherry picked from commit d5c3868181f82783214baa9a4498ae6aad1623f5)

16 months agomkosi: Build a sysext if SYSEXT=1 is specified
Daan De Meyer [Wed, 10 Jul 2024 08:07:05 +0000 (10:07 +0200)]
mkosi: Build a sysext if SYSEXT=1 is specified

(cherry picked from commit 612a98a0652387d857198cb92dea03ddf1bbbe43)

16 months agomkosi: Check for configured build directory if WIPE=1
Daan De Meyer [Tue, 9 Jul 2024 18:02:47 +0000 (20:02 +0200)]
mkosi: Check for configured build directory if WIPE=1

Otherwise trying to use --wipe might fail if the build directory
has not been configured but is not empty either.

(cherry picked from commit 73b3179a5375d3fe7a58b5686446dddd3a14a734)

16 months agomkosi: Install erofs-utils
Daan De Meyer [Wed, 10 Jul 2024 08:05:59 +0000 (10:05 +0200)]
mkosi: Install erofs-utils

(cherry picked from commit ece66c01cf1bd705a7ffbf5b71f2b0b1f8567a06)

16 months agoMerge pull request #33674 from DaanDeMeyer/backport-mkosi
Daan De Meyer [Tue, 9 Jul 2024 16:21:00 +0000 (18:21 +0200)]
Merge pull request #33674 from DaanDeMeyer/backport-mkosi

v256-stable: Backport various mkosi changes