]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
5 months agoci: enable arm64 tests on Gentoo container
Jo Zzsi [Fri, 28 Nov 2025 15:05:30 +0000 (10:05 -0500)] 
ci: enable arm64 tests on Gentoo container

Gentoo container now supports arm64. Enable running tests on this
CI container as well.

5 months agoci: unskip passing tests
Jo Zzsi [Fri, 28 Nov 2025 13:54:51 +0000 (08:54 -0500)] 
ci: unskip passing tests

After 5e0f6c5 some additional tests are now passing.

Unskip them.

5 months agoci: revert installing btrfs-progs in the CentOS container
Jo Zzsi [Fri, 28 Nov 2025 15:01:06 +0000 (10:01 -0500)] 
ci: revert installing btrfs-progs in the CentOS container

Revert 29917ea and leave a comment that CentOS kernel does
not include btrfs kernel module.

5 months agoci(gentoo): use emerge-webrsync to fetch the initial snapshot
Jo Zzsi [Fri, 28 Nov 2025 12:36:30 +0000 (07:36 -0500)] 
ci(gentoo): use emerge-webrsync to fetch the initial snapshot

Change the approach for computing the Gentoo container to support
arm64 as well.

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

5 months agofeat: remove unused and undocumented argument
Jo Zzsi [Fri, 28 Nov 2025 03:45:18 +0000 (22:45 -0500)] 
feat: remove unused and undocumented argument

-m argument for require_binaries, require_any_binaries and
require_kernel_modules functions are unused.

Remove these arguments before publicly documenting these functions.

5 months agoci: install btrfs-progs in the CentOS container
Jo Zzsi [Fri, 28 Nov 2025 13:41:13 +0000 (08:41 -0500)] 
ci: install btrfs-progs in the CentOS container

Install btrfs-progs in the CentOS container because it is needed for
TEST-11-USR-MOUNT.

5 months agoci(arm64): enable more tests on arm64
Jo Zzsi [Fri, 28 Nov 2025 02:35:57 +0000 (21:35 -0500)] 
ci(arm64): enable more tests on arm64

Now that test cases improved recently, enable more tests on arm64
and exclude the failing tests explicitly.

5 months agoci: install 3cpio in the Arch and Fedora containers
Jo Zzsi [Fri, 28 Nov 2025 12:49:37 +0000 (07:49 -0500)] 
ci: install 3cpio in the Arch and Fedora containers

Install 3cpio in the Arch and Fedora containers to increase
test coverage for 3cpio beyond just Debian based distributions.

5 months agoci: install cargo in the Alpine container
Jo Zzsi [Fri, 28 Nov 2025 12:58:41 +0000 (07:58 -0500)] 
ci: install cargo in the Alpine container

Install cargo in the Alpine container because it is needed for
TEST-82-DRACUT-CPIO.

6 months agoci: fix GA group name
Jo Zzsi [Thu, 27 Nov 2025 19:19:51 +0000 (14:19 -0500)] 
ci: fix GA group name

The group name should be unique for the project.

Follow-up to fb15792.

6 months agoci(arm64): create a separate job for systemd tests
Jo Zzsi [Thu, 27 Nov 2025 18:54:04 +0000 (13:54 -0500)] 
ci(arm64): create a separate job for systemd tests

Do not attempt to run systemd tests on non-systemd enabled
environment.

Follow-up to fb15792.

6 months agoci(gentoo): minimize packages between OpenRC and systemd
Jo Zzsi [Thu, 27 Nov 2025 18:31:37 +0000 (13:31 -0500)] 
ci(gentoo): minimize packages between OpenRC and systemd

The goal is to increase test coverage and while keeping the CI
maintenance low.

Instead of having two lists of packages, lets keep the systemd-only
package list to the minimum.

6 months agoci: explicitly skip tests are not meant to be supported
Jo Zzsi [Thu, 27 Nov 2025 13:15:32 +0000 (08:15 -0500)] 
ci: explicitly skip tests are not meant to be supported

The motivation of this commit is to not run tests on the CI
that would be skipped. This saves some CI resources and
enables to get back to restore green CI, now that
skipped tests are reported as failures after f120814.

This PR does not change code coverage. This is simply
a different and more efficient way to skip tests on the CI.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1886
6 months agoci: create a separate job for systemd tests
Jo Zzsi [Thu, 27 Nov 2025 12:35:06 +0000 (07:35 -0500)] 
ci: create a separate job for systemd tests

