]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
3 months agofix(systemd-networkd): correct path of 99-default.network on hostonly=no
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.

3 months agofix(dracut): use grep -q/-s to silence output/error
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.

Signed-off-by: Coiby Xu <coxu@redhat.com>
3 months agotest: log when server startup has been finish
Benjamin Drung [Wed, 29 Oct 2025 01:31:18 +0000 (02:31 +0100)] 
test: log when server startup has been finish

To ease debugging echo when the server startup has been finished.

3 months agotest: show all server logs until the "Serving" line
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.

3 months agotest(NFS): do not ignore failures in test_nfsv3
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`.

3 months agotest: support systemd in target rootfs
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.

3 months agotest: name rootfs differently
Benjamin Drung [Mon, 27 Oct 2025 13:22:20 +0000 (14:22 +0100)] 
test: name rootfs differently

To help debugging issues, name the different rootfs' differently (i.e.
include the name of the test and whether it is the server or client
part).

3 months agotest: split "made it to the rootfs" from "Powering down."
Benjamin Drung [Mon, 27 Oct 2025 13:18:25 +0000 (14:18 +0100)] 
test: split "made it to the rootfs" from "Powering down."

Since the test script does things between reaching the rootfs and
powering down, split those messages.

3 months agotest: fix check for unset BIN
Benjamin Drung [Tue, 14 Oct 2025 16:03:05 +0000 (18:03 +0200)] 
test: fix check for unset BIN

`test/run-qemu` uses `set -u` and therefore will fail with:

```
test/run-qemu: line 57: BIN: unbound variable
```

3 months agofeat(plymouth): do not check plymouth-populate-initrd for "nash"
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`.

3 months agofix(lsinitrd): drop --verbose from cpio --to-stdout call
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.

3 months agorefactor(dracut): add create_directories function
Benjamin Drung [Thu, 14 Aug 2025 19:23:08 +0000 (21:23 +0200)] 
refactor(dracut): add create_directories function

Reduce code duplication by introducing the helper function
`create_directories`.

Note: `test -h` is the same as `test -L`.

3 months agoci(integration-extra): run tests on debian:sid again
Benjamin Drung [Tue, 30 Sep 2025 13:55:25 +0000 (15:55 +0200)] 
ci(integration-extra): run tests on debian:sid again

util-linux 2.41.2-3 revived `switch_root` for Dracut (in `util-linux-extra`).

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1727
3 months agotest(UEFI): no longer needs to run inside a container
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.

3 months agotest(nbd): test-makeroot does not need network
Benjamin Drung [Tue, 28 Oct 2025 22:26:36 +0000 (23:26 +0100)] 
test(nbd): test-makeroot does not need network

The `test-makeroot` initrd does not need network.

3 months agofix(iscsi): drop ExecStartPre startup-checks.sh from iscsid.service
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.

3 months agotest: fix catching failures with "set -e" in tests
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.

3 months agotest: introduce print_test_result helper function
Benjamin Drung [Tue, 21 Oct 2025 16:52:26 +0000 (18:52 +0200)] 
test: introduce print_test_result helper function

Introduce a `print_test_result` helper function in preparation for the
following commit.

3 months agotest: avoid && where not needed
Benjamin Drung [Tue, 21 Oct 2025 16:22:57 +0000 (18:22 +0200)] 
test: avoid && where not needed

Concatinating commands with `&&` will prevent exiting on failures in
those command (set via `set -e`).

So avoid using `&&` in tests where it is not needed.

3 months agofix(dmsquash-live): install required stat binary
Antonio Alvarez Feijoo [Mon, 27 Oct 2025 07:23:56 +0000 (08:23 +0100)] 
fix(dmsquash-live): install required stat binary

dmsquash-live-root.sh calls stat since 52351cfa049a9594d539e6a5337d591e8039ab80

Fixes #1780

3 months agofix(dracut): install items before dracut modules are included
Jo Zzsi [Sat, 11 Oct 2025 01:55:25 +0000 (21:55 -0400)] 
fix(dracut): install items before dracut modules are included

Files specified on command line or in configuration files should
have higher priority than files specified by dracut modules.

3 months agofix(systemd-sysusers): spelling of after
Benjamin Drung [Mon, 20 Oct 2025 12:15:40 +0000 (14:15 +0200)] 
fix(systemd-sysusers): spelling of after

3 months agofix(dracut-rescue): add support for /run/initramfs/dracut.conf.d
Jo Zzsi [Wed, 8 Oct 2025 13:33:16 +0000 (09:33 -0400)] 
fix(dracut-rescue): add support for /run/initramfs/dracut.conf.d

