]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
5 months agochore: call inst_multiple instead of the dracut_install wrapper
Jo Zzsi [Sun, 23 Nov 2025 02:08:40 +0000 (21:08 -0500)] 
chore: call inst_multiple instead of the dracut_install wrapper

dracut_install is no longer preferred. In almost all call sites
inst_multiple is called directly instead of the dracut_install wrapper.

Call inst_multiple directly for better readability, consistency and
possibly slightly faster perf.

5 months agotest: replace rev command by sed
Benjamin Drung [Tue, 18 Nov 2025 18:34:52 +0000 (19:34 +0100)] 
test: replace rev command by sed

On Debian-based systems, the `rev` command is shipped by the
bsdextrautils package. Replace the `rev` command by `sed` which is an
essential command and does not need additional packages.

5 months agotest(run-qemu): include name in error messages
Benjamin Drung [Tue, 18 Nov 2025 10:27:02 +0000 (11:27 +0100)] 
test(run-qemu): include name in error messages

To ease debugging include the name of the `run-qemu` script in the error
messages.

5 months agotest: forward journald logs to console in V=1 or V=2
Benjamin Drung [Tue, 18 Nov 2025 18:44:04 +0000 (19:44 +0100)] 
test: forward journald logs to console in V=1 or V=2

To ease debugging, forward systemd journald logs to console when `V=1`
or `V=2` is set.

5 months agoci(fedora): install diffutils
Benjamin Drung [Sun, 23 Nov 2025 08:31:42 +0000 (09:31 +0100)] 
ci(fedora): install diffutils

The test 81 needs the `diff` command which is provided by the diffutils
package on Fedora. Otherwise the test 81 is skipped on Fedora.

6 months agofix(Makefile): correct path for man pages for service files
Jo Zzsi [Sat, 22 Nov 2025 17:03:38 +0000 (12:03 -0500)] 
fix(Makefile): correct path for man pages for service files

The man pages for service files are installed to the man8
directory, so delete them from there.

6 months agofeat(network-manager): add systemd generator if available
Antonio Alvarez Feijoo [Fri, 21 Nov 2025 07:36:03 +0000 (08:36 +0100)] 
feat(network-manager): add systemd generator if available

A systemd generator was added in [1] to fix an upstream issue [2]. It also
brings the removal of the "[Install]" section from the upstream initrd services;
it is used to mask the initrd services on the host, and to mask the host
services and provide installation links of the initrd services in the initrd.

Additionally, increase the minimum NetworkManager version set to remove custom
systemd services from dracut.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/636fb5ef24640856515584977174fa44a986e374
[2] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1814

6 months agotest: set console cmdline depending on the architecture
Benjamin Drung [Wed, 19 Nov 2025 03:28:38 +0000 (04:28 +0100)] 
test: set console cmdline depending on the architecture

The QEMU process hangs (without printing anything) on some Debian/Ubuntu
architectures. This is caused by the console device is called
differently on those architectures.

So move setting `console` to `run-qemu` and set it to `ttyAMA0` on ARM
systems and to `hvc0` on ppc64el.

6 months agotest(run-qemu): include $@ in ARGS array
Benjamin Drung [Wed, 19 Nov 2025 03:20:39 +0000 (04:20 +0100)] 
test(run-qemu): include $@ in ARGS array

To simplify the code and as preparation for the following commit,
include `$@` in the `ARGS` array.

6 months agotest(run-qemu): do not expect -initrd as first parameter
Benjamin Drung [Wed, 19 Nov 2025 03:14:28 +0000 (04:14 +0100)] 
test(run-qemu): do not expect -initrd as first parameter

Check all parameters for `-initrd` instead of expecting it to be the
first parameter.

6 months agofix(systemd-networkd): install and enable systemd-networkd-resolve-hook.socket
Luca Boccassi [Tue, 18 Nov 2025 19:30:30 +0000 (19:30 +0000)] 
fix(systemd-networkd): install and enable systemd-networkd-resolve-hook.socket

New socket needed for v259~rc1, networkd fails if this is not installed
and enabled

6 months agorefactor: introduce create_cpio_* helper functions
Benjamin Drung [Tue, 11 Nov 2025 20:39:20 +0000 (21:39 +0100)] 
refactor: introduce create_cpio_* helper functions

To make the dracut code more reabable and to allow introducing local
variables, move the cpio creation code into helper functions.