Do not attempt to run systemd tests on non-systemd enabled
environment.

6 months agotest: print end of client tests even in failure case
Benjamin Drung [Thu, 27 Nov 2025 01:48:26 +0000 (02:48 +0100)] 
test: print end of client tests even in failure case

If client tests started and failed with a command failing, the test will
exit and the ERR trap will execute `print_test_result`. But the client
test end will not be printed.

So call `client_test_end` in `print_test_result` to print a client test
end result in case a client test was in progress.

6 months agorefactor: introduce client_test_start/client_test_end
Benjamin Drung [Thu, 27 Nov 2025 01:42:20 +0000 (02:42 +0100)] 
refactor: introduce client_test_start/client_test_end

Introduce the functions `client_test_start` and `client_test_end` to
unify the start and end of subtests.

6 months agoci: install more packages for gentoo:amd64-openrc
Jo Zzsi [Thu, 27 Nov 2025 14:01:44 +0000 (09:01 -0500)] 
ci: install more packages for gentoo:amd64-openrc

Increase test coverage for gentoo:amd64-openrc by installing
more dependencies into the test container.

This change should enable running btrfs dependent (e.g. USR-MOUNT)
and squashfs dependent (e.g. DMSQUASH) tests.

6 months agotest: exit with code 77 if test is skipped
Benjamin Drung [Wed, 26 Nov 2025 15:17:16 +0000 (16:17 +0100)] 
test: exit with code 77 if test is skipped

Exiting tests that are skipped with exit code 0 will hide that the test
environment probably miss some tools. That can reduce the test coverage
without anybody noting it.

Therefore exit tests that are skipped with exit code 77. In case tests
are intentionally expected to be skipped, an environment variable could
be introduce to exit with code 0 again.

6 months agoci: install xfsprogs in all containers
Benjamin Drung [Wed, 26 Nov 2025 14:20:51 +0000 (15:20 +0100)] 
ci: install xfsprogs in all containers

Install xfsprogs in all containers because it is needed for
TEST-44-DRIVERS.

6 months agotest: poweroff with systemd if available
Benjamin Drung [Wed, 26 Nov 2025 13:37:57 +0000 (14:37 +0100)] 
test: poweroff with systemd if available

Use the same poweroff code from `modules.d/70test-root/test-init.sh` in
all test cases.

6 months agotest: do not keep the initramfs.testing artefacts by default
Benjamin Drung [Wed, 26 Nov 2025 12:12:15 +0000 (13:12 +0100)] 
test: do not keep the initramfs.testing artefacts by default

Calling dracut with `--keep` is not needed for initramfs.testing in most
cases.

6 months agotest: use truncate instead of dd if=/dev/zero
Benjamin Drung [Wed, 26 Nov 2025 13:08:17 +0000 (14:08 +0100)] 
test: use truncate instead of dd if=/dev/zero

Use `truncate` to create sparse files.

6 months agotest: drop explicitly checking exit code
Benjamin Drung [Wed, 26 Nov 2025 13:24:38 +0000 (14:24 +0100)] 
test: drop explicitly checking exit code

The tests are run with `set -e`. So the test will exit in case of a
failure and `$?` will always be `0`. So drop the check for `$?`.

6 months agofix(dracut-install): build with -Werror=discarded-qualifiers
Antonio Alvarez Feijoo [Wed, 26 Nov 2025 09:53:30 +0000 (10:53 +0100)] 
fix(dracut-install): build with -Werror=discarded-qualifiers

```
src/install/dracut-install.c:475:11: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  475 |         q = strstr(lib, ".so.");
```

- `q` cannot be const, because it's also used for `q = strstr(clib, ".so.");`,
removing the suffix from clib via `q[3] = '\0';`, so create two variables to get
the suffix offsets, one const for `lib`, other non-const for `clib`.

```
src/install/dracut-install.c:2592:11: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
 2592 |         p = strstr(abskpath, "/lib/modules/");
```

- `p` can be const like `abskpath`, since it's not modified.

Fixes #1877

6 months agotest: drop sync calls on host
Benjamin Drung [Wed, 26 Nov 2025 00:08:16 +0000 (01:08 +0100)] 
test: drop sync calls on host