Allow dracut read configuration files from /run as well,
in addition to /etc/ and /usr including the dracut-rescue
kernel-install script.

Modify test case to demonstrate use-case and provide test
coverage.

Follow-up to 82cd3d3 .

3 months agofeat(dracut): add support for /run/initramfs/dracut.conf.d
Jo Zzsi [Sat, 27 Sep 2025 17:02:47 +0000 (13:02 -0400)] 
feat(dracut): add support for /run/initramfs/dracut.conf.d

Allow dracut read configuration files from /run as well,
in addition to /etc/ and /usr.

Modify test case to demonstrate use-case and provide test
coverage.

3 months agofix(plymouth): do not install plymouth-set-default-theme into initrd
Benjamin Drung [Wed, 1 Oct 2025 22:26:44 +0000 (00:26 +0200)] 
fix(plymouth): do not install plymouth-set-default-theme into initrd

The script `plymouth-set-default-theme` is not needed inside the initrd,
because it is not called by anything. So skip installing it.

4 months agofeat(plymouth): use simpledrm if Plymouth is configured to it
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.

Ubuntu is using `simpledrm` by default.

4 months agofix(plymouth): check all library directories for Plymouth
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")
4 months agofeat(dracut): support setting compression level separately
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"`.

4 months agofix(plymouth): drop depending on bash
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")
4 months agotest: fix MACAddressPolicy from keep to none
Benjamin Drung [Tue, 30 Sep 2025 12:54:16 +0000 (14:54 +0200)] 
test: fix MACAddressPolicy from keep to none

The `MACAddressPolicy` can be only set to `persistent`, `random`, or
`none` (see systemd.link man page). There is no policy `keep`.

So correct `MACAddressPolicy` to `none`.

Fixes: f3f081e5420f ("TEST-{20,50,60,70): set MACAddressPolicy=keep")
4 months agotest(NFS): drop including missing overlay in server initrd
Benjamin Drung [Tue, 30 Sep 2025 12:40:19 +0000 (14:40 +0200)] 
test(NFS): drop including missing overlay in server initrd

The NFS test shows following warning when generating `initramfs.server`:

```
dracut[E]: /var/tmp/dracut-test.26n7FD/overlay doesn't exist
```

There is no overlay directory for the server initrd.

4 months agotest: allow running UEFI and kernel-install tests in chroot
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).

4 months agochore(dracut): enforce that /etc is only used in hostonly mode
Jo Zzsi [Fri, 26 Sep 2025 12:40:58 +0000 (08:40 -0400)] 
chore(dracut): enforce that /etc is only used in hostonly mode

Only set global variables using /etc in hostonly mode, ot make sure
errors are exposed if /etc is used in non-hostonly mode.

The goal if this PR is to ensure reproducible non-hostonly images.

4 months agoci: update failing tests exclude list for Daily tests
Jo Zzsi [Mon, 29 Sep 2025 01:42:23 +0000 (21:42 -0400)] 
ci: update failing tests exclude list for Daily tests

Debian:sid no longer has switch_root binary, disable failing tests.

https://github.com/dracut-ng/dracut-ng/issues/1314 is fixed by
0e88ccc.

4 months agoci(debian): add util-linux-extra package for wdctl
Jo Zzsi [Mon, 29 Sep 2025 01:27:44 +0000 (21:27 -0400)] 
ci(debian): add util-linux-extra package for wdctl

The wdctl binary is now provided by util-linux-extra package on
debian:sid.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1727
4 months agochore(doc): fix syntax
Jo Zzsi [Sun, 28 Sep 2025 22:24:31 +0000 (18:24 -0400)] 
chore(doc): fix syntax

Follow-up to db18959 to fix syntax.

4 months agofix(network): handle network selection properly
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

Revert c81c955.

Adjust the CI to test with default networking instead of
forcing network-manager to test for this condition.

4 months agoci(debian): add bsdextrautils package for rev
Jo Zzsi [Sun, 28 Sep 2025 21:59:07 +0000 (17:59 -0400)] 
ci(debian): add bsdextrautils package for rev

The rev binary is now provided by bsdextrautils package on
debian:sid.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1727
4 months agoci(debian): install iscsiuio package into the test CI
Jo Zzsi [Sun, 28 Sep 2025 13:08:55 +0000 (09:08 -0400)] 
ci(debian): install iscsiuio package into the test CI

The bug that was holding back installing iscsiuio is fixed.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056733

4 months agoci: allow the execution of arbitrary commands within the test container
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.

4 months agotest(DMSQUASH): add coverage for more dracut modules inside the iso
Jo Zzsi [Sun, 28 Sep 2025 02:00:15 +0000 (22:00 -0400)] 
test(DMSQUASH): add coverage for more dracut modules inside the iso

The list of additionally included dracut modules are inspired by
the list in the Fedora iso.

Most notably, this commit adds networking into the iso.

See https://github.com/livecd-tools/livecd-tools/blob/main/imgcreate/live.py .

4 months agotest(SKIPCPIO): check 3cpio for supported features
Benjamin Drung [Sun, 28 Sep 2025 11:45:34 +0000 (13:45 +0200)] 
test(SKIPCPIO): check 3cpio for supported features

Ubuntu 24.04 ships 3cpio 0.5.1 which does not have `--create` and
`--parts`. So check 3cpio for these features and fall back to `cpio`.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1720
4 months agoci: only pass TEST_FSTYPE to the CI container if it is set
Jo Zzsi [Sun, 28 Sep 2025 11:42:36 +0000 (07:42 -0400)] 
ci: only pass TEST_FSTYPE to the CI container if it is set

Follow-up to 58007a0 to resolve the CI coverage regression
where TEST_FSTYPE defaulted to ext4 in all test containers.

4 months agofeat(dracut): support 3cpio for creating initrds
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.

4 months agofeat(lsinitrd): support 3cpio
Benjamin Drung [Mon, 22 Sep 2025 13:13:17 +0000 (15:13 +0200)] 
feat(lsinitrd): support 3cpio

`3cpio` is written in Rust and faster than `cpio`. Use `3cpio` in
`lsinitrd` in case it is available.

4 months agofix(iscsi): do not include /etc/iscsi/iscsid.conf in generic mode
Jo Zzsi [Sat, 27 Sep 2025 01:26:36 +0000 (21:26 -0400)] 
fix(iscsi): do not include /etc/iscsi/iscsid.conf in generic mode

Files under /etc on the host are considered host specific.
Do not include them in the generic initramfs.

4 months agofix(dbus, network-manager): make generic mode host independent
Jo Zzsi [Sat, 27 Sep 2025 11:40:01 +0000 (07:40 -0400)] 
fix(dbus, network-manager): make generic mode host independent

Files under /etc on the host are considered host specific.
Do not include them in the generic initramfs.

As an example "$dbussystemconfdir"/teamd.conf points to
/etc/dbus-1/system.d/teamd.conf - which should be only included
in hostonly initramfs.

4 months agofix(nvmf): do not install hostonly configuration in generic initramfs
Jo Zzsi [Sat, 27 Sep 2025 11:55:05 +0000 (07:55 -0400)] 
fix(nvmf): do not install hostonly configuration in generic initramfs

/etc/nvme/discovery.conf and /etc/nvme/config.json are meant to
configure each host - only install them in hostonly initramfs.

4 months agotest(SKIPCPIO): support 3cpio
Benjamin Drung [Thu, 25 Sep 2025 10:35:00 +0000 (12:35 +0200)] 
test(SKIPCPIO): support 3cpio

Support using 3cpio in the skipcpio test to allow not having `cpio`
installed.

4 months agotest(SKIPCPIO): introduce cpio_create function
Benjamin Drung [Thu, 25 Sep 2025 09:44:38 +0000 (11:44 +0200)] 
test(SKIPCPIO): introduce cpio_create function

In preparation to support 3cpio as alternative archive tool, move the
cpio creation call into `cpio_create`.

4 months agotest(SKIPCPIO): introduce cpio_list_first function
Benjamin Drung [Thu, 25 Sep 2025 09:42:32 +0000 (11:42 +0200)] 
test(SKIPCPIO): introduce cpio_list_first function

In preparation to support 3cpio as alternative archive tool, move the
cpio listing call into `cpio_list_first` and expect it to take a file as
input.

4 months agotest(SYSTEMD-INITRD): lock down this test to boot without shell
Jo Zzsi [Sat, 27 Sep 2025 15:30:54 +0000 (11:30 -0400)] 
test(SYSTEMD-INITRD): lock down this test to boot without shell

Demonstrate the steps and cprovide coverage for root filesystem
on a ext4 filesystem with systemd but without dracut-systemd and shell

4 months agofix(debian): no need to change permissions
Jo Zzsi [Sat, 27 Sep 2025 15:13:14 +0000 (11:13 -0400)] 
fix(debian): no need to change permissions

CI runs as root, no need to customize the Debian
container.

Fixes the following error

```
chmod: cannot operate on dangling symlink '/boot/vmlinuz'
chmod: cannot operate on dangling symlink '/boot/vmlinuz.old'
```

4 months agofix(test-functions): use absolute path
Jo Zzsi [Sat, 27 Sep 2025 12:33:53 +0000 (08:33 -0400)] 
fix(test-functions): use absolute path

This commit resolves recent ci regression caused by 0e88ccc.

Fixes https://github.com/dracut-ng/dracut-ng/issues/1672

4 months agofeat(debian.conf): default to initrd.img-${kernel} on Debian/Ubuntu
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.

4 months agofix(Makefile): exclude hidden directories from shellcheck part 2
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").

4 months agotest: avoid kernel-install add-all
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`.

4 months agofix(cpio): use mutex to avoid multi-threaded failures
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
4 months agofix(cpio): unit test regression from GNU cpio changes
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.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1694
4 months agotest(FULL-SYSTEMD): remove obsolete and incorrect check
Jo Zzsi [Wed, 24 Sep 2025 14:38:05 +0000 (10:38 -0400)] 
test(FULL-SYSTEMD): remove obsolete and incorrect check

00systemd-network-management has been renumbered and this
additional check is not really needed any more.

Remove it.

4 months agotest(FULL-SYSTEMD): remove dbus dependency
Jo Zzsi [Mon, 22 Sep 2025 22:39:20 +0000 (18:39 -0400)] 
test(FULL-SYSTEMD): remove dbus dependency

Test FULL systemd without the dbus dracut module.

This is a follow-up to fdfa899.

4 months agotest(UEFI): change the order of execution to fix regression
Jo Zzsi [Tue, 23 Sep 2025 01:11:48 +0000 (21:11 -0400)] 
test(UEFI): change the order of execution to fix regression

6ae7ac0 regressed testing on Alpine and Azure Linux as
on those platforms the test is no longer skipped.

Make sure the test is skipped if stub is not available.

4 months agotest(KERNEL-INSTALL): remove checking for systemd version 255 or later
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.

See also 27d9a96 .

4 months agofeat(dracut): print the computed configuration and exit
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.

4 months agofix(systemd): make dbus optional dependency
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.

4 months agodocs: define hostonly_mode strict with more detail
Jo Zzsi [Fri, 19 Sep 2025 23:57:56 +0000 (19:57 -0400)] 
docs: define hostonly_mode strict with more detail

Document the goal to keep the list of dracut modules the same for
both hostonly_modes.

4 months agoci(debian): move workaround to the test case
Jo Zzsi [Mon, 22 Sep 2025 01:04:32 +0000 (21:04 -0400)] 
ci(debian): move workaround to the test case

Including workaround in the test case itself will allow to pass it
downstream.

These workarounds are still needed.

4 months agotest(USR-MOUNT): add a test step to mount read-only btrfs snapshot
Jo Zzsi [Sat, 20 Sep 2025 00:54:15 +0000 (20:54 -0400)] 
test(USR-MOUNT): add a test step to mount read-only btrfs snapshot

Add a step to create a read-only btrfs snapshot and mount it.

4 months agoci(debian): install packages recommended by packaging
Jo Zzsi [Sat, 20 Sep 2025 00:18:36 +0000 (20:18 -0400)] 
ci(debian): install packages recommended by packaging

Install all package dependencies based on downstream packaging.

This commit ensures that we do not miss some dowsntream package
dependencies here upstream.

4 months agoci(debian): revert Debian workarounds
Jo Zzsi [Sat, 20 Sep 2025 19:15:28 +0000 (15:15 -0400)] 
ci(debian): revert Debian workarounds

Now, that the CI transitioned to
Debian trixie release let's remove Debian
workarounds for kernel-install.

This commit is a revert for 64d6da9f2 .

4 months agoci: exclude test 41 on arch due to systemd v258 regression
Jo Zzsi [Sat, 20 Sep 2025 01:08:40 +0000 (21:08 -0400)] 
ci: exclude test 41 on arch due to systemd v258 regression

Skip to keep the CI green for the ongoing development.

Based on the information available currently, this is
likely a regression with systemd.

4 months agofix(dracut-init): remove obsolete comment
Jo Zzsi [Sat, 20 Sep 2025 00:03:05 +0000 (20:03 -0400)] 
fix(dracut-init): remove obsolete comment

These comments are meant for legacy dracut modules that are no
longer support.

4 months agotest(NFS): include pidof command in server root fs
Benjamin Drung [Fri, 19 Sep 2025 19:23:16 +0000 (21:23 +0200)] 
test(NFS): include pidof command in server root fs

The `server-init.sh` script calls `pidof rpc.idmapd` and therefore the
`pidof` command is needed in the server root file system.

4 months agofix(lsinitrd): use lowercase skip variable name
Benjamin Drung [Fri, 19 Sep 2025 17:11:42 +0000 (19:11 +0200)] 
fix(lsinitrd): use lowercase skip variable name

The test Makefile takes a `SKIP` environment variable to skip tests.
This variable might leak into `lsinitrd`:

```
$ make -C test V=1 check SKIP="23 30 43 50 60 70 71 72"
[...]
/usr/bin/lsinitrd: line 467: 23: command not found
```

Rename the `SKIP` variable to use lowercase and unset this variable to
avoid leaking values into it.

4 months agoci: add daily test coverage for --hostonly-mode strict
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.

4 months agofix(systemd): add compatibility with systemd v258
Jo Zzsi [Thu, 18 Sep 2025 22:27:17 +0000 (18:27 -0400)] 
fix(systemd): add compatibility with systemd v258

Add breakpoint units for the newly-introduced systemd.break=
functionality.

Reference: systemd/systemd#35410

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1677
4 months agochore(fedora): simplify Fedora configuration
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).

4 months agorevert(fedora): switch to strict hostonly mode by default
Jo Zzsi [Fri, 19 Sep 2025 00:52:08 +0000 (20:52 -0400)] 
revert(fedora): switch to strict hostonly mode by default

Fedora is no longer planning to switch to strict hostonly mode.

Change back the Fedora configuration to reflect this Fedora policy
decision.

4 months agofix: partial revert for hostonly sloppy mode
Jo Zzsi [Thu, 18 Sep 2025 02:42:17 +0000 (22:42 -0400)] 
fix: partial revert for hostonly sloppy mode

This commit is a _partial_ revert of 8519dcd.

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.

4 months agofix(virtfs, virtiofs): dracut module should not delete rootfs files
Jo Zzsi [Sun, 14 Sep 2025 20:52:11 +0000 (16:52 -0400)] 
fix(virtfs, virtiofs): dracut module should not delete rootfs files

Dracut built-in modules should not delete files from rootfs.

Follow-up to 8d2a6d2 .

4 months agofix(dracut.sh): check that custom fw search patch exists before reading it
Antonio Alvarez Feijoo [Thu, 18 Sep 2025 09:21:58 +0000 (11:21 +0200)] 
fix(dracut.sh): check that custom fw search patch exists before reading it

It may not exist, for example, when using an image builder like kiwi:

```
[ DEBUG   ]: 07:58:22 | /usr/bin/dracut: line 1095: /sys/module/firmware_class/parameters/path: No such file or directory
```

4 months agoci(test-root): ext4 driver for test root is coming from the test initrd
Jo Zzsi [Wed, 17 Sep 2025 19:38:55 +0000 (15:38 -0400)] 
ci(test-root): ext4 driver for test root is coming from the test initrd

Partail revert of 6d1a898. The ext4 driver does not need to be forced
(and is not needed) for the rootfs that the test case is booting into.

4 months agoci(opensuse): remove workaround for a sym link
Jo Zzsi [Wed, 17 Sep 2025 18:55:44 +0000 (14:55 -0400)] 
ci(opensuse): remove workaround for a sym link

The sym link to the kernel Image workaround is no longer
needed for arm64, as df93355 is landed.

4 months agofeat(qemu): install sd_mod driver
Jo Zzsi [Sun, 14 Sep 2025 01:47:43 +0000 (21:47 -0400)] 
feat(qemu): install sd_mod driver

It is very common to use sd_mod driver inside qemu.

Let's install the sd_mod driver when qemu dracut module
is included.

4 months agofix(dracut): add support for kernel name Image
Jo Zzsi [Sun, 14 Sep 2025 16:51:06 +0000 (12:51 -0400)] 
fix(dracut): add support for kernel name Image

On some architectures (arm64) the name of the kernel file
is usually Image. Add support for it instead of working around it.

4 months agofix(doc): correct spelling mistake of recommended
Benjamin Drung [Mon, 15 Sep 2025 14:08:34 +0000 (16:08 +0200)] 
fix(doc): correct spelling mistake of recommended

4 months agoci: un-exclude test 30 for ubuntu:devel
Jo Zzsi [Sun, 14 Sep 2025 21:55:44 +0000 (17:55 -0400)] 
ci: un-exclude test 30 for ubuntu:devel

The test is now passing, lets resume running it on the CI.

4 months agoci(daily): include tests 13 in the daily test suite
Jo Zzsi [Sun, 14 Sep 2025 14:18:30 +0000 (10:18 -0400)] 
ci(daily): include tests 13 in the daily test suite

Test 13 has been added recently but was not included in the
daily intergration test.

4 months agoci(debian): make sure ip command is available
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.

4 months agoci: make sure job group names are unique
Jo Zzsi [Sun, 14 Sep 2025 13:39:51 +0000 (09:39 -0400)] 
ci: make sure job group names are unique

If job group names are not unique, tests can fail due to
concurrency rules, even if they would have otherwise passed.

4 months agotest(NFS): enable tests when dhclient is not available
Jo Zzsi [Sun, 14 Sep 2025 13:32:05 +0000 (09:32 -0400)] 
test(NFS): enable tests when dhclient is not available

$USE_NETWORK dracut module needs to be added explicitly
when networking is required.

Follow-up to 16b5e37 .

4 months agoci: allow porting to dnsmasq from isc-dhcp-server
Jo Zzsi [Sun, 14 Sep 2025 12:47:37 +0000 (08:47 -0400)] 
ci: allow porting to dnsmasq from isc-dhcp-server

Add dnsmasq to prepare to change the test cases to use dnsmasq.

This is a step towards fixing https://github.com/dracut-ng/dracut-ng/issues/1451.

4 months agoci: remove dhclient from Arch, Debian, Fedora CI
Jo Zzsi [Sun, 14 Sep 2025 12:37:32 +0000 (08:37 -0400)] 
ci: remove dhclient from Arch, Debian, Fedora CI

The motivation to remove dhclient is to make sure that dracut
networking does not need dhclient (when used with network-manager
or systemd-networkd).

Some distributions (such as Alpine) no longer packages dhclient,
which might happen to some of these other distributions as well.

4 months agotest(NFS): do not use rd.net.timeout.dhcp
Jo Zzsi [Sun, 14 Sep 2025 01:37:38 +0000 (21:37 -0400)] 
test(NFS): do not use rd.net.timeout.dhcp

rd.net.timeout.dhcp is only understood by network-legacy
dracut module.

We want to start migrating to network-manager from network-legacy,
so stop using this command line option in tests.

4 months agoci: only add qemu-net dracut module to networked tests
Jo Zzsi [Sun, 14 Sep 2025 03:33:11 +0000 (23:33 -0400)] 
ci: only add qemu-net dracut module to networked tests

Do not slow down local storage tests with qemu-net dependency.

4 months agoci: add more daily networking test
Jo Zzsi [Sun, 14 Sep 2025 01:05:10 +0000 (21:05 -0400)] 
ci: add more daily networking test

Create a separate job for network-manager and include all
passing CI containers as network-manager.

4 months agoci: enable controlling TEST_FSTYPE as part of container test run
Jo Zzsi [Sat, 13 Sep 2025 23:55:28 +0000 (19:55 -0400)] 
ci: enable controlling TEST_FSTYPE as part of container test run

Pass TEST_FSTYPE to the test container and document a more complex
test run using TEST_FSTYPE.

4 months agofix(test-makeroot): make it dependent on initqueue
Jo Zzsi [Sun, 14 Sep 2025 00:04:06 +0000 (20:04 -0400)] 
fix(test-makeroot): make it dependent on initqueue

In its current form test-makeroot dracut module depends on
the initqueue module.

4 months agoci: simplify test cases
Jo Zzsi [Sat, 13 Sep 2025 23:22:53 +0000 (19:22 -0400)] 
ci: simplify test cases

Remove unnecessary opinionated parts of the test cases.

Do not add and manage drivers manually in the test case unless
the test case is specifically testing for that.

Consolidate test configurations into common comfig files
when possible.

4 months agoci: add more drivers to pass CI in strict hostonly mode as well
Jo Zzsi [Sat, 13 Sep 2025 22:14:14 +0000 (18:14 -0400)] 
ci: add more drivers to pass CI in strict hostonly mode as well

Strict hostonly mode is missing some drivers - especially
when these drivers are not built into the Linux kernel
(e.g. on CentOS or Alpine).