6 months agofix(dracut): shellcheck SC2086
Jo Zzsi [Tue, 11 Nov 2025 23:10:57 +0000 (18:10 -0500)] 
fix(dracut): shellcheck SC2086

Fix shellcheck SC2086 error reports.

6 months agofix(nfs): set the default group of the rpcbind user to the state dir
Antonio Alvarez Feijoo [Wed, 12 Nov 2025 13:22:29 +0000 (14:22 +0100)] 
fix(nfs): set the default group of the rpcbind user to the state dir

Commit 4a236f015905f598e2976ae6f0f460ec9a567f2b sets the fixed "root" group to
`/run/rpcbind`, but it can be different depending on the distribution (for
example, `rpc` in openSUSE and Fedora).

Fixes 4a236f015905f598e2976ae6f0f460ec9a567f2b

6 months agoperf(nfs): remove references to old rpcbind state dir
Antonio Alvarez Feijoo [Wed, 12 Nov 2025 11:40:39 +0000 (12:40 +0100)] 
perf(nfs): remove references to old rpcbind state dir

The default state directory (needed by `rpcbind` to save warm start info) was
initially `/tmp`, but it can be configured with `--with-statedir=` since [1].
This default state directory changed to a more appropriate `/var/run` [2], and
then explicitly to `/run` [3].

So, `/var/lib/rpcbind` existed when this dracut module was created because RH/
Fedora had it configured with `--with-statedir=`, like openSUSE until 2016 [4]

[1] https://git.linux-nfs.org/?p=steved/rpcbind.git;a=commitdiff;h=9b1aaa62d44515fa97bc62c00d3eae6c6c3e3c3d
[2] https://git.linux-nfs.org/?p=steved/rpcbind.git;a=commitdiff;h=2e78e6fb51292fea798355e5cb749dbc1de26ca6
[3] https://git.linux-nfs.org/?p=steved/rpcbind.git;a=commitdiff;h=fd1d5387de8078530d51eccf876afe6e6182b975
[4] https://build.opensuse.org/requests/440204/changes

6 months agoci: use GNU coreutils instead of uutil's coreutils
Benjamin Drung [Mon, 17 Nov 2025 22:01:41 +0000 (23:01 +0100)] 
ci: use GNU coreutils instead of uutil's coreutils

Tests start to fail on Ubuntu resolute due to rust-coreutils 0.3.0:

```
dd: IO error: Invalid input
```

Use GNU coreutils instead of uutil's coreutils until
https://github.com/uutils/coreutils/issues/9057 and
https://launchpad.net/bugs/2129037 are fixed.

6 months agorefactor: change TimeoutSec=0 to TimeoutSec=infinity
Antonio Alvarez Feijoo [Tue, 11 Nov 2025 08:27:03 +0000 (09:27 +0100)] 
refactor: change TimeoutSec=0 to TimeoutSec=infinity

The officially documented way to turn off the timeouts in systemd is setting
them to infinity, 0 is kept as historic compat support.

See https://github.com/systemd/systemd/commit/a9b837aa34a2d0bff1687427c66bed3b74cf0fed

6 months agofeat: add header comment to units created by systemd generators
Antonio Alvarez Feijoo [Tue, 11 Nov 2025 08:48:42 +0000 (09:48 +0100)] 
feat: add header comment to units created by systemd generators

Identify which dracut generator created a particular systemd unit or dropin to
help debug issues.

6 months agorefactor: fold dracut-init.sh into dracut.sh
Jo Zzsi [Mon, 1 Sep 2025 16:50:47 +0000 (12:50 -0400)] 
refactor: fold dracut-init.sh into dracut.sh

dracut-init.sh is only sourced from dracut.sh, so it could be folded
into one file  and open the door for additional optimizations.

6 months agochore(deps): bump github/codeql-action from 3 to 4
dependabot[bot] [Tue, 7 Oct 2025 20:14:26 +0000 (20:14 +0000)] 
chore(deps): bump github/codeql-action from 3 to 4

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agochore(deps): bump actions/upload-artifact from 4 to 5
dependabot[bot] [Tue, 28 Oct 2025 20:03:00 +0000 (20:03 +0000)] 
chore(deps): bump actions/upload-artifact from 4 to 5

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agochore(deps): bump actions/setup-node from 5 to 6
dependabot[bot] [Tue, 14 Oct 2025 20:02:46 +0000 (20:02 +0000)] 
chore(deps): bump actions/setup-node from 5 to 6

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agofix(dracut-systemd): use expected PS1 in the emergency shell
Antonio Alvarez Feijoo [Mon, 10 Nov 2025 15:35:56 +0000 (16:35 +0100)] 
fix(dracut-systemd): use expected PS1 in the emergency shell

Before starting `dracut-emergency.service`, the function `_emergency_shell()`
writes `PS1` to `/etc/profile`. Then `/etc/profile` is sourced in
`dracut-emergency.sh`, but `PS1` is not exported, so the current hook name is
never displayed in the emergency shell. Also, the default name "dracut" is not
printed either in the fallback `PS1`, because the variable `_name` is not set;
it should be `_rdshell_name`.

6 months agofeat: rename rd.live.overlay.overlayfs to rd.overlayfs
Jo Zzsi [Sat, 1 Nov 2025 23:20:42 +0000 (19:20 -0400)] 
feat: rename rd.live.overlay.overlayfs to rd.overlayfs

The overlayfs dracut module can be used without the dmsquash-live
dracut module. This change improves on naming of command line options
with better namespace scoping.

Move overlayfs documentation out of the live images section.

Follow-up to 40dd5c90e.

6 months agofix(plymouth): avoid warning if /etc/plymouth/plymouthd.conf is not present
Antonio Alvarez Feijoo [Mon, 10 Nov 2025 15:54:52 +0000 (16:54 +0100)] 
fix(plymouth): avoid warning if /etc/plymouth/plymouthd.conf is not present

openSUSE does not install /etc/plymouth/plymouthd.conf, so plymouthd falls back
to /usr/share/plymouth/plymouthd.defaults

```
$ dracut -f
sed: can't read /etc/plymouth/plymouthd.conf: No such file or directory
```

Follow-up for 7f41458b9d8350d08b0057e050d98b7a25c3e640

6 months agofix(dracut-init): do not set DRACUT_KERNEL_MODALIASES for --no-kernel
Jo Zzsi [Sat, 1 Nov 2025 22:25:42 +0000 (18:25 -0400)] 
fix(dracut-init): do not set DRACUT_KERNEL_MODALIASES for --no-kernel

When dracut is invoked with --no-kernel, do not set DRACUT_KERNEL_MODALIASES
to avoid using kmod.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/691
6 months agofix(dracut.conf.d): demote uki-virt to CI only
Jo Zzsi [Thu, 6 Nov 2025 13:00:45 +0000 (08:00 -0500)] 
fix(dracut.conf.d): demote uki-virt to CI only

Configurations under dracut.conf.d meant to be shared
and packaged by distributions.

It is unlikely that uki-virt can be commonly agreed
upon by most distributions, so let's demote it to be a
test case only file.

6 months agofeat(tpm2-tss): add openSUSE support
Antonio Alvarez Feijoo [Wed, 5 Nov 2025 10:17:31 +0000 (11:17 +0100)] 
feat(tpm2-tss): add openSUSE support

- system-user-tss installs /usr/lib/sysusers.d/system-user-tss.conf
- tpm2-0-tss installs /usr/lib/udev/rules.d/90-tpm.rules

6 months agofeat(pcsc): add openSUSE support
Antonio Alvarez Feijoo [Fri, 2 May 2025 09:59:22 +0000 (11:59 +0200)] 
feat(pcsc): add openSUSE support

The openSUSE version of the opensc package installs the module configuration in
/etc/pkcs11/modules/opensc.module

6 months agotest: do not use dsync oflag for dd calls
Jo Zzsi [Sat, 1 Nov 2025 12:22:02 +0000 (08:22 -0400)] 
test: do not use dsync oflag for dd calls

dsync oflag is not supported by all dd implementation.
As an example busybox does not support dsync.

6 months agodocs: update NEWS.md and AUTHORS for release 109 109
dracutng[bot] [Mon, 3 Nov 2025 22:19:35 +0000 (22:19 +0000)] 
docs: update NEWS.md and AUTHORS for release 109

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

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

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

6 months 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

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

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

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

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

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

6 months 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>
6 months 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
6 months 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

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

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

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

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

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

6 months 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>
6 months 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).

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

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

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

6 months 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>
6 months 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

6 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

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

7 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

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

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

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

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

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

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

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

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

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

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

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