Synchronizing cached writes to persistent storage is not needed for the
test host. So drop those sync calls for faster test execution.

Keep only the sync calls in the scripts that are executed in a virtual
machine (like `create-root.sh` and `client-init.sh`).

6 months agofix(functions): do not use path escapes for non-paths
Jens Schmidt [Sat, 22 Nov 2025 20:15:24 +0000 (21:15 +0100)] 
fix(functions): do not use path escapes for non-paths

Function dev_unit_name unconditionally calls `systemd-escape -p` on the device
argument, even if that is a non-path, for example, a LUKS UUID.
`systemd-escape -p` writes a warning for non-paths, so just use plain
`systemd-escape` for these.

6 months agotest(run-qemu): support UEFI on ARM
Benjamin Drung [Tue, 25 Nov 2025 23:16:43 +0000 (00:16 +0100)] 
test(run-qemu): support UEFI on ARM

The OVMF firmware files are builds of EDK II for 64-bit x86 virtual
machines. They do not work on other architectures.

So search for AAVMF files on ARM. Remove the `cfi.pflash01` driver
setting because it does not work on Ubuntu arm64 and `readonly=on` is
already set for the firmware file.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1861
6 months agotest: use UEFI for QEMU when available
Benjamin Drung [Tue, 25 Nov 2025 23:15:33 +0000 (00:15 +0100)] 
test: use UEFI for QEMU when available

Move the `ovmf_code` function and related code to `run-qemu` and always
use UEFI when available. This is a preperation for the following commit.

6 months agotest: determine rootfs size dynamically
Benjamin Drung [Sat, 8 Nov 2025 13:54:43 +0000 (14:54 +0100)] 
test: determine rootfs size dynamically

Do not hard-code the size of the rootfs, but determine the needed size
dynamically. This will speed up the creation time for smaller content
and prevent failures in case of bigger content.

6 months agochore(deps): bump actions/checkout from 5 to 6
dependabot[bot] [Tue, 25 Nov 2025 20:03:16 +0000 (20:03 +0000)] 
chore(deps): bump actions/checkout from 5 to 6

Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

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

Signed-off-by: dependabot[bot] <support@github.com>
6 months agotest(cpio): add test_archive_major_minor
David Disseldorp [Wed, 8 Oct 2025 03:59:42 +0000 (05:59 +0200)] 
test(cpio): add test_archive_major_minor

Inode numbers are unique (for non-hardlinks) within the archive, so
device ID mapping is unnecessary. Confirm that dracut-cpio behaves like
GNU cpio --ignore-devno. Check this by archiving the /tmp directory
alongside a working-directory nested file; despite differing source
device IDs, the archived major/minor numbers should be zero.

The test is skipped if stat(/tmp) fails, or working-directory and /tmp
device ids match.

6 months agofeat(cpio): zero device major/minor numbers
David Disseldorp [Wed, 8 Oct 2025 00:59:57 +0000 (02:59 +0200)] 
feat(cpio): zero device major/minor numbers

initramfs / cpio allow for the tracking of hardlinks for nlink >= 2
entries using a combination of the inode, device major and minor
numbers.

dracut-cpio uses unique inode numbers within an archive via the global
state.ino counter. Device major/minor numbers are also renumbered, with
each unique source device obtaining a major/minor number mapped from the
index within dev_seen()/DevState array.

With archive-unique inode numbers, device major/minor mapping is
unnecessary. This change sees dracut-cpio behave the same as GNU
cpio --ignore-devno, where archive device major/minor numbers are
hardcoded to zero.

Hardlink tracking is simplified, replacing per-device HardlinkState
arrays with a global state.hls array. A hash could be used for faster
source inode+dev -> archive HardlinkState mapping, but the extra
size and complexity isn't worth it IMO, given that hardlinks should be
rare.

6 months agofix(cpio): archive correct minor numbers
David Disseldorp [Tue, 7 Oct 2025 09:52:05 +0000 (11:52 +0200)] 
fix(cpio): archive correct minor numbers

A typo that I made in the initial dracut-cpio implementation sees the
stat()-dev_t-derived major number used for both major and minor number
in the cpio archive.

This bug shouldn't cause any real-world issues, as archive-renumbered
inode numbers are already unique and hardlink tracking checks against
the proper dev_t tuple.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1749
6 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.

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

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

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

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

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