Jo Zzsi [Fri, 19 Sep 2025 23:05:05 +0000 (19:05 -0400)]
fix(systemd): make dbus optional dependency
Remove dbus as a mandatory dependency for the following
dracut modules
- systemd-hostnamed
- systemd-portabled
- systemd-resolved
- systemd-timedated
- systemd-timesyncd
Users and distributions can still include dbus dracut module in the
initramfs as before, but now dbus dracut module is required to
be explicitly added in the dracut configuration.
The motivation of this change is to allow users and distributions
to exclude dbus from the initramfs.
Jo Zzsi [Fri, 19 Sep 2025 00:59:15 +0000 (20:59 -0400)]
ci: add daily test coverage for --hostonly-mode strict
Since no test container has hostonly-mode strict set by default
let's add some tests to pass `--hostonly-mode strict`
on each test run on the command line.
Jo Zzsi [Mon, 15 Sep 2025 11:59:09 +0000 (07:59 -0400)]
chore(fedora): simplify Fedora configuration
Setting many of these defaults not only not required but makes it
harder to reason for Fedora.
dracut defaults are the same as these Fedora settings. Let's just remove
the Fedora settings so that it is clear that Fedora are using dracut
defaults for these settings (like other distributions).
The goal of this commit is to have the same dracut modules
included in both sloppy and in strict mode, but the dracut
modules themselves might install more kernel modules depending
on the hostonly_mode value.
Changes in other areas of the code (e.g. changes inside
`installkernel`) were not reverted as they require
more discussions and agreement by the community.
As an example the crypt dracut module could potentially copy
more kernel modules into the generated initramfs in sloppy
hostonly_mode mode than in strict hostonly mode.
Jo Zzsi [Sun, 14 Sep 2025 16:39:25 +0000 (12:39 -0400)]
ci(debian): make sure ip command is available
`ip` command is required for networking. On Ubuntu
`ip` command is already installed but on debian this
requires and explicit installation of the `iproute2`
package.
Jo Zzsi [Fri, 15 Aug 2025 21:29:05 +0000 (17:29 -0400)]
ci(integration-extra): disable UEFI test on debian:sid
This test has been failing on debian:sid for a while and passing on
all other test containers.
I was unable to find a root cause and what is even more interesting
is that the test is passing on debian:latest (trixie).
At this point of time debian:sid and debian:latest (trixie) should
be very similar, so there is a decent chance that this is a
distribution issue and not a dracut issue.
This is the last remaining failure to make the integration-extra
GA green.
Jo Zzsi [Mon, 11 Aug 2025 11:18:06 +0000 (07:18 -0400)]
fix(fedora): always include chroot binary
It seems RedHat requires chroot, which is addressed by a commit revert
currently instead of a proper permanent solution, see
https://github.com/redhat-plumbers/dracut-rhel10/pull/49
This commit provides a long term permanent solution that does not
require a downstream revert.
Fabian Vogt [Fri, 22 Aug 2025 12:25:54 +0000 (14:25 +0200)]
fix(fs-lib): include modules for charsets for working vfat support
vfat always needs a codepage and iocharset for mounting, so make sure
those are included.
It's not trivial to get a list of exactly the needed modules,
(depends on mount options and kernel defaults), so take the easy route
and include them all, except in strict hostonly mode.
Martin Wilck [Fri, 5 Sep 2025 17:24:15 +0000 (19:24 +0200)]
fix(74nvmf): make sure autoconnect script is run at least once
With the previous patch applied, if netroot is not set by the nvmf module
and /dev/root is found, dracut may proceed to pivot without having tried
to connect the nvmf devices. Avoid that by requiring that the autoconnect
script is called at least once.
Martin Wilck [Fri, 5 Sep 2025 17:19:51 +0000 (19:19 +0200)]
fix(74nvmf): only set netroot if it's yet empty
The netroot variable is also set by other modules, in particular
"livenet". Don't override it if it is already set. Otherwise booting
a live image may fail in presence of an NBFT table.
Jo Zzsi [Sun, 10 Aug 2025 12:05:48 +0000 (08:05 -0400)]
fix: place dracut generated cmdline conf files in the 10-49 range
The main motivation of this PR is to make it easier to reason
about the ordering numbers of dracut generated cmdline conf files.
Prefix almost all dracut generated cmdline conf file in the 20 ordering
as the ordering is usually not significant for these cmdline conf file.
Document that 50-59 is the recommended ordering range for
3rd party cmdline conf files to make it consistent with e.g.
3rd party dracut modules recommendation.
Tomas Bzatek [Tue, 3 Jun 2025 16:34:39 +0000 (18:34 +0200)]
improvement(74nvmf): lookup required NIC kernel modules for NBFT interfaces
When dracut is called with '--hostonly-mode strict' and perhaps even
with --hostonly-nics '' as done by kdump/mkdumprd, all the kernel
modules related to hostonly networking are stripped down. In such
a case it is viable to lookup and install the required kernel modules
ourselves, based on any currently present nbft interfaces.
Note: the lookup depends on the current 'nbftX' network interface
naming.
Benjamin Drung [Wed, 13 Aug 2025 10:15:22 +0000 (12:15 +0200)]
fix(Makefile): exclude hidden directories from shellcheck
`shfmt -f .` also searches in hidden directories (like `.git` or
`.pc`). The `.pc` is used on Debian for patch tracking and should not be
searched for files.
So ignore the top-level hidden directories from shellcheck.
James Le Cuirot [Mon, 11 Aug 2025 09:51:51 +0000 (10:51 +0100)]
fix(dracut-install): cache resolve_deps calls for speed and less noise
The dlopen dependency failure warning was particularly noisy and likely
to trigger. We were already caching the processed items in resolve_lazy,
but resolve_deps recurses many times, so it was necessary to move the
cache down a level. I didn't reuse "items" here because it would have
clashed with its usage elsewhere.
I had to think about whether the cache would function correctly with
changing values of pdeps. If a dependency is not found on the first
attempt, it does not prevent its consumer from being installed, so it
does not matter that it might be found via a RUNPATH on a subsequent
attempt.
Closes: https://github.com/dracut-ng/dracut-ng/issues/1552 Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
James Le Cuirot [Mon, 11 Aug 2025 09:12:59 +0000 (10:12 +0100)]
fix(dracut-install): handling of multiple sonames in dlopen JSON
We should not try to install every library referenced in the soname
array, only the first one present. The array is intended to be an
ordered preference list.
Closes: https://github.com/dracut-ng/dracut-ng/issues/1552 Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Tomas Bzatek [Tue, 24 Jun 2025 14:50:31 +0000 (16:50 +0200)]
fix(74nvmf): set root=nvmf
In a restricted image like kdump the kernel commandline argument root=
is typically absent. However it is required by the 45net-lib/netroot.sh
module that fails with:
[ 23.599862] dracut: FATAL: No or empty root= argument
[ 23.604956] dracut: Refusing to continue
Inspired by the 74iscsi module, let's set it to root=nvmf if not set
before.
NETWORK test now would pass on alpine as long as
networkmanager-initrd-generator is installed.
This commit would expand test coverage for network-manager
dracut module.
Dowstream alpine maintains a dracut-tests package the
already does a good job installing dracut test dependencies
including networkmanager-initrd-generator.
Let's rely on dracut-tests package to further reduce
the need to maintain alpine package lists here upstream.
See https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/dracut/APKBUILD
Jo Zzsi [Sun, 24 Aug 2025 04:12:42 +0000 (00:12 -0400)]
test: remove unmaintained tests MULTINIC and BONDBRIDGEVLAN
These tests are always skipped in all CI containers as they
no longer pass. These tests require network-legacy and in some
cases ifcfg and nobody stepped up to modernize them for years.
Since the tests are in revision history, iof someone step up
to maintain these tests, the project can easily bring them back.
Alexander Zubkov [Sun, 31 Aug 2025 08:12:38 +0000 (10:12 +0200)]
fix(resume): avoid matching extra resume= substrings in cmdline
`grep ... 'resume='` matches not only 'resume' parameter, but any alike
substring. It could be other parameter ending in 'resume' or even parameter
value. The presense of those could fail the module setup.
Fix it by checking for a space or the beginning of a line.
Fixes: https://github.com/dracut-ng/dracut-ng/issues/1595 Signed-off-by: Alexander Zubkov <green@qrator.net>
Alexander Zubkov [Sun, 31 Aug 2025 07:50:29 +0000 (09:50 +0200)]
fix(dracut-systemd): avoid matching extra root= substrings in cmdline
`strstr ... 'root='` matches not only 'root' parameter, but any alike
substring. It could be other parameter ending in 'root', for example
'cryto_root=' or even parameter value. The presense of those in cmdline
could fail the boot process.
Fix it by adding a space in front of the matched string.
Fixes: https://github.com/dracut-ng/dracut-ng/issues/1595 Signed-off-by: Alexander Zubkov <green@qrator.net>
Benjamin Drung [Wed, 13 Aug 2025 10:33:12 +0000 (12:33 +0200)]
fix: ignore shellcheck SC2329 in addition to SC2317
Shellcheck <= 0.10 complains about SC2317 (info): Command appears to be
unreachable. Check usage (or ignore if invoked indirectly). Shellcheck
0.11 changes this complaint to SC2329 (info): This function is never
invoked. Check usage (or ignored if invoked indirectly).
So ignore shellcheck SC2329 in addition to SC2317 to make both
shellcheck versions happy.
Deli Zhang [Mon, 18 Aug 2025 01:41:10 +0000 (01:41 +0000)]
fix(dracut): use "-name" to avoid find matching temporary directory
$initdir includes a temporary directory, and the "-path" option of
find attempts to match the entire path. If the temporary directory
happens to contain ".ko", e.g.
initdir=/var/tmp/dracut.ko79pT/initramfs
this can lead to a incorrect match, finally all executable files are
excluded.
Jo Zzsi [Fri, 15 Aug 2025 16:03:23 +0000 (12:03 -0400)]
fix(dracut): decrease logging by default
The current default set in dracut is "4". All distributions
(except Debian), sets the default to "3".
Instead of relying on good defaults only within distribution
configurations, let's set the dracut default to be less verbose.
Most users new to dracut perceive the verbose dracut logs as errors.
This change will help prevent and eliminate user confusion and improve
the user experience.
Jo Zzsi [Fri, 15 Aug 2025 16:42:27 +0000 (12:42 -0400)]
ci: introduce networking tests into Daily integration tests
The newly introduced NETWORK test case is simple enough to run on all
available dracut network modules. Let's use Debian and Arch only for
now to keep the test matrix small.