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.
network-manager always requires nf_tables and other kernel modules
in the generated initramfs to function, regardless if these
modules are loaded on the host or not at the time of initramfs
generation.
Jo Zzsi [Sat, 9 Aug 2025 22:24:32 +0000 (18:24 -0400)]
fix(net-lib): always include af_packet
For static IPv4 configurations, we use arping to check for duplicate
IP addresses. arping requires the af_packet module to work, and if arping
fails, the IP address will not be set and booting will fail.
af_packet may not be loaded / required in the running system, for example if
the system had been booted in an IPv6 configuration, or if it had been
manually unloaded. Make sure it's included in initramfs in hostonly mode, too.
Jo Zzsi [Sat, 2 Aug 2025 23:08:44 +0000 (19:08 -0400)]
chore: always set hostonly and hostonly_mode
It makes it easier to reason both for built-in and out-of-tree dracut
modules with the assumption that hostonly and hostonly_mode variables
are always set.
Document most commonly used shell variables for dracut modules and
document that they are always set.
Benjamin Drung [Tue, 5 Aug 2025 17:16:17 +0000 (19:16 +0200)]
fix(Makefile): use install for installing files
The `cp` command will copy the file/directory permissions from the
source files. The local source files might have group write permission
set which should not be applied to the installation.
Tighten the file/directory permission by using the `install` command
with specifying the mode.
Benjamin Drung [Thu, 31 Jul 2025 19:45:17 +0000 (21:45 +0200)]
fix(kernel-modules): add Cadence USB driver to base
Installed Debian Trixie d-i rc2 (dvd-1) on USB storage on Pine64 Star64
is not bootable due to missing modules `cdns3_starfive` and `cdns3` from
initramfs.
Note the above USB support on Pine64 Star64 is directly part of StarFive
JH7110 CPU and differs from StarFive VisionFive2 which uses an external
controller attached to the PCIe bus.
Jo Zzsi [Sun, 13 Jul 2025 05:35:51 +0000 (01:35 -0400)]
test(NETWORK): coverage for bringing up network interface
Currently, all networking tests in the dracut CI require a client and a
server VM, and all the server VMs are enabled to work with network-legacy only.
Introduce a simpler networking test that tests the rd.neednet dracut
boot time argument and ensures that the interface is up without needing
a server VM.
This simple networking test could be run in most networking configurations
and pass in the Void test containers as well, which previously have not had
any network tests enabled.
Vitaly Kuznetsov [Mon, 11 Aug 2025 09:36:41 +0000 (11:36 +0200)]
fix(systemd-sysext): skip manual systemct enablement for systemd>=258
systemd-258 ships the required initrd.target.wants symlinks, there is
no need to enable services manually. Use the existence of old
systemd-confext/systemd-sysext units as an indication of when manual
(legacy) enablement is still needed.