Benjamin Drung [Wed, 29 Oct 2025 11:27:13 +0000 (12:27 +0100)]
fix(systemd-networkd): correct path of 99-default.network on hostonly=no
Commit 2991f74ab46389947ce8f96b87a7abdc1862cbb6 ("chore(dracut): enforce
that /etc is only used in hostonly mode") does not set
`systemdnetworkconfdir` any more on `hostonly=no`. This causes the
systemd-network module to install `99-default.network` to
`/zzzz-dracut-default.network` on generic builds and therefore loosing
this network config.
Install `99-default.network` to the system path in `/usr` instead.
Coiby Xu [Thu, 16 Oct 2025 07:43:05 +0000 (15:43 +0800)]
fix(dracut): use grep -q/-s to silence output/error
There is no need to redirect output/error to /dev/null. Simply use -q/-s
option provided by grep.
Note we should use avoid using
"set -o pipefail lsinitrd PAHT_PATH_INITRAMFS | grep -q PATTERN".
Because with set -o pipefail, a pipeline’s exit status becomes non-zero
if any element of the pipeline fails and grep -q exits as soon as it
sees a match.
Benjamin Drung [Wed, 29 Oct 2025 01:22:24 +0000 (02:22 +0100)]
test: show all server logs until the "Serving" line
The function `wait_for_server_startup` will search för `Serving` in the
server log for the indication that the server started correctly. It will
print the logs every second until `Serving` is found, but it will not
print the `Serving` line.
Print the remaining log lines after `Serving` has been found.
Benjamin Drung [Wed, 29 Oct 2025 00:58:11 +0000 (01:58 +0100)]
test(NFS): do not ignore failures in test_nfsv3
After `set -e` is called, the shell will exit immediately if a simple
command exits with a non-zero status, but the shell will not exit if the
command is part of a `&&` list.
So calling `test_nfsv3 && test_nfsv4` will not exit on failures in
`test_nfsv3`. Call those functions separately and rely on `set -e`.
Benjamin Drung [Tue, 28 Oct 2025 13:13:28 +0000 (14:13 +0100)]
test: support systemd in target rootfs
The test-root module installs `test-init.sh` in `/sbin/test-init` and
adds `testsuite.service` if systemd is used. When systemd is used in the
target client/server rootfs, the systemd in the initrd hands over the
control to the systemd in the rootfs. Then `testsuite.service` executes
`test-init.sh` instead of the wanted client/server init scripts.
Add the helper function `inst_init` to override the init script from the
test-root dracut module.
Benjamin Drung [Wed, 8 Oct 2025 20:03:46 +0000 (22:03 +0200)]
feat(plymouth): do not check plymouth-populate-initrd for "nash"
Commit f9749f368f1e ("plymouth: use
/usr/libexec/plymouth/plymouth-populate-initrd if possible") checked
`plymouth-populate-initrd` not not contain `nash` in 2009. The current
Plymouth version does not contain this string and there were no reason
given for this check.
Drop checking `plymouth-populate-initrd` for not containing `nash`.
Benjamin Drung [Mon, 11 Aug 2025 17:22:49 +0000 (19:22 +0200)]
fix(lsinitrd): drop --verbose from cpio --to-stdout call
Calling `cpio --extract` with `--verbose` will print the filenames to
stderr, but this output is thrown away. Calling `cpio --extract --quiet`
will not print anything on stderr (except for error messages).
So drop `--verbose` and then stderr does not need to be thrown away any
more.
Jo Zzsi [Wed, 8 Oct 2025 13:26:40 +0000 (09:26 -0400)]
test(UEFI): no longer needs to run inside a container
Commit 82cd3d3 allows changing the dracut configuration using the
/run/initramfs/dracut.conf.d directory without modifying the
/etc or /usr directories.
This new dracut feature allows running this test on bare metal.
Remove the check for running inside a container that was left
in this test inadvertently.
Benjamin Drung [Tue, 28 Oct 2025 15:50:54 +0000 (16:50 +0100)]
fix(iscsi): drop ExecStartPre startup-checks.sh from iscsid.service
`/usr/lib/open-iscsi/startup-checks.sh` checks that
`/etc/iscsi/iscsid.conf` and `/etc/iscsi/initiatorname.iscsi` are
present. This is not the case for initrds built without hostonly.
So just drop `/usr/lib/open-iscsi/startup-checks.sh` from
`iscsid.service` and rely on dracut to generate a working environment
for iscsid.
Benjamin Drung [Tue, 21 Oct 2025 17:18:28 +0000 (19:18 +0200)]
test: fix catching failures with "set -e" in tests
After `set -e` is called, the shell will exit immediately if a simple
command exits with a non-zero status, but the shell will not exit if the
command is part of a `&&` list.
So calling `test_setup && test_run` will not exit on failures in
`test_setup`. Failures in `test_run` will cause the script to exit
without printing the result.
Restructure the test runner to rely on `set -e` aborting the test and
use a trap on this error to print the test result.
Benjamin Drung [Tue, 30 Sep 2025 14:24:16 +0000 (16:24 +0200)]
feat(plymouth): use simpledrm if Plymouth is configured to it
Plymouth has a configuration setting `UseSimpledrm` for using
`simpledrm`. Check this configuration setting and only pull in
`simpledrm` instead of `drm` in case it is set.
Benjamin Drung [Mon, 29 Sep 2025 22:22:40 +0000 (00:22 +0200)]
fix(plymouth): check all library directories for Plymouth
On amd64 `dpkg-architecture -qDEB_HOST_MULTIARCH` returns
`x86_64-linux-gnu` but `uname -m` returns only `x86_64`.
`/usr/lib/x86_64` does not exist on Debian/Ubuntu but
`/usr/lib/x86_64-linux-gnu` exists.
Rely on `libdirs` to provide all possible library directories including
the Debian multiarch directory `/usr/lib/x86_64-linux-gnu`.
Fixes: 1b374931126c ("fix(plymouth): do not depend on dpkg-architecture")
Benjamin Drung [Sun, 28 Sep 2025 11:58:00 +0000 (13:58 +0200)]
feat(dracut): support setting compression level separately
Extend the Dracut configuration to configure the default compression
level for each compression format (e. g. `compress_level_zstd` for
zstd). Add `--compress-level` option to `dracut` to override the
compression level from the configuration.
Then users could just call `dracut --zstd --compress-level 3` instead of
`dracut --compress="zstd -3 -T0 -q"`.
Benjamin Drung [Mon, 29 Sep 2025 21:57:43 +0000 (23:57 +0200)]
fix(plymouth): drop depending on bash
The only Bash script in the Plymouth module is
`plymouth-populate-initrd.sh` which is called by `module-setup.sh` and
not included in the initrd. Therefore the Plymouth module does not
require Bash.
Fixes: 3a04a139700 ("fix: add bash dependency when bash scripts are used in the module")
Benjamin Drung [Tue, 30 Sep 2025 12:50:20 +0000 (14:50 +0200)]
test: allow running UEFI and kernel-install tests in chroot
The UEFI and kernel-install tests want to run in an isolated environment
to avoid modifying the host system. Allow running those tests in a
chroot (like schroot).
Jo Zzsi [Sun, 28 Sep 2025 15:44:47 +0000 (11:44 -0400)]
fix(network): handle network selection properly
Earlier each test CI container included dhclient, which
meant that each CI continer supported network-legacy.
4ce57a5ad exposed a bug in the network selection as
network-manager was not selected even when available.
This change is fixes the following issues on the CI:
- selects network-manager over network-legacy on Void
- selects network-manager or systemd-networkd if network-legacy is not installed
Jo Zzsi [Sun, 28 Sep 2025 12:43:02 +0000 (08:43 -0400)]
ci: allow the execution of arbitrary commands within the test container
Evaluate the TEST_CONTAINER_COMMAND right before the test run
inside the test container to facilitate additional testing that
is not provided by the test CI containers by default.
Benjamin Drung [Wed, 13 Aug 2025 23:41:19 +0000 (01:41 +0200)]
feat(dracut): support 3cpio for creating initrds
`3cpio` is written in Rust and faster than `cpio`. Use `3cpio` in
`dracut.sh` in case it is available. `3cpio` supports
`SOURCE_DATE_EPOCH` and therefore clamping the files is not needed.
Benjamin Drung [Thu, 18 Sep 2025 10:59:48 +0000 (12:59 +0200)]
feat(debian.conf): default to initrd.img-${kernel} on Debian/Ubuntu
Extend the Debian/Ubuntu Dracut configuration to change the default
`initrdname` to `initrd.img-${kernel}`. This is done to keep the name
the same as initramfs-tools which has been the default for a long time.
This change will be carried for quite some time to ease the switch from
initramfs-tools to dracut.
Benjamin Drung [Fri, 26 Sep 2025 08:31:59 +0000 (10:31 +0200)]
fix(Makefile): exclude hidden directories from shellcheck part 2
`find .` 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. See also
commit 7a65d1a1f372 ("fix(Makefile): exclude hidden directories from
shellcheck").
Benjamin Drung [Thu, 25 Sep 2025 23:28:05 +0000 (01:28 +0200)]
test: avoid kernel-install add-all
The man page of `kernel-install` says about `add-all`: "This is the same
as add, but invokes the operation iteratively for every installed kernel
in /usr/lib/modules/. This operation is only supported on systems where
the kernel image is installed in
/usr/lib/modules/KERNEL-VERSION/vmlinuz."
Debian and Ubuntu do not ship the kernel images in `/usr/lib/modules/`
and therefore `add-all` is not supported there.
Since the test cases already determine the kernel version, search for
the kernel image and use `kernel-install add` instead of `add-all`.
David Disseldorp [Thu, 25 Sep 2025 04:21:18 +0000 (06:21 +0200)]
fix(cpio): use mutex to avoid multi-threaded failures
`cargo test` runs tests in parallel by default, unless the
--test-threads=1 parameter is provided. This causes the dracut-cpio
unit tests to fail due to their working directory changes.
Add a mutex and hold it over the course of the changed directory, so
that the --test-threads=1 parameter is no longer needed.
Suggested-by: Benjamin Drung <bdrung@posteo.de> Fixes: https://github.com/dracut-ng/dracut-ng/issues/1702
David Disseldorp [Mon, 22 Sep 2025 12:52:20 +0000 (14:52 +0200)]
fix(cpio): unit test regression from GNU cpio changes
dracut-cpio unit tests compare binary archive output with that of GNU
cpio, for the same set of input files. A recent change to upstream GNU
cpio, commit 6a94d5e ("New option --ignore-dirnlink"), causes some tests
to fail.
The failure is due to GNU cpio `--reproducible` now hardcoding directory
nlink values to 2, instead of using the st_nlink value reported by
stat().
Fix the unit tests by dropping the GNU cpio `--reproducible` alias
parameter, and instead specify `--ignore-devno --renumber-inodes`
explicitly, matching pre-6a94d5e GNU cpio `--reproducible` behaviour.
Jo Zzsi [Mon, 22 Sep 2025 23:26:37 +0000 (19:26 -0400)]
test(KERNEL-INSTALL): remove checking for systemd version 255 or later
systemd version 255 or later is already the minimal supported
systemd version, so there is no longer a need to maintain this
additional check and additional complexity.
Jo Zzsi [Tue, 16 Sep 2025 11:47:45 +0000 (07:47 -0400)]
feat(dracut): print the computed configuration and exit
Dracut is able to inspect the host and auto-determine the best
configuration and compine the computed configurtion with the
distribution and user configuration.
Since dracut does not have a dry-run option, there is no good
option for an external tool to determine if a dracut invocaton
will result in creating initramfs in hostonly or non-hostonly mode.
Add a command line option that is meant to just compute the
current dracut configuration, print it out and exit.
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.