Commit Graph
78534 Commits
Author SHA1 Message Date
Yu Watanabe 4e6d6d885d repart: if partition already exists, required size may not be multiple of grain size
See partition_min_size_with_padding().
Fixes #37178.

(cherry picked from commit cb109e00c4)
2025-06-25 13:36:10 +01:00
Arian van Putten e9c4962cef vmspawn: do not preserve access permissions and xattrs of template OVMF vars
This makes vmspawn work when /usr/share/qemu/edk2-i386-vars.fd is on
disk with 0444 permissions as is the case on NixOS.

The nix package manager does not store any access permissions, ownership,
timestamps, or extended attributes in its package format to increase
reproducibility. The only meta-data that is stored is the executable bit.

Thus when unpacking a nix package, the executable bit is preserved, but no other
access permissions are preserved and all files in /nix/store end up as
read-only.

This causes the template OVMF vars file to have 0444 permissions. If we preserve
those permissions when copying the template file to /tmp that means QEMU can not
write to the file and fails.

So lets not preserve permissions and keep the 0600 permissions that are set by
default.

(cherry picked from commit 96e481bfbd)
2025-06-25 13:36:10 +01:00
Alex 18a42e321d compress: prevent divide-by-zero when no data is read (#37706)
If the first call to `loop_read()` returns 0 (no input), `total_in`
remains 0, causing `total_out/total_in` to potential divide by zero.

We add a check before logging the compression ratio to skip the
percentage calculation when total_in is zero.

Co-authored-by: jinyaoguo <guo846@purdue.edu>
(cherry picked from commit 2584f745e0)
2025-06-25 13:36:10 +01:00
Alex e2c9fdd5c0 network: fix a potential divide-by-zero (#37705)
In function `tc_init`, hz is parsed from the content of file
`"/proc/net/psched"` and can be 0.
In function `hierarchy_token_bucket_class_verify`, hz is directly used
as a divisor in
`htb->buffer = htb->rate / hz + htb->mtu;` without any check. This adds a check on hz before using it as a divisor.

Co-authored-by: jinyaoguo <guo846@purdue.edu>
(cherry picked from commit 1a596054a0)
2025-06-25 13:36:10 +01:00
Lennart Poettering ddddef495d repart: fix generation of UUID= line for vfat in fstab entries
Fixes: #36735
(cherry picked from commit 8504721e0e)
2025-06-25 13:36:10 +01:00
Joaquim Monteiro 4af9f5044a bootctl: fix unclosed quote in debug log
(cherry picked from commit c9e614eb25)
2025-06-25 13:36:10 +01:00
Lennart Poettering 77babb252d mount-util: avoid unnecessary mount_setattr() call in make_fsmount()
If .attr_set is zero (and .att_clr, .propagation too), then there's no
point in calling mount_setattr().

Fixes: #37062

Note that this optimization is not precisely load-bearing anymore, since
3cc23a2c23 got merged which removes the
only caller of make_fsmount() that might trigger it. But it's worth
fixing generic code anyway, in case it gets used like this later again.

(cherry picked from commit 249752d1ec)
2025-06-25 13:36:10 +01:00
Luca Boccassi ccbad62c42 test: wait for coredump to appear before parsing
A new core was added to the test, but the loop counter was not increased
to wait for it, so the test races against systemd-coredump's processing.

This failed at least once in debci:

8015s [   32.227813] TEST-87-AUX-UTILS-VM.sh[1038]: + coredumpctl info COREDUMP_TIMESTAMP=1679509902000000
8015s [   32.228684] TEST-87-AUX-UTILS-VM.sh[1723]: No coredumps found.

Follow-up for 0c49e0049b

Fixes https://github.com/systemd/systemd/issues/37666

(cherry picked from commit 703fbb0bba)
2025-06-25 13:36:10 +01:00
Luca Boccassi 1b4abc3314 sync-docs: add '(latest stable)' next to the latest version in the menu
Add visual indicator of what is the latest version in the
version menu

(cherry picked from commit 90b0222091)
2025-06-25 13:36:10 +01:00
Luca Boccassi 5b7dccd5dd sync-docs: fix selection menu when opening 'latest' man
'devel' will always sort first, so the highest version is the second
entry, not the first one

(cherry picked from commit 1cd995185b)
2025-06-25 13:36:10 +01:00
Luca Boccassi 2518c62618 sync-docs: fix syntax warning
sync-docs.py:94: SyntaxWarning: invalid escape sequence '\d'
  m = re.match("v?(\d+).*", tag)

(cherry picked from commit 34d63ac879)
2025-06-25 13:36:10 +01:00
Luca Boccassi 0e502d986b sysupdate: change status once operation has completed
Otherwise after the service exits it will still show
"Installing 'foobar'" as the status, which is confusing

(cherry picked from commit 5cfc9c34f4)
2025-06-25 13:36:10 +01:00
Mike Yuan 654c60ba17 ssh-generator: add missing newline before [Service] and trailing NL to generated service
(cherry picked from commit e72bd8dbc8)
2025-06-25 13:36:10 +01:00
Mike Yuan 2fc4bc803c ssh-generator: fix typo
(cherry picked from commit 0aa4c3f0f9)
2025-06-25 13:36:10 +01:00
Zbigniew Jędrzejewski-Szmek 58d05cd2ea man: better tags, more links, minor grammar and formatting improvements
Closes https://github.com/systemd/systemd/issues/35751.

(cherry picked from commit b082968d19)
2025-06-25 13:36:10 +01:00
Zbigniew Jędrzejewski-Szmek af5811c715 man/systemd.network: reword description of MulticastIGMPVersion=
(cherry picked from commit acf3bdf813)
2025-06-25 13:36:10 +01:00
Zbigniew Jędrzejewski-Szmek ba850113fd man/systemd.timer: change to positive wording
(cherry picked from commit f56d9b82b1)
2025-06-25 13:36:10 +01:00
Zbigniew Jędrzejewski-Szmek 2443d1c2e6 man: reword descriptions of numerical fields
A "string" is a concept in C. In a text-based API, this is implicit, especially
if we say that something was "formatted". So change occurences of "decimal
string" to just "decimal". Similarly, "numerics" is unclear, say "digits".

Also, a "timestamp is in a clock" just sounds wrong. Reword those sentences.

(cherry picked from commit de8d2894b8)
2025-06-25 13:36:10 +01:00
Zbigniew Jędrzejewski-Szmek 8dea418e79 man/systemd-resolved: update description of routing
(cherry picked from commit 948369983c)
2025-06-25 13:36:10 +01:00
Zbigniew Jędrzejewski-Szmek 107289f28d man/systemd-analyze: rewrite "Exit status" section
(cherry picked from commit 8bfdba3cb1)
2025-06-25 13:36:10 +01:00
Zbigniew Jędrzejewski-Szmek ce2076bf7a man/pam_systemd: use <constant> consistently
For some reason, <constant> and <literal> were used interchangeably.

(cherry picked from commit 3a23e96b67)
2025-06-25 13:36:10 +01:00
Zbigniew Jędrzejewski-Szmek 1db937ff14 man: introduce openssl as man page provider and use it for ukify.1
(cherry picked from commit 001ae86a73)
2025-06-25 13:36:10 +01:00
Yu Watanabe a11a822101 test-network: add test case for issue #37629
(cherry picked from commit b1bed07d84)
2025-06-25 13:36:10 +01:00
Yu Watanabe e9655c7865 network/link: update state file when master ifindex is changed
If master ifindex is non-zero, then the carrier state and operational
state of the interface may be the enslaved state.
As the operational state is saved in link state file, and read by
wait-online, we need to update the state file when the master ifindex is
changed.

(cherry picked from commit 7dde00ca57)
2025-06-25 13:36:10 +01:00
Yu Watanabe 2ad46c0606 network/link: ENODATA from reading IFLA_MASTER when an interface has no master
When an interface leaved from the master interface, then reading
IFLA_MASTER attribute causes ENODATA. When the interface was previously
enslaved to another interface, we need to remove reference to the
interface from the previous master interface.

This is especially important when
```
ip link set dev eth0 nomaster
```
is called.

Fixes a bug introduced by 0d411b7f8f (v249).
Fixes #37629.

(cherry picked from commit f44b20b7b6)
2025-06-25 13:36:10 +01:00
Adrian Vovk 0930949e64 man/systemd.timer: Correct inaccuracy in man page
The docs previously stated that RandomizedDelaySec is applied onto the
next scheduled time, but after 9fa326b18a
this is no longer the case.

I also reworded FixedRandomDelay= slightly, to make it a bit clearer

(cherry picked from commit fca20a1be6)
2025-06-25 13:36:10 +01:00
Daan De Meyer 0fe81747d7 meson: Stop doing nested build when fuzzers are enabled
Currently, when fuzzers are enabled, we run meson from within meson
to build the fuzzer executables with sanitizers. The idea is that
we can build the fuzzers with different kinds of sanitizers
independently from the main build.

The issue with this setup is that we don't actually make use of it.
We only build the fuzzers with one set of sanitizers (address,undefined)
so we're adding a bunch of extra complexity without any benefit as we
can just setup the top level meson build with these sanitizers and get
the same result.

The other issue with this setup is that we don't pass on all the options
passed to the top level meson build to the nested meson build. The only things
we pass on are extra compiler arguments and the value of the auto_features
option, but none of the individual feature options if overridden are passed on,
which can lead to very hard to debug issues as an option enabled in the top
level build is not enabled in the nested build.

Since we're not getting anything useful out of this setup, let's simplify
and get rid of the nested meson build. Instead, sanitizers should be enabled
for the top level meson.build. This currently didn't work as we were overriding
the sanitizers passed to the meson build with the fuzzer sanitizer, so we
fix that as well by making sure we combine the fuzzer sanitizer with the ones
passed in by the user.

We also drop support for looking up libFuzzer as a separate library as
it has been shipped builtin in clang since clang 6.0, so we can assume
that -fsanitize=fuzzer is available.

To make sure we still run the fuzzing tests, we enable the fuzz-tests option
by default now to make sure they still always run (without instrumentation unless
one of llvm-fuzz or oss-fuzz is enabled).

(cherry picked from commit d8def5dc87)
2025-06-24 15:41:46 +01:00
Luca Boccassi b3339c8df5 mkosi: install util-linux-systemd in SUSE
Some tools (findmnt, logger, lsblk, lslogins) got moved to a
new util-linux-systemd package in Tumbleweed so install it explicitly

(cherry picked from commit aba73b88a2)
2025-06-24 03:49:24 +09:00
Daan De Meyer 36b7aee86b mkosi: update mkosi commit reference to 5e739ef1ed02a4f3b6ae64e50a8ee186cbcb21c2 (#37632)
* 5e739ef1ed mkosi-initrd: Optionally match t64 suffix for tss2
libraries
*   ec70393077 Merge pull request https://github.com/systemd/mkosi/pull/3742 from DaanDeMeyer/man
|\
| * 94cc136fbe mkosi-tools: Install man tool and pages as part of misc
profile
| * eda2ed533d Enforce C.UTF-8 locale for all commands we run
* | 9821e9a3e3 sandbox: Support using mkosi-sandbox as a library
* | 4145382edf Serialize pid in state and check if still exists on load
* |   3d119cba07 Merge pull request https://github.com/systemd/mkosi/pull/3736 from DaanDeMeyer/rpm-gpgkey
|\ \
| |/
|/|
| * 0a5d87b7bb Only pick up /etc/pki/tls and /etc/pki/ca-trust as
certificate dirs
| * c30eee187f Look for rpm gpg keys from inside the sandbox
|/
* ef2842dfea Fix version bump check if image version was passed on CLI
* 12b6251153 apt: Install apt sources if apt was installed via base tree
* a0b4e1af9a Make sure git doesn't fail when running as root
* 585a47705d repart: use --append-fstab=auto if available
* cec6ae1dda sandbox: handle case where dev node for tty doesn't exist
* a60dade823 initrd: shadow-utils removal is only necessary on old
Fedora
* ca11acbd5b Use SPDX identifier instead of file path for license in
pyproject.toml
* 4d031bc57d Revert license-files property
*   c80dd09008 Merge pull request https://github.com/systemd/mkosi/pull/3722 from behrmann/versiontweaks
|\
| * c76e5dc4bc make version test more readable
| * 90ba99dde1 version: add __repr__ to GenericVersion
|/
* dd794ec832 Fix licenses path in pyproject.toml
*   7eeb749840 Merge pull request https://github.com/systemd/mkosi/pull/3702 from aafeijoo-suse/initrd-kmp
|\
| * 565b905aa1 mkosi-initrd: handle symlinks under weak-updates
| * a83ccc10c7 mkosi-initrd: perform basic checks on the kernel dir
before calling mkosi
| * 73cad79c9e mkosi-initrd: --kernel-modules-include ->
--kernel-modules
* bac76904c3 build(deps): bump github/codeql-action from 3.28.13 to
3.28.16
* 44161624a2 Supress ssh unit generation if sshd is not present
* b8758dac28 Partially revert 640000a861e9cd9a3807e4158e110a098c74d078
* 6f11937dc6 Don't use default value if optional settings are set to
none
* 640000a861 Use a default tools tree by default if mkosi.tools.conf
exists
* 63d91cc285 mkosi: Override misconfigured gitconfig HTTP/HTTPS proxy
with ProxyUrl
* a859b5eb13 Make sure we create the default workspace directory as well

(cherry picked from commit 3366807bf2)
2025-06-24 03:49:24 +09:00
Daan De Meyer 2bb6eef9b8 mkosi: Run clangd within the tools tree instead of the build container
Running within the build sandbox has a number of disadvantages:
- We have a separate clangd cache for each distribution/release combo
- It requires to build the full image before clangd can be used
- It breaks every time the image becomes out of date and requires a
  rebuild
- We can't look at system headers as we don't have the knowledge to map
  them from inside the build sandbox to the corresponding path on the host

Instead, let's have mkosi.clangd run clangd within the tools tree. We
already require building systemd for both the host and the target anyway,
and all the dependencies to build systemd are installed in the tools tree
already for that, as well as clangd since it's installed together with the
other clang tooling we install in the tools tree. Unlike the previous approach,
this approach only requires the mkosi tools tree to be built upfront, which has
a much higher chance of not invalidating its cache. We can also trivially map
system header lookups from within the sandbox to the path within mkosi.tools
on the host so that starts working as well.

(cherry picked from commit bde994efcc)
2025-06-24 03:49:24 +09:00
Daan De Meyer c6dec8fdb0 ci: Use mkosi in linter workflow
Let's reuse the mkosi tools tree to get all the tools we need instead
of pulling them from pypi.

(cherry picked from commit 9e3d048bd0)
2025-06-24 03:49:24 +09:00
Daan De Meyer e15e04982a mkosi: Add clang tools and iwyu to tools tree
(cherry picked from commit 46833d6c8f)
2025-06-24 03:49:24 +09:00
Daan De Meyer c2f9501ef0 mkosi: Replace base-devel with base in arch tools packages
base-devel pulls in a bit too much, especially for NO_BUILD builds
so let's use base instead.

(cherry picked from commit 8ffacf8efa)
2025-06-24 03:49:24 +09:00
Daan De Meyer 4ad14ab6c2 mkosi: update mkosi commit reference to dbb4020beee2cdf250f93a425794f1cf8b0fe693
* dbb4020bee mkosi: Use tools tree by default in repository config
* a2407a305c dnf: Stop messing around with plugins
* eee382ebc6 Fix mkosi help
* 8d4f9969bb mkosi-obs: simplify generation of signed UEFI auth files
*   364dfc65eb Merge pull request #3661 from septatrix/ssh-runtime
|\
| * ab3b52841c Improve Ssh= documentation
| * 79878d7e6c Add new Ssh=auto and Ssh=runtime options
*   49036322c2 Merge pull request #3682 from DaanDeMeyer/history
|\
| * 96e512fe6e installer: Make sure package manager state is preserved in the image
| * b859a7cf0a Only copy repository metadata from specific subdirs from /var
| * c8bf8e4278 Rename cache_subdirs() to package_subdirs()
* |   54b59c4a2e Merge pull request #3696 from DaanDeMeyer/history-cli
|\ \
| * | 898d89e887 Rework version bumping
| * | cc45fe3bad Only write CLI arguments to history instead of full config
| * | 1def443097 Disallow using --rerun-build-scripts with --force again
| * | 87b03ee264 Rename get_configdir() to finalize_configdir()
| * | 9c1217a217 Get rid of to_json() methods on Args and Config
| |/
* | 124f551e77 mkosi-obs: do not publish roothash
* | fc86100e51 mkosi-obs: append certs from mkosi.uefi.db/ to 'db'
* | 8bee4cb8e2 Make sure sync scripts are executable
|/
* a7e90514fa Simplify tools tree out of date error
* f9956daba7 Fail if --rerun-build-scripts is used and tools is out of date
* d94bf56ae8 mkosi-initrd: add specific configuration for plymouth in Debian
* 8235ddbc5b Take shared lock in copy_ephemeral()
* 19c74d5ba5 Two follow ups for #3678
*   0d6f15e8c3 Merge pull request #3678 from DaanDeMeyer/history
|\
| * 5410c4c7af tests: Require genkey to be run once upfront
| * 86b8c611a1 tests: Drop unused tools field
| * c3d1bd0dde Rework history <=> sandbox integration
* fce4db970f zypper: display debugging output if ARG_DEBUG is set
* 2c052b9d45 Allow PCR signing settings to be overridden in sub-images
* 00c220225b zypper: do not fail if a package configured to be removed is not found

(cherry picked from commit d9826d303b)
2025-06-24 03:49:24 +09:00
Luca Boccassi fd51f361e0 Revert "mkosi: temporarily disable panic_on_warn"
The BRTFS issue that caused a spurious WARN has been fixed and
backported to Noble, so we can enable panic_on_warm again.

This reverts commit 930d65ccca.

(cherry picked from commit 10ed8cda58)
2025-06-24 03:49:24 +09:00
Daan De Meyer dd55ea7d60 mkosi: Rename mkosi.prepare scripts for systemd deps to systemd.prepare
These scripts are reused by multiple images, so let's give them a
non-standard name to indicate that. Otherwise it's all too easy to add
something to mkosi.prepare for the main image and accidentally have it
included in all the subimages as well even though that's not desired.

(cherry picked from commit e8881f09c5)
2025-06-24 03:49:24 +09:00
Daan De Meyer ee152a41e5 mkosi: Reuse main image prepare scripts in subimages
In the subimages we also want to make sure all dependencies of the
systemd packages are cached so reuse the same prepare scripts from
the main image to do that.

We only want required dependencies in the subimages, not recommended
or suggested dependendencies, so add an environment variable
$SYSTEMD_REQUIRED_DEPS_ONLY which the prepare scripts can check for
and enable it for the subimages.

(cherry picked from commit 52a82bcfc9)
2025-06-24 03:49:24 +09:00
Daan De Meyer 3a41f2d3d7 mkosi: Make sure coreutils is installed in initrd/exitrd
This is already installed but Fedora/CentOS systems are nudged towards
installing coreutils-single which then later causes issues when we try
to install coreutils as a dependency of systemd so let's make sure we
pick coreutils from the beginning.

(cherry picked from commit 0ac6fc2917)
2025-06-24 03:49:24 +09:00
Yu Watanabe 329945c705 docs: fix mkosi section for Environment= setting
(cherry picked from commit f477751b10)
2025-06-24 03:49:24 +09:00
Luca Boccassi 0a6840c52a mkosi: enable autologin also with --console=gui
(cherry picked from commit 988fae8024)
2025-06-24 03:49:24 +09:00
Daan De Meyer f23f62e1e0 mkosi: Move TEST-24-CRYPTSETUP files to mkosi/ directory
If the integration tests have been installed in the systemd-tests
package, the path to these in mkosi.postinst.chroot will be wrong.
Let's fix the issue by moving these files into the mkosi/ directory
as they're only used by mkosi regardless so they make more sense to
be there anyway.

(cherry picked from commit e2b01571d0)
2025-06-24 03:49:24 +09:00
Daan De Meyer 33275fa425 mkosi: update mkosi commit reference to 7e4ec15aee6b98300b2ee14265bc647a716a9f8a
* 7e4ec15aee Generate key-cert pair in config directory (fixes #3655)
* 5793e64958 Don't use gen_kernel_images() in run_depmod()
* bc497f1d17 Fix typing due to recent changes in typeshed
* e6a603a21a Add "plymouth" initrd profile

(cherry picked from commit c7bb07fff5)
2025-06-24 03:49:24 +09:00
Daan De Meyer 99618354b2 mkosi: Set time-epoch= to fixed value
Turns out makepkg sets $SOURCE_DATE_EPOCH= to the current time for
every build if not set explicitly which causes full rebuilds if we
don't set time-epoch explicitly ourselves, so let's do that everywhere
to avoid unnecessary rebuilds.

(cherry picked from commit aba3ef6616)
2025-06-24 03:49:24 +09:00
Luca Boccassi 3dfd2e1ffb mkosi: drop os-release symlink for minimal-base image
[  385s] ERROR: link target doesn't exist (neither in build root nor in installed system):
[  385s]   /usr/lib/systemd/tests/mkosi/mkosi.images/minimal-base/mkosi.extra/etc/os-release -> ../usr/lib/os-release

It shouldn't be even needed, everything should look in /usr/lib/os-release too

Follow-up for a0ce5e642f

(cherry picked from commit 5e5f792193)
2025-06-24 03:49:24 +09:00
Daan De Meyer 9f549793ee mkosi: Set mitigations=off
Might as well disable mitigations for these VMs. Who knows, maybe it'll
speed something up.

(cherry picked from commit 36645ec255)
2025-06-24 03:49:24 +09:00
Daan De Meyer b4c09c1656 mkosi: Make MinimumVersion= a git commit
With the latest mkosi it's possible for MinimumVersion= to be a git
commit so let's start making use of that. This will make mkosi fail
if it's executed within the systemd repository and the checked out
commit is too old.

Putting the mkosi commit sha in mkosi/mkosi.conf also allows retrieving
it without having the full source tree available.

We also make a bunch of improvements to the fetch-mkosi.py script.

(cherry picked from commit 278d5bfd7e)
2025-06-24 03:49:24 +09:00
Daan De Meyer 6199fddc6f mkosi: Update to latest
(cherry picked from commit a94520dc78)
2025-06-24 03:49:24 +09:00
Zbigniew Jędrzejewski-Szmek 00a12c234e meson: bump version to 257.6 v257.6 2025-05-29 18:30:31 +02:00
Zbigniew Jędrzejewski-Szmek 45ca3f2d7c Define helper to call PR_SET_DUMPABLE
(cherry picked from commit 9ce8e3e449)
2025-05-29 16:15:08 +01:00
Zbigniew Jędrzejewski-Szmek ca4736ca8d coredump: introduce an enum to wrap dumpable constants
Two constants are described in the man page, but are not defined by a header.
The third constant is described in the kernel docs. Use explicit values to
show that those are values are defined externally.

(cherry picked from commit 76e0ab49c4)
2025-05-29 16:15:08 +01:00