]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
3 days agodocs: update NEWS.md and AUTHORS for release 109 main 109
dracutng[bot] [Mon, 3 Nov 2025 22:19:35 +0000 (22:19 +0000)] 
docs: update NEWS.md and AUTHORS for release 109

5 days agofix(systemd-sysext): stop adding *.raw to the initramfs automatically
Jo Zzsi [Wed, 8 Oct 2025 16:40:46 +0000 (12:40 -0400)] 
fix(systemd-sysext): stop adding *.raw to the initramfs automatically

These .raw files are full OS trees and are rather huge, adding a
specific .raw one manually seems like a legit use-case.

5 days agodocs: document dracut module requirements
Jo Zzsi [Sat, 1 Nov 2025 16:30:46 +0000 (12:30 -0400)] 
docs: document dracut module requirements

If a kernel command line option requires a dracut module
to be installed, than document it.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1816
6 days agofix(iscsi): only enable services if they are included
Benjamin Drung [Sat, 1 Nov 2025 03:47:53 +0000 (04:47 +0100)] 
fix(iscsi): only enable services if they are included

On systems without iscsiuio installed, dracut emits this warning:

```
Failed to enable unit: Unit iscsiuio.socket does not exist
```

So check if the service is available before trying to enable it.

6 days agorefactor(iscsi): unwrap for loop line
Benjamin Drung [Sat, 1 Nov 2025 03:46:42 +0000 (04:46 +0100)] 
refactor(iscsi): unwrap for loop line

6 days agotest: drop requiring iscsiuio.socket
Benjamin Drung [Sat, 1 Nov 2025 10:49:33 +0000 (11:49 +0100)] 
test: drop requiring iscsiuio.socket

The iscsiuio socket/service is only needed on specific hardware. It is
not needed for the ISCSI and ISCSI-MULTI test cases. Without this check
the tests will succeed on Debian and Ubuntu.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/446
6 days agofix(iscsi): modify iscsid.service in initrd instead of host
Benjamin Drung [Sat, 1 Nov 2025 03:23:59 +0000 (04:23 +0100)] 
fix(iscsi): modify iscsid.service in initrd instead of host

Commit b2287bb7c4544d841b3d5b0510ce765753d990af ("fix(iscsi): drop
ExecStartPre startup-checks.sh from iscsid.service") incorrectly
modifies `iscsid.service` on the host instead of the service that was
copied into the initrd.

Corretly modify `iscsid.service` in initrd instead of on the host.

7 days agotest: drop calling "dmesg -c" from server rootfs script
Benjamin Drung [Fri, 31 Oct 2025 17:08:21 +0000 (18:08 +0100)] 
test: drop calling "dmesg -c" from server rootfs script

In verbose mode (V=1), the tests already print the kernel messages.
Calling `dmesg -c` only duplicates the output and makes it harder to
read.

7 days agofeat(pcsc): add Debian/Ubuntu support
Benjamin [Fri, 31 Oct 2025 11:19:39 +0000 (07:19 -0400)] 
feat(pcsc): add Debian/Ubuntu support

On Debian/Ubuntu, the filename is `opensc-pkcs11.module` instead
of `opensc.module`.

On Debian/Ubuntu, missing `libeac.so` libraries for OpenSC.

On Debian/Ubuntu the OpenSC configuration path is
`/etc/opensc/opensc.conf`.

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

7 days agofix: line-buffer log output to /dev/kmsg
Daniel Hast [Fri, 31 Oct 2025 13:06:17 +0000 (09:06 -0400)] 
fix: line-buffer log output to /dev/kmsg

/dev/kmsg is only designed to accept single lines at a time, and
therefore has a relatively small message size limit. This means we need
to line-buffer the output of awk (and prepend the message level prefix
to each line rather than just the first).

Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
7 days agofeat(kernel-modules-export): make kernel modules from initramfs available
Jo Zzsi [Fri, 10 Oct 2025 12:45:07 +0000 (08:45 -0400)] 
feat(kernel-modules-export): make kernel modules from initramfs available

Although the kernel module for the filesystem is in the initramfs,
it might not loaded in the initramfs, because it is not needed to mount
the root filesystem.

This feature arranges for the kernel modules in the initramfs to be
placed into /lib/modules.

When booting with an external-to-rootfs kernel you need to ensure that
/lib/modules contains any necessary modules not already loaded.

7 days agotest: drop including missing overlay in server initrd
Benjamin Drung [Fri, 31 Oct 2025 16:28:35 +0000 (17:28 +0100)] 
test: drop including missing overlay in server initrd

The tests 71 and 72 shows following warning when generating
`initramfs.server`:

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

There is no overlay directory for the server initrd. Commit
c855fa1ee5c0f01da91bb7724c9dd2f4adb3b50e ("test(NFS): drop including
missing overlay in server initrd") fixed it for test 60. So do the same
for these tests.

7 days agotest(run-qemu): quote arguments only if needed
Benjamin Drung [Fri, 31 Oct 2025 12:38:25 +0000 (13:38 +0100)] 
test(run-qemu): quote arguments only if needed

Increase the readability of the qemu call log by quoting the arguments
only if needed.

7 days agotest: log dracut calls if V=1 or V=2 is set
Benjamin Drung [Fri, 31 Oct 2025 12:35:43 +0000 (13:35 +0100)] 
test: log dracut calls if V=1 or V=2 is set

Logging the qemu calls (in `run-qemu`) helps a lot in debugging. So log
dracut calls as well if V=1 or V=2 is set.

7 days agofix: typo in awk script in _do_dlog_batch_kmsglog
Daniel Hast [Fri, 31 Oct 2025 12:23:15 +0000 (08:23 -0400)] 
fix: typo in awk script in _do_dlog_batch_kmsglog

Fixes #1803.

Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
7 days agofix(dracut-systemd): install grep if initqueue is used
Benjamin Drung [Fri, 31 Oct 2025 11:42:39 +0000 (12:42 +0100)] 
fix(dracut-systemd): install grep if initqueue is used

TEST-13-SYSROOT emits this error on Ubuntu:

```
dracut-initqueue[248]: /usr/bin/dracut-initqueue: 1: /lib/dracut/hooks/initqueue/finished/devexists-\x2fdev\x2fdisk\x2fby-label\x2fdracut.sh: grep: not found
```

`parse-root.sh` injects a grep call into
`$hookdir/initqueue/finished/devexists-${root_name}.sh`. Therefore the
`grep` command needs to be installed if initqueue is used.

7 days agofix(multipath): add udev rule 99-z-dm-mpath-late.rules
Martin Wilck [Fri, 31 Oct 2025 10:21:47 +0000 (11:21 +0100)] 
fix(multipath): add udev rule 99-z-dm-mpath-late.rules

multipath-tools 0.9.8 added a new udev rules file that restores
DM_UDEV_DISABLE_OTHER_RULES_FLAG before saving properties to the
udev db [1]. This fixes a few corner cases that can arise with
LVM2 < 2.03.24 if uevents occur for previously suspended devices.
This rule will do nothing, unless DM_UDEV_DISABLE_OTHER_RULES_FLAG
has been previously modified by 11-dm-mpath.rules.

While it's rather unlikely that this situation occurs during initrd
processing, add the rule file if present, to make sure the multipath
udev rule set is complete and consistent.

[1] https://github.com/opensvc/multipath-tools/commit/35640f26a4b820a2fb1e5a148d7cc0e2663ec6fa

Signed-off-by: Martin Wilck <mwilck@suse.com>
7 days agotest: explicitly create virtio-net-pci device
Benjamin Drung [Fri, 31 Oct 2025 10:09:33 +0000 (11:09 +0100)] 
test: explicitly create virtio-net-pci device

TEST-50-NETWORK fails on s390x:

```
run-qemu: /usr/bin/qemu-system-s390x '-cpu' 'max' '-smp' '2' '-m' '1024' '-nodefaults' '-vga' 'none' '-display' 'none' '-no-reboot' '-watchdog-action' 'poweroff' '-device' 'virtio-rng-pci' '-serial' 'stdio' '-kernel' '/boot/vmlinuz-6.17.0-5-generic' '-nic' 'user,id=lan0,net=10.0.2.0/24,dhcpstart=10.0.2.15,model=virtio-net-pci' '-device' 'virtio-scsi-pci,id=scsi0' '-drive' 'if=none,format=raw,file=/var/tmp/dracut-test.rTJZc1/marker.img,id=drive-data0' '-device' 'scsi-hd,bus=scsi0.0,drive=drive-data0,id=data0,serial=marker' '-device' 'virtio-scsi-pci,id=scsi1' '-drive' 'if=none,format=raw,file=/var/tmp/dracut-test.rTJZc1/root.img,id=drive-data1' '-device' 'scsi-hd,bus=scsi1.0,drive=drive-data1,id=data1,serial=root' '-append' ' root=LABEL=dracut panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot   rd.neednet=1 net.ifnames=0' '-initrd' '/var/tmp/dracut-test.rTJZc1/initramfs.testing'
qemu-system-s390x: warning: netdev lan0 has no peer
qemu-system-s390x: warning: requested NIC (anonymous, model virtio-net-pci) was not created (not supported by this machine?)
[...]
Device "eth0" does not exist.
**************************FAILED**************************
ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
**************************FAILED**************************
```

Explicitly define a `virtio-net-pci` device.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1800
8 days agofix(dracut-install): initialize the fts pointer
Pavel Valena [Thu, 13 Feb 2025 21:18:06 +0000 (22:18 +0100)] 
fix(dracut-install): initialize the fts pointer

8 days agoperf: improve logger efficiency
Daniel Hast [Thu, 30 Oct 2025 16:30:51 +0000 (12:30 -0400)] 
perf: improve logger efficiency

The logger would previously feed input from stdin one line at a time to
the logging target. This is very slow and can have a major impact on
performance when dealing with debug output that can be thousands of
lines long, such as the output of `lsinitrd`.

Instead, add a `_do_dlog_batch` function that accepts input on stdin
rather than as an argument, splits stdin into multiple streams, and uses
`awk` to process multiline inputs efficiently for each target. When
`dlog` is called without arguments, it passes stdin on to this function.
This is orders of magnitude faster for large inputs.

Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
8 days agofix: make logging functions return 1 only on invalid log level
Daniel Hast [Thu, 30 Oct 2025 16:27:37 +0000 (12:27 -0400)] 
fix: make logging functions return 1 only on invalid log level

Change the internal logging functions to return 0 if given a valid log
level and 1 if given an invalid log level, and document this.

The previously documented return value was inaccurate: `_do_dlog` would
not always return 0 as claimed, but rather would return 1 if
`lvl <= kmsgloglvl` due to using `&&` rather than an `if` block for the
final conditional.

Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
8 days agofeat(Makefile): filter out warpclock on S390(x) systems
Benjamin Drung [Thu, 30 Oct 2025 12:21:26 +0000 (13:21 +0100)] 
feat(Makefile): filter out warpclock on S390(x) systems

hwclock does not exist on S390(x). So the module warpclock does not need
to be installed on S390(x) systems.

8 days agoci(debian): add xfsprogs
Jo Zzsi [Wed, 29 Oct 2025 21:32:43 +0000 (17:32 -0400)] 
ci(debian): add xfsprogs

Add xfsprogs to the test container so that successful test run can
be demonstrated as part of an upcoming test case development.

8 days agofeat(plymouth): drop unused plymouth-populate-initrd
Benjamin Drung [Wed, 29 Oct 2025 20:40:22 +0000 (21:40 +0100)] 
feat(plymouth): drop unused plymouth-populate-initrd

The plymouth `check` function calls `pkglib_dir` which searches for an
executable `plymouth-populate-initrd` script. Otherwise it will exit
with a failure and plymouth will not be included. Therefore
`plymouth-populate-initrd` will always be present when `install` is
called. Thus the code path for calling `plymouth-populate-initrd.sh`
will never taken.

So drop `plymouth-populate-initrd.sh` and its unused code path.

8 days agofix(Makefile): correct filter condition for s390 specific modules
Benjamin Drung [Thu, 30 Oct 2025 11:53:27 +0000 (12:53 +0100)] 
fix(Makefile): correct filter condition for s390 specific modules

Commit fe6c47025516fe9705fa0fb621b381ce85d5127c ("feat(Makefile): filter
out s390 specific dracut modules") want to exclude s390 specific dracut
modules but got the condition inversed.

8 days agofix(Makefile): correct loop variable
Benjamin Drung [Thu, 30 Oct 2025 11:53:09 +0000 (12:53 +0100)] 
fix(Makefile): correct loop variable

8 days agofeat: dracut.sh: try $STRIP for $strip_cmd first
Koen Kooi [Thu, 19 Jun 2025 14:06:14 +0000 (16:06 +0200)] 
feat: dracut.sh: try $STRIP for $strip_cmd first

When using dracut in a cross enviroment, like OpenEmbedded, the host
provided strip (or eu-strip) won't work, so try using the $STRIP
variable from the shell environment first before falling back to path
based lookups.

Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com>
8 days agoci(debian): drop V=2
Benjamin Drung [Wed, 29 Oct 2025 19:37:46 +0000 (20:37 +0100)] 
ci(debian): drop V=2

Running the tests in verbose mode `V=2` prints too much information and
makes debugging harder (to find the actual useful information).

8 days agorefactor(test): introduce build_ext4_image function
Benjamin Drung [Thu, 30 Oct 2025 11:14:06 +0000 (12:14 +0100)] 
refactor(test): introduce build_ext4_image function

Building an ext4 rootfs image from a directory is done in multiple test
cases. Move those code into a single `build_ext4_image` helper function
to reduce code duplication.

8 days agotest: drop do_hardlink=no from test-makeroot and test-root
Benjamin Drung [Wed, 29 Oct 2025 16:08:07 +0000 (17:08 +0100)] 
test: drop do_hardlink=no from test-makeroot and test-root

TEST-60-NFS fails booting `initramfs.makeroot` on Ubuntu resolute:

```
[    2.147915] Kernel panic - not syncing: System is deadlocked on memory
```

The virtual machine has only 1 GB memory. The `initramfs.makeroot` is
601 MB in size. Over half of that size can be explained by using rust
coreutils in combination with `do_hardlink=no`:

```
$ 3cpio -tv initramfs.makeroot
[...]
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/cat
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/ln
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/ls
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/mkdir
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/mkfifo
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/mknod
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/readlink
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/sleep
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/sync
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/tr
-rwxr-xr-x   1 root     root     10828088 Sep 24 15:36 usr/lib/cargo/bin/coreutils/uname
```

The coreutils binary is 10 MB in size and duplicated 11 times plus the
same for `source` and `source/nfs/client`. Resulting in 357 MB.

Using `do_hardlink=yes` will reduce the initrd size from 601 MB to
123 MB. So drop `do_hardlink=no` from the `test-makeroot` and
`test-root` configuration files.

8 days agofeat(skipcpio): output additional CPIO information
Flos Lonicerae [Sat, 11 Oct 2025 17:45:47 +0000 (01:45 +0800)] 
feat(skipcpio): output additional CPIO information

Provides additional CPIO information to skipcpio, allowing users to
better understand the composition of the split file. To display the
results we'll use an environment variable 'DEBUG_SKIPCPIO' as a switch.

8 days agofix(base): set udev log level properly
turret [Sun, 26 Oct 2025 22:56:44 +0000 (17:56 -0500)] 
fix(base): set udev log level properly

since udev logging functionality was added in af67d62 to dracut,
in commit 25e773eeb4 in systemd, udev has since migrated from its own
logging system to the logging system found in the rest of systemd, which
uses a different environment variable for setting the log level.  this
will allow for systems to truely be quiet during boot (i.e., before
showing a splash or before the init system begins being loud)

instead of using the systemd-specific environment variable, we set it in
udev.conf so that the change also applies to eudev-and-friends

hilariously, udev did the migration the day after dracut added support!
if systems were kept up to date with live branches, that means the
original change would have only worked for one day.

Signed-off-by: Mason Rocha <mrocha@turretllc.us>
9 days agofix(network-manager): hostname not set with old systemd service units
Antonio Alvarez Feijoo [Mon, 6 Oct 2025 15:41:08 +0000 (17:41 +0200)] 
fix(network-manager): hostname not set with old systemd service units

Commit 83dffc58f606ad7ad47a32716ce240831d7f018f added support for using the new
systemd services provided by NetworkManager upstream if available, instead of
the old custom systemd services provided by dracut. Specifically,
`NetworkManager-config-initrd.service` sets /proc/sys/kernel/hostname if needed,
that's why the old code doing this in the initqueue hook `nm-run.sh` was
moved by mistake to the section that is executed when systemd is not present.

Fixes #1743

9 days 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.

9 days 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>
9 days 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.

9 days 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.

9 days 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`.

9 days 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.

9 days 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).

9 days 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.

9 days 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
```

9 days 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`.

9 days 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.

9 days 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`.

9 days 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
9 days 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.

9 days 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.

9 days 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.

9 days 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.

9 days 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.

9 days 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.

9 days 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

9 days 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.

2 weeks 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

4 weeks 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 .

4 weeks 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.

4 weeks 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.

5 weeks 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.

5 weeks 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")
5 weeks 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"`.

5 weeks 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")
5 weeks 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")
5 weeks 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.

5 weeks 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).

5 weeks 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.

5 weeks 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.

5 weeks 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
5 weeks 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.

5 weeks 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.

5 weeks 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
5 weeks 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

5 weeks 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.

5 weeks 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 .

5 weeks 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
5 weeks 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.

5 weeks 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.

5 weeks 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.

5 weeks 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.

5 weeks 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.

5 weeks 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.

5 weeks 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.

5 weeks 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`.

5 weeks 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.

5 weeks 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

5 weeks 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'
```

5 weeks 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

6 weeks 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.

6 weeks 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").

6 weeks 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`.

6 weeks 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
6 weeks 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
6 weeks 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.

6 weeks 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.

6 weeks 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.

6 weeks 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 .

6 weeks 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.

6 weeks 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.

6 weeks 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.

6 weeks 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.