]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
15 hours agodocs: update NEWS.md and AUTHORS for release 110 main 110
Neal Gompa [Mon, 9 Feb 2026 00:24:32 +0000 (19:24 -0500)] 
docs: update NEWS.md and AUTHORS for release 110

17 hours agofix(release): use correct argument for head(1) to split header out
Neal Gompa [Sun, 8 Feb 2026 21:49:24 +0000 (16:49 -0500)] 
fix(release): use correct argument for head(1) to split header out

We actually want it to take the top two lines for identifying the header.

Fixes: 77c0d5774b ("fix(release): use correct arguments for head(1) and tail(1) calls")
18 hours agofix(release): use the correct variable to set the new project version
Neal Gompa [Sun, 8 Feb 2026 20:58:49 +0000 (15:58 -0500)] 
fix(release): use the correct variable to set the new project version

The DRACUT_FULL_VERSION variable does not exist, and the intent was
to update it in place with the generated higher version number in
the script.

Fixes: d5e985d40e ("feat: move DRACUT_VERSION from dracut-version.sh into dracut.sh")
18 hours agofix(release): use correct arguments for head(1) and tail(1) calls
Neal Gompa [Sun, 8 Feb 2026 20:57:09 +0000 (15:57 -0500)] 
fix(release): use correct arguments for head(1) and tail(1) calls

This ensures that the NEWS fragments can be produced correctly.

19 hours agofix(release): only install clog-cli if it isn't already installed
Neal Gompa [Sun, 8 Feb 2026 20:34:20 +0000 (15:34 -0500)] 
fix(release): only install clog-cli if it isn't already installed

That way, it does not uselessly run when it is already present.

19 hours agochore(base): remove support for /dev/.initramfs
Jo Zzsi [Sun, 8 Feb 2026 15:35:58 +0000 (10:35 -0500)] 
chore(base): remove support for /dev/.initramfs

/dev/.initramfs was a fallback when /run is not available.

This commit removes this legacy fallback support, which was only
available in a non-systemd enviroment.

Follow-up to dbad9f466 .

19 hours agochore(qemu): move is_qemu_virtualized to qemu dracut module
Jo Zzsi [Sun, 8 Feb 2026 14:50:08 +0000 (09:50 -0500)] 
chore(qemu): move is_qemu_virtualized to qemu dracut module

Moving the is_qemu_virtualized function to qemu dracut module makes
the code more modular and dracut.sh smaller.

This change also enabled to remove the shellcheck exception.

19 hours agochore: remove redundant call to is_qemu_virtualized
Jo Zzsi [Sun, 8 Feb 2026 14:46:49 +0000 (09:46 -0500)] 
chore: remove redundant call to is_qemu_virtualized

The qemu dracut module check function already calls is_qemu_virtualized
to determine the enviroment dracut is called in.

Checking if the qemu dracut module is included already transitively calls
is_qemu_virtualized.

26 hours agofeat(virtfs, virtiofs): auto-add dracut module if qemu included
Jo Zzsi [Sat, 7 Feb 2026 22:53:07 +0000 (17:53 -0500)] 
feat(virtfs, virtiofs): auto-add dracut module if qemu included

If qemu dracut module included than automatically include
virtfs and virtiofs dracut modules as well unless
hostonly_mode is set to "strict".

Tested with the following dracut invocation (invoked
from a non-virtualized host).

`dracut --hostonly-mode sloppy -add qemu`

26 hours agochore(dmsquash-live): remove support for ext3fs.img
Jo Zzsi [Sun, 8 Feb 2026 03:02:02 +0000 (22:02 -0500)] 
chore(dmsquash-live): remove support for ext3fs.img

All dracut based live iso's use either squashfs.img (compressed live)
or rootfs.img (uncompressed live).

Remove support for ext3fs.img.

Follow-up to fe17f4e (from 2011) .

31 hours agotest(ISCSI-MULTI): remove including /etc/nbd-server/config
Benjamin Drung [Sun, 8 Feb 2026 04:04:54 +0000 (05:04 +0100)] 
test(ISCSI-MULTI): remove including /etc/nbd-server/config

The test 71 is about iSCSI and has nothing to do with NBD. There is no
`/tmp/config`.

So do not try to include it in the initrd.

31 hours agoci: enable daily-systemd on ubuntu:devel-arm
Benjamin Drung [Sat, 7 Feb 2026 23:11:12 +0000 (00:11 +0100)] 
ci: enable daily-systemd on ubuntu:devel-arm

https://launchpad.net/bugs/2133402 has been fixed on the Ubuntu devel
release. linux 6.19.0-3.3 contains the fixed stubble.

38 hours agofix(base): ensure that /run survives switch_root
Jo Zzsi [Sat, 7 Feb 2026 20:10:48 +0000 (15:10 -0500)] 
fix(base): ensure that /run survives switch_root

Ensure /run survives switch_root not only systemd enabled initramfs,
but initramfs without systemd.

This change makes systemd and non-systemd initramfs behaves similarly.

This change also enables the newly added test case for hooks to pass
on the busybox CI container.

This PR has no impact on systemd enabled initramfs.

38 hours agoci: also run container manifest step for by workflow_dispatch
Benjamin Drung [Sun, 8 Feb 2026 01:01:53 +0000 (02:01 +0100)] 
ci: also run container manifest step for by workflow_dispatch

The container CI jobs might be run manually (using the
`workflow_dispatch` trigger). In this case the `manifest` step is
skipped. This makes manually runnings the container job useless.

Also run the container manifest step for `workflow_dispatch`.

39 hours agotest: introduce make_test_rootfs
Benjamin Drung [Sat, 7 Feb 2026 22:58:52 +0000 (23:58 +0100)] 
test: introduce make_test_rootfs

Test 72 NBD has the helper functions `make_client_rootfs` and
`make_server_rootfs` which makes the test easier to read.

Introduce `make_test_rootfs` for the simpler tests (where there are no
client/server).

39 hours agotest: introduce make_client_rootfs/make_server_rootfs
Benjamin Drung [Sat, 7 Feb 2026 22:57:44 +0000 (23:57 +0100)] 
test: introduce make_client_rootfs/make_server_rootfs

Test 72 NBD has the helper functions `make_client_rootfs` and
`make_server_rootfs` which makes the test easier to read.

Refactor the other tests and introduce the helper functions
`make_client_rootfs` and `make_server_rootfs` there as well.

39 hours agotest: rename *_root to *_rootfs
Benjamin Drung [Sat, 7 Feb 2026 22:56:14 +0000 (23:56 +0100)] 
test: rename *_root to *_rootfs

Rename the `*_root` functions to `*_rootfs` since those functions build
root file systems.

39 hours agotest: do not require pkg-config
Benjamin Drung [Sat, 7 Feb 2026 21:58:04 +0000 (22:58 +0100)] 
test: do not require pkg-config

The command `pkg-config` might not be installed in the test environment
(for example on Debian autopkgest).

Replace calling `pkg-config` by calling `systemctl --version`.

40 hours agodocs: convert maintainer list into a table
Benjamin Drung [Sat, 7 Feb 2026 18:42:42 +0000 (19:42 +0100)] 
docs: convert maintainer list into a table

Convert maintainer list into a table and add a GitHub profile column.

2 days agotest: rename overlay directory to rootfs
Benjamin Drung [Sat, 7 Feb 2026 13:26:29 +0000 (14:26 +0100)] 
test: rename overlay directory to rootfs

Several tests use `build_ext4_image` to generate a rootfs and do not
rely on `test-makeroot` any more (where the `overlay` directory name was
used).

To make the test code more readable, rename the `overlay` directory to
`rootfs`. In case there are client and server rootfs, use
`client-rootfs` and `server-rootfs`.

2 days agoci: install diffutils on openSUSE container
Benjamin Drung [Sat, 7 Feb 2026 13:35:45 +0000 (14:35 +0100)] 
ci: install diffutils on openSUSE container

The test 81 needs the `diff` command and a recent openSUSE container
does not include it any more.

So explicitly install `diffutils`.

2 days agotest: always call sync before poweroff -f
Benjamin Drung [Sat, 7 Feb 2026 12:19:37 +0000 (13:19 +0100)] 
test: always call sync before poweroff -f

To be on the safe side, call `sync` before calling `poweroff -f` after
creating client rootfs in a virtual machine.

2 days agotest: remove duplicate overlay removal
Benjamin Drung [Sat, 7 Feb 2026 12:31:44 +0000 (13:31 +0100)] 
test: remove duplicate overlay removal

Removing `overlay` is done twice. Remove those duplicate calls.

2 days agotest: prevent overlay/source being added in test_dracut
Benjamin Drung [Fri, 6 Feb 2026 23:53:44 +0000 (00:53 +0100)] 
test: prevent overlay/source being added in test_dracut

The function `test_dracut()` will include `$TESTDIR/overlay` into the
test `initramfs.testing` if available. Several tests create
`$TESTDIR/overlay/source` for creating rootfs using `test-makeroot`.

Delete `$TESTDIR/overlay` after being used by `test-makeroot` to avoid
adding `$TESTDIR/overlay/source` to the client test initrd.

2 days agotest: stop mdadm after creating client rootfs
Benjamin Drung [Fri, 6 Feb 2026 22:57:41 +0000 (23:57 +0100)] 
test: stop mdadm after creating client rootfs

To be on the safe side, stop mdadm after creating client rootfs in the
iSCSI tests 70 and 71 (similar to `create-root.sh` in test 26).

2 days agoci: re-run tests 20, 26, 70, and 71 on debian
Benjamin Drung [Fri, 6 Feb 2026 21:49:22 +0000 (22:49 +0100)] 
ci: re-run tests 20, 26, 70, and 71 on debian

mdadm 4.5-2 introduced a regression:

```
++ mdadm --create /dev/md0 --run --level=1 --metadata=0.90 --raid-devices=2 /dev/mapper/dracut_disk1 /dev/mapper/dracut_disk2
mdadm: Can't open /sys/module/md_mod/parameters/legacy_async_del_gendisk
mdadm: init md module parameters fail
```

This regression has been fixed in mdadm 4.5-3.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/2021
2 days agoci: fix wrong indentation in labeler YAML file
Benjamin Drung [Fri, 6 Feb 2026 22:33:14 +0000 (23:33 +0100)] 
ci: fix wrong indentation in labeler YAML file

```
$ yamllint .
./.github/labeler.yml
  563:3     error    wrong indentation: expected 4 but found 2  (indentation)
  564:7     error    wrong indentation: expected 8 but found 6  (indentation)
```

2 days agofix(dracut): also check libraries when resolving lazy
Benjamin Drung [Fri, 6 Feb 2026 22:00:14 +0000 (23:00 +0100)] 
fix(dracut): also check libraries when resolving lazy

Dracut might resolve executable dependencies lazy. In this case all
libraries are installed without resolving their dependencies.

Later Dracut will resolve dependencies of the included executables, but
it will not explicitly check libraries. This will miss resolving
dependencies of libraries that are used via `dlopen()`.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/2193
2 days agodocs: add MAINTAINERS.md
Benjamin Drung [Fri, 6 Feb 2026 14:41:53 +0000 (15:41 +0100)] 
docs: add MAINTAINERS.md

Document who the maintainers are and which GPG they use.

3 days agoci: no need to explicitly add qemu-net anymore
Jo Zzsi [Thu, 5 Feb 2026 14:35:31 +0000 (09:35 -0500)] 
ci: no need to explicitly add qemu-net anymore

Commit 94b21ab enables dracut to automatically detect
when qemu-net is required.

Ensure this condition is covered by CI by removing qemu-net
from the dracut module lists.

3 days agofix(dracut-install): resolve dependencies even if not executable
Benjamin Drung [Fri, 6 Feb 2026 13:59:27 +0000 (14:59 +0100)] 
fix(dracut-install): resolve dependencies even if not executable

Library files on Debian/Ubuntu are not marked as executable. This causes
`dracut-install` to not resolve dependencies:

```
$ ls -l /usr/lib/x86_64-linux-gnu/libarchive.so.13.7.7
-rw-r--r-- 1 root root 874648 Jun 25  2025 /usr/lib/x86_64-linux-gnu/libarchive.so.13.7.7
$ rm -rf foo && mkdir foo
$ ./dracut-install -D foo -l /usr/lib/x86_64-linux-gnu/libarchive.so.13
$ find foo
foo
foo/usr
foo/usr/lib
foo/usr/lib/x86_64-linux-gnu
foo/usr/lib/x86_64-linux-gnu/libarchive.so.13.7.7
foo/usr/lib/x86_64-linux-gnu/libarchive.so.13
```

There is no requirement for library files to be executable. So resolve
dependencies all files. `resolve_deps()` will check if the file is
either an ELF file or a script.

This will also resolve dependencies of scripts that are not marked
executable, which might be an undesired side effect. In this case users
are advised to either call `dracut-install` without `-l` or not include
those files at all.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/2193
3 days agochore(dracut): switch to /usr/lib from /lib for hooks
Vitaly Kuznetsov [Thu, 5 Feb 2026 08:11:48 +0000 (09:11 +0100)] 
chore(dracut): switch to /usr/lib from /lib for hooks

The current tendency is to move towards "hermetic /usr" and not
introduce new things outside of it. For distro shipped hooks and
for the testsuite move the location from /lib to /usr/lib.

No (real) functional change intended.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
4 days agofix(overlayfs): make overlayfs-lib.sh executable
Benjamin Drung [Thu, 5 Feb 2026 15:31:02 +0000 (16:31 +0100)] 
fix(overlayfs): make overlayfs-lib.sh executable

lintian complains:

```
W: dracut-core: script-not-executable [usr/lib/dracut/modules.d/70overlayfs/overlayfs-lib.sh]
```

4 days agofix: avoid leading spaces in systemd units
Benjamin Drung [Tue, 3 Feb 2026 21:24:46 +0000 (22:24 +0100)] 
fix: avoid leading spaces in systemd units

Some `sed` commands insert multiple lines into systemd units. Using
backslash followed by a newline and spaces (for indentation) will
include those spaces in the systemd unit.

Use `\n` instead to remove those leading spaces.

4 days agodocs: document dracut_rescue_image
Jo Zzsi [Fri, 23 Jan 2026 22:14:37 +0000 (17:14 -0500)] 
docs: document dracut_rescue_image

Add documentation for the dracut_rescue_image in the dracut.conf
man page.

4 days agofix(systemd-portabled): do not call portablectl
Jo Zzsi [Mon, 22 Sep 2025 22:46:18 +0000 (18:46 -0400)] 
fix(systemd-portabled): do not call portablectl

Drop the portablectl call altogether and stop adding
{/etc,/var,usr}/lib/portables/*.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.

4 days agofeat: memdisk dracut module
Jo Zzsi [Fri, 16 Jan 2026 02:30:16 +0000 (21:30 -0500)] 
feat: memdisk dracut module

Memdisk ISO emulation with the memdiskfind utility of the
syslinux project.

The hook of the memdisk dracut module is based on
https://salsa.debian.org/live-team/live-boot/-/blob/master/components/3050-memdisk.sh .

4 days agofeat(systemd-import): introducing the systemd-import module
Antonio Alvarez Feijoo [Thu, 5 Feb 2026 12:36:08 +0000 (13:36 +0100)] 
feat(systemd-import): introducing the systemd-import module

This new module takes advantage of the features provided by
systemd-import-generator(8), systemd-importd.service(8) and
systemd-loop@.service(8), especifically the `rd.systemd.pull=` kernel command
line option, to download a disk image (tar/raw) into memory, optionally validate
its checksum or signature, and directly boot into it.

It allows to:
- Download a tar disk image into /run/machines and bind mount it into /sysroot
(via `root=bind:...`).
- Download a raw image into memory and attach it to a loopback block device, so
we can point `root=` to a known label or to the proper `/dev/disk/by-loop-ref/`
device.

Notes:
- It needs enough RAM to save and unpack/decompress the image.
- The image can be compressed with xz, gzip, bzip2, zstd.
- It supports btrfs, erofs, ext4, f2fs, squashfs, vfat, or xfs filesystems.

4 days agotest: use mksquashfs -no-progress consistently
Benjamin Drung [Thu, 5 Feb 2026 10:46:25 +0000 (11:46 +0100)] 
test: use mksquashfs -no-progress consistently

`mksquashfs` shows a progress bar by default. Test 12 calls `mksquashfs`
with `-no-progress` to hide the progress bar.

Use this parameter for all test cases that call `mksquashfs`.

4 days agofix(crypt-gpg): support missing /etc/dracut.conf.d
Benjamin Drung [Thu, 5 Feb 2026 11:49:08 +0000 (12:49 +0100)] 
fix(crypt-gpg): support missing /etc/dracut.conf.d

The directory `/etc/dracut.conf.d` might not exist. `crypt-gpg` will
cause this error message (seen on `gentoo:latest` test 10):

```
find: '/etc/dracut.conf.d': No such file or directory
```

Support this case.

4 days agofeat(qemu-net): auto-add qemu-net if net-lib and qemu included
Jo Zzsi [Thu, 15 Jan 2026 19:09:59 +0000 (14:09 -0500)] 
feat(qemu-net): auto-add qemu-net if net-lib and qemu included

In the interest of improving defaults, if net-lib and qemu
dracut modules are included than automatically include
dracut-net dracut modules as well.

I tested with the following dracut invocation

`dracut -a "network qemu"`

4 days agotest(HOOKS): introduce tests for dracut hooks
Vitaly Kuznetsov [Fri, 3 Oct 2025 16:02:45 +0000 (18:02 +0200)] 
test(HOOKS): introduce tests for dracut hooks

Introduce tests for Dracut hooks that mainly checks two things:
- Hooks from all hooks locations: `/var/lib/dracut/hooks`, `/etc/dracut/hooks`,
`/lib/dracut/hooks` execute.
- Hooks with the same name execute from the top priority location.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Tweaked-by: Benjamin Drung <benjamin.drung@canonical.com>
4 days agofeat(dracut): introduce additional hooks locations
Vitaly Kuznetsov [Mon, 6 Oct 2025 14:54:46 +0000 (16:54 +0200)] 
feat(dracut): introduce additional hooks locations

Dracut init supports running custom hooks which are placed to
/var/lib/dracut/hooks/. The location was previously changed to /var
as the place needs to be writeable as some hooks are created and removed
in runtime. The current location, however, may come inconvenient in some
scenarios when the user wants to extend initramfs with custom scripts. In
particular, systemd allows extending initrd with 'sysext' and 'confext'
mechanism. This comes handy for extending e.g. UKI's initramfs without
the need to rebuild (and re-sign) the UKI. The problem is that 'sysext' can
only be used to extend /usr and /opt and 'confext/ can only extend /etc.
Both services make the location read-only and thus can't be used for the
main dracut hooks location even if we move it somewhere.

Add additional locations where users can put dracut hooks:
- /lib/dracut/hooks -- this location is supposed to be used for
  distro-specific static hooks.
- /etc/dracut/hooks -- this location can be used by users for locally
  created hooks.
- /var/lib/dracut/hooks -- the default location which is supposed to be
  used by dracut modules. This location is always writeable so modules
  can place and remove hooks from there in runtime. The existing '$hookdir'
  variable keeps pointing at this place.

Dracut also has support for /var/lib/dracut/hooks/initqueue/work flag and
in theory, it does not have to be in the hooks directory as it is not a
hook. The location, however, is documented and it is not entirely clear
if it would make sense to add support for /lib/dracut/hooks/initqueue/work
and /etc/dracut/hooks/initqueue/work as well: these locations can (and
probably should) be read-only so creating/removing flag there is hard. Keep
the status quo and only support '$hookdir/initqueue/work' for now.

Closes: https://github.com/dracut-ng/dracut-ng/issues/1618
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
4 days agochore(dracut): introduce list_hooks()
Vitaly Kuznetsov [Fri, 26 Sep 2025 15:09:50 +0000 (17:09 +0200)] 
chore(dracut): introduce list_hooks()

In preparation to supporting additional hooks locations, introduce a
function to list matching hooks.

No functional change intended.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
4 days agofeat: merge rd.overlayfs into rd.overlay
Benjamin Drung [Wed, 4 Feb 2026 12:57:19 +0000 (13:57 +0100)] 
feat: merge rd.overlayfs into rd.overlay

Having both `rd.overlayfs` and `rd.overlay` is confusing.

Standardize on using `rd.overlay` for the overlayfs Dracut module. Merge
`rd.overlayfs` into `rd.overlay`. `rd.overlay` can be a boolean or point
to a storage device now.

Commit b77ae7eb8523 ("feat: rename rd.live.overlay.overlayfs to
rd.overlayfs") introduced `rd.overlayfs` after the release 109. So no
Dracut release included `rd.overlayfs` and therefore no backward
compatility for `rd.overlayfs` is needed.

5 days agotest: log executing /assertion.sh
Benjamin Drung [Wed, 4 Feb 2026 14:27:07 +0000 (15:27 +0100)] 
test: log executing /assertion.sh

To ease debugging print a log message in case `/assertion.sh` is
executed in the client rootfs.

5 days agochore(dracut-logger): drop __DRACUT_LOGGER__
Benjamin Drung [Fri, 30 Jan 2026 23:53:19 +0000 (00:53 +0100)] 
chore(dracut-logger): drop __DRACUT_LOGGER__

Commit d6d53f60b21e ("dracut-functions: use "type" to determine the need
of sourcing dracut-logger") removed checking `__DRACUT_LOGGER__`. There
is no code any more that checks this environment variable.

So drop setting `__DRACUT_LOGGER__`.

5 days agofix(dracut-systemd): do not error out with new root= options handled by systemd
Antonio Alvarez Feijoo [Fri, 23 Jan 2026 10:59:55 +0000 (11:59 +0100)] 
fix(dracut-systemd): do not error out with new root= options handled by systemd

systemd-v258 [1] (gpt-auto-generator/fstab-generator) handles new options for
`root=`: gpt-auto-force, dissect, dissect-force, fstab, off.

[1] https://github.com/systemd/systemd/commit/3777c6e65aaa8dacacbd5be6e43ba644babe1ecd

5 days agotest: add commented DEBUGFAIL for debugging
Benjamin Drung [Wed, 4 Feb 2026 12:45:36 +0000 (13:45 +0100)] 
test: add commented DEBUGFAIL for debugging

To ease debugging add a commented `DEBUGFAIL` to all test cases.
Uncommenting `DEBUGFAIL` will be the first step of debugging in case the
logs are not enough.

5 days agofix(dracut-logger): do not require debug to be defined
Benjamin Drung [Sun, 1 Feb 2026 00:26:10 +0000 (01:26 +0100)] 
fix(dracut-logger): do not require debug to be defined

In case `dracut-logger.sh` is used in combination with `set -u` the
logging functions can fail due to `debug` not being defined. `dracut.sh`
sets this variable, but other consumers might not.

So support `set -u` by not require `debug` to be defined.

5 days agoci: install some packages to test systemd-import
Antonio Alvarez Feijoo [Wed, 4 Feb 2026 12:54:55 +0000 (13:54 +0100)] 
ci: install some packages to test systemd-import

5 days agoci(opensuse): do not install erofs-utils
Antonio Alvarez Feijoo [Wed, 4 Feb 2026 12:51:59 +0000 (13:51 +0100)] 
ci(opensuse): do not install erofs-utils

erofs is blacklisted by default and not supported in openSUSE, so it does not
make sense to test anything related to erofs in the CI with the openSUSE
container.

5 days agotest: print error in case root partition count mismatch
Benjamin Drung [Tue, 3 Feb 2026 12:23:30 +0000 (13:23 +0100)] 
test: print error in case root partition count mismatch

The dmsquash test case can fail by not creating an overlay partition. In
this case the test fails with exit code 1 without printing an error.
This is hard to debug.

So print an error message in case the root partition count mismatches.

5 days agofix(dracut-logger): disable kernel logging if /dev/kmsg is not writable
Benjamin Drung [Sat, 31 Jan 2026 18:54:39 +0000 (19:54 +0100)] 
fix(dracut-logger): disable kernel logging if /dev/kmsg is not writable

`/dev/kmsg` is might not be writable (for example in a podman
container). So disable trying to log to the kernel ring buffer in that
case.

5 days agofix(dracut-logger): allow dlog_init to print multiple errors
Benjamin Drung [Sat, 31 Jan 2026 18:51:45 +0000 (19:51 +0100)] 
fix(dracut-logger): allow dlog_init to print multiple errors

Allow `dlog_init` to print multiple errors by making `errmsg` an array.

5 days agofix(dracut-logger): do not export maxloglvl and syslogfacility
Benjamin Drung [Sat, 31 Jan 2026 00:39:21 +0000 (01:39 +0100)] 
fix(dracut-logger): do not export maxloglvl and syslogfacility

Commit 46265a9d3e0a ("dracut-logger: make $maxloglvl public") exports
the `maxloglvl` variable, but this is not needed. Exporting variables is
only needed when subprocesses need to access those variables.

`maxloglvl` is only used in `dracut-logger.sh` and `dracut.sh`.
`dracut.sh` sources `dracut-logger.sh`. So exporting `maxloglvl` is not
needed. `syslogfacility` is only used in `dracut-logger.sh`.

So do not export `maxloglvl` and `syslogfacility`.

5 days agotest: unset DRACUT_NO_XATTR after build_client_rootfs
Benjamin Drung [Fri, 30 Jan 2026 23:58:41 +0000 (00:58 +0100)] 
test: unset DRACUT_NO_XATTR after build_client_rootfs

`build_client_rootfs` sets `DRACUT_NO_XATTR` to not require xattr
support which is noot needed for the client rootfs. To not influence the
test coverage for xattr support, unset `DRACUT_NO_XATTR` afterwards.

5 days agofeat(gentoo): introduce a distro config file to default out of ukify
Jo Zzsi [Thu, 15 Jan 2026 17:39:22 +0000 (12:39 -0500)] 
feat(gentoo): introduce a distro config file to default out of ukify

Gentoo maintains a down-stream patch to default out of ukify.

The goal of this PR is to help out Gentoo so that the downstream
patch is no longer required.

Follow-up to 7ec5fbb.

5 days agochore(dracut): finalize transition to /var/lib/dracut/hooks
Vitaly Kuznetsov [Thu, 25 Sep 2025 09:53:06 +0000 (11:53 +0200)] 
chore(dracut): finalize transition to /var/lib/dracut/hooks

Commit a45048b80c ("move hooks directory from /usr/lib to /var/lib")
moved hooks to /var/lib/dracut/hooks and created a symlink from /lib
to avoid the code churn. In preparation to supporting additional
hooks locations, finalize the transition and use /var/lib/dracut/hooks
everywhere.

No functional change intended.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
5 days agoRevert "refactor(overlayfs): move legacy option handing into a cmdline hook"
Benjamin Drung [Wed, 4 Feb 2026 10:27:56 +0000 (11:27 +0100)] 
Revert "refactor(overlayfs): move legacy option handing into a cmdline hook"

Moving parsing the legacy options into
`parse-legacy-overlayfs-options.sh` can break the backward
compatibility. Out of tree Dracut modules might want to write to
`/etc/cmdline.d` after `parse-legacy-overlayfs-options.sh`. That change
wouldn't be picked up then.

This reverts commit 17ad34274adda788d179acaa10053630cb3be2de.

5 days agorefactor(overlayfs): move legacy option handing into a cmdline hook
Benjamin Drung [Tue, 3 Feb 2026 11:34:14 +0000 (12:34 +0100)] 
refactor(overlayfs): move legacy option handing into a cmdline hook

Reading the code and understanding the logic gets complicated by
supporting legacy kernel command line options. This will be especially
be true once `rd.overlayfs` gets merged into `rd.overlay`.

So move all the legacy kernel command line option handling into the
separate `parse-legacy-overlayfs-options.sh` script that is executed
during the cmdline stage.

Check that no legacy option is queried directly:

```
git grep getarg -- modules.d/ | grep -w -- -d | grep live
```

5 days agofeat(base): support cmdline options in /run/initramfs/cmdline.d
Benjamin Drung [Tue, 3 Feb 2026 11:22:02 +0000 (12:22 +0100)] 
feat(base): support cmdline options in /run/initramfs/cmdline.d

The command line options can be specified in `/etc/cmdline`,
`/etc/cmdline.d`, and on the kernel command line `/proc/cmdline`.
`/proc/cmdline` is read last and overrides options from `/etc`. There is
no way to override options from `/proc/cmdline`.

To allow overriding options from `/proc/cmdline` during boot also read
`/run/initramfs/cmdline.d`.

6 days agofix(livenet): correct check for deprecated rd.live.overlay.overlayfs
Benjamin Drung [Mon, 2 Feb 2026 15:04:49 +0000 (16:04 +0100)] 
fix(livenet): correct check for deprecated rd.live.overlay.overlayfs

Commit b77ae7eb8523 ("feat: rename rd.live.overlay.overlayfs to
rd.overlayfs") made a mistake and looks for `rd.live.overlayfs.readonly`
instead of `rd.live.overlay.overlayfs` as deprecated option for
`rd.overlayfs`.

7 days agotest: define test expectation in test.sh
Benjamin Drung [Sun, 1 Feb 2026 22:52:28 +0000 (23:52 +0100)] 
test: define test expectation in test.sh

Test 21 defines the test expectation in `assertion.sh` based on the boot
parameters. Every time a new kind of subtest is added in `test.sh` the
expectation in `assertion.sh` needs to be changed accordingly.

To avoid touching two places, define the test expectation in the kernel
boot parameter `test.expect` and let `assertion.sh` operate on that.

8 days agoci(debian): dracut-squash and dracut-live packages are removed
Jo Zzsi [Sat, 31 Jan 2026 13:35:48 +0000 (08:35 -0500)] 
ci(debian): dracut-squash and dracut-live packages are removed

Debian:sid remove dracut-squash and dracut-live packages.

Remove these packages from all Debian/Ubuntu versions.

See https://salsa.debian.org/kernel-team/dracut/-/merge_requests/42
https://salsa.debian.org/kernel-team/dracut/-/merge_requests/43

10 days agofix(systemd-cryptsetup): increase ordering to resolve regression
Jo Zzsi [Fri, 23 Jan 2026 21:57:46 +0000 (16:57 -0500)] 
fix(systemd-cryptsetup): increase ordering to resolve regression

Support for `AF_UNIX` key files was added in 80480a7, in `90systemd-cryptsetup`
at that time. `90systemd-cryptsetup` depending on `90crypt` was ok, because
`90crypt` was evaluated before `90systemd-cryptsetup`, filling
`$initdir/etc/crypttab` before `90systemd-cryptsetup` tried to parse it.
But 43581cd changed the order to `01systemd-cryptsetup`, causing that the
install section of this module is evaluated before `90crypt`, that is,
before `$initdir/etc/crypttab` exists.

The systemd-cryptsetup dracut module needs to be ordered after the
crypt dracut module to ensure that "$initdir"/etc/crypttab is computed.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/2104
10 days agotest: build the test rootfs without calling dracut
Benjamin Drung [Thu, 29 Jan 2026 23:19:02 +0000 (00:19 +0100)] 
test: build the test rootfs without calling dracut

Build the test rootfs by using the functions from `dracut-functions.sh`
instead of calling dracut. Only include the bare minimum for the client
rootfs.

Tested the test execution time on a Raspberry Pi 5 running Ubuntu 26.04:

```
$ hyperfine -L commit 9d5f58b4,build-rootfs -p "git checkout {commit}" -w 1 "test/test.sh ubuntu:devel 10"
Benchmark 1: test/test.sh ubuntu:devel 10 (commit = 9d5f58b4)
  Time (mean ± σ):     49.570 s ±  2.847 s    [User: 0.185 s, System: 0.239 s]
  Range (min … max):   46.697 s … 56.466 s    10 runs

Benchmark 2: test/test.sh ubuntu:devel 10 (commit = build-rootfs)
  Time (mean ± σ):     46.627 s ±  0.625 s    [User: 0.174 s, System: 0.220 s]
  Range (min … max):   45.322 s … 47.210 s    10 runs

Summary
  test/test.sh ubuntu:devel 10 (commit = build-rootfs) ran
    1.06 ± 0.06 times faster than test/test.sh ubuntu:devel 10 (commit = 9d5f58b4)
```

10 days agotest: determine kernel version from initramfs.makeroot
Benjamin Drung [Tue, 27 Jan 2026 13:21:32 +0000 (14:21 +0100)] 
test: determine kernel version from initramfs.makeroot

Determine the kernel version from `initramfs.makeroot` instead from the
client rootfs, because a minimal client rootfs might not contain kernel
modules.

10 days agofix(dmsquash-live-autooverlay): check that parted is present
Benjamin Drung [Thu, 29 Jan 2026 21:01:15 +0000 (22:01 +0100)] 
fix(dmsquash-live-autooverlay): check that parted is present

The binary `parted` might not be installed. Then the `install` step of
`dmsquash-live-autooverlay` will fail.

So better check that the required binary `parted` is present.

10 days agofeat: replace DRACUT_RESOLVE_DEPS by !DRACUT_RESOLVE_LAZY
Benjamin Drung [Thu, 29 Jan 2026 09:51:50 +0000 (10:51 +0100)] 
feat: replace DRACUT_RESOLVE_DEPS by !DRACUT_RESOLVE_LAZY

The two variables `DRACUT_RESOLVE_DEPS` and `DRACUT_RESOLVE_LAZY` are
mutual exclusive (one must be set, the other must not).

Make the code easier by dropping `DRACUT_RESOLVE_DEPS` and replacing
those parts by checking if `DRACUT_RESOLVE_LAZY` is not set. This sets
the default to resolving dependencies in the `inst*` functions.

10 days agofeat(systemd-pcrphase): rename to systemd-pcrextend
Benjamin Drung [Fri, 23 Jan 2026 22:15:31 +0000 (23:15 +0100)] 
feat(systemd-pcrphase): rename to systemd-pcrextend

systemd-255 renamed systemd-pcrphase to systemd-pcrextend. Do the same
for the Dracut module to match that name.

10 days agofeat(overlayfs): add persistent device overlay support
Nadzeya Hutsko [Wed, 28 Jan 2026 22:19:34 +0000 (09:19 +1100)] 
feat(overlayfs): add persistent device overlay support

Extends the overlayfs module to support persistent overlay storage on
block devices using rd.overlay=. Supported formats: LABEL=, UUID=,
PARTUUID=, PARTLABEL=, and /dev/ paths.

Changes written to the overlay device persist across reboots. Falls
back to tmpfs if the device cannot be resolved or mounted.

10 days agofix(tpm2-tss): add tss user/group in addition to sysusers config
Benjamin Drung [Tue, 27 Jan 2026 11:33:12 +0000 (12:33 +0100)] 
fix(tpm2-tss): add tss user/group in addition to sysusers config

Test 10 on ubuntu:devel shows this warning:

```
[    0.608623] systemd-tmpfiles[243]: /usr/lib/tmpfiles.d/systemd.conf:33: Duplicate line for path "/var/lib/systemd", ignoring.
[    0.609389] systemd-tmpfiles[243]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:2: Failed to resolve user 'tss': Unknown user
[    0.610114] systemd-tmpfiles[243]: Failed to parse ACL "default:group:tss:rwx", ignoring: Invalid argument
[    0.610800] systemd-tmpfiles[243]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:4: Failed to resolve user 'tss': Unknown user
[    0.611515] systemd-tmpfiles[243]: Failed to parse ACL "default:group:tss:rwx", ignoring: Invalid argument
[    0.612262] systemd-tmpfiles[243]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:6: Failed to resolve group 'tss': Unknown group
[    0.613564] systemd-tmpfiles[243]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:7: Failed to resolve group 'tss': Unknown group
[    0.627211] systemd-udevd[245]: /usr/lib/udev/rules.d/60-tpm-udev.rules:3 Failed to resolve user 'tss', ignoring: Unknown user
[    0.628065] systemd-udevd[245]: /usr/lib/udev/rules.d/60-tpm-udev.rules:4 Failed to resolve user 'tss', ignoring: Unknown user
```

Debian/Ubuntu does not ship a sysusers config for the tss user/group.
Instead the tpm-udev package creates a tss user and group in its
postinst script.

So copy the tss user and group into the initrd in addition to shipping
possible sysusers config for it.

Bug-Ubuntu: https://launchpad.net/bugs/2127725
Fixes: https://github.com/dracut-ng/dracut-ng/issues/1826
11 days agotest: consider SIGTERM of test-init.sh a successful termination
Benjamin Drung [Tue, 27 Jan 2026 15:24:53 +0000 (16:24 +0100)] 
test: consider SIGTERM of test-init.sh a successful termination

The `test-init.sh` will call `systemctl start poweroff.target` and get
an `SIGTERM` interrupt. Since `testsuite.service` is `Type=oneshot`
systemd will complain:

```
[    1.892101] systemd[1]: testsuite.service: Main process exited, code=killed, status=15/TERM
[    1.892708] systemd[1]: testsuite.service: Failed with result 'signal'.
```

Consider `SIGTERM` of `test-init.sh` a successful termination.

11 days agotest: move start_webserver to test-functions
Benjamin Drung [Thu, 29 Jan 2026 11:38:52 +0000 (12:38 +0100)] 
test: move start_webserver to test-functions

To allow re-using `start_webserver` in other test cases (for example for
systemd-import), move `start_webserver` to `test-functions` and add
`stop_webserver` for stopping it again.

11 days agotest: execute assertion.sh instead of sourcing it
Benjamin Drung [Wed, 28 Jan 2026 19:21:25 +0000 (20:21 +0100)] 
test: execute assertion.sh instead of sourcing it

The `assertion.sh` files do not need to access from `test-init.sh`. So
execute `assertion.sh` instead of sourcing it.

11 days agorefactor(overlayfs): exit early in case overlayfs is not used
Benjamin Drung [Wed, 28 Jan 2026 21:47:19 +0000 (22:47 +0100)] 
refactor(overlayfs): exit early in case overlayfs is not used

Increase the code readability by exiting early in case overlayfs is not
enabled and therefore should do nothing.

11 days agotest(NETWORK): use POSIX shell for assertion.sh
Benjamin Drung [Wed, 28 Jan 2026 19:25:48 +0000 (20:25 +0100)] 
test(NETWORK): use POSIX shell for assertion.sh

Make the test 50 more flexible by only requiring a POSIX shell in
`assertion.sh` in the client rootfs.

11 days agodocs(dracut.conf): restore accidentally removed newline
Benjamin Drung [Wed, 28 Jan 2026 17:27:20 +0000 (18:27 +0100)] 
docs(dracut.conf): restore accidentally removed newline

Commit 331a30a2dda9 ("docs: --remove/remove_items supports globbing")
accidentally removed a newline. Restore it.

11 days agofix(dracut): move libdirs to dracut-functions.sh
Benjamin Drung [Mon, 26 Jan 2026 20:30:27 +0000 (21:30 +0100)] 
fix(dracut): move libdirs to dracut-functions.sh

The variable `libdirs` is used by functions defined in
`dracut-functions.sh` (for example `inst_libdir_file`).

So move initializing `libdirs` to `dracut-functions.sh`.

11 days agoperf(dracut): remove duplicate export libdirs
Benjamin Drung [Mon, 26 Jan 2026 16:54:15 +0000 (17:54 +0100)] 
perf(dracut): remove duplicate export libdirs

The variable `libdirs` is exported later on in the `dracut.sh` code
together with all the other variables.

11 days agorefactor(dracut.sh): introduce _detect_library_directories
Benjamin Drung [Mon, 26 Jan 2026 16:50:48 +0000 (17:50 +0100)] 
refactor(dracut.sh): introduce _detect_library_directories

Move constructing `libdirs` into a separate helper function
`_detect_library_directories`.

11 days agodocs(dracut.cmdline): add version info to deprecated options
Benjamin Drung [Wed, 28 Jan 2026 15:46:45 +0000 (16:46 +0100)] 
docs(dracut.cmdline): add version info to deprecated options

Document which dracut version introduced the new option names. Relevant
commits:

bcefa9d0a4ac ("feat: rename rd.overlayfs.readonly to rd.overlay.readonly")
d6872bbdf344 ("feat: rename rd.live.overlay to rd.overlay")
b77ae7eb8523 ("feat: rename rd.live.overlay.overlayfs to rd.overlayfs")
a471ca601b2a ("fix(base): add support for rd.udev.log_level")
b43f4df540b2 ("iscsi: changed parameters to new rd.iscsi style")
ee6fa3240d2c ("i18n: move to vconfig.* and locale.* namespace")
fa7ada31d022 ("new parameter option names with "rd.*" namespace")

11 days agodocs: --remove/remove_items supports globbing
Benjamin Drung [Wed, 28 Jan 2026 15:32:36 +0000 (16:32 +0100)] 
docs: --remove/remove_items supports globbing

The dracut option `--remove` and the corresponding config option
`remove_items` support globbing (see https://launchpad.net/bugs/2139065
for a real-world usage example).

12 days agotest: allow passing NO_KVM into container
Benjamin Drung [Wed, 28 Jan 2026 00:14:06 +0000 (01:14 +0100)] 
test: allow passing NO_KVM into container

Allow passing the environment variable `NO_KVM` to the container to
influence `run-qemu`.

12 days agotest: use build_ext4_image where possible
Benjamin Drung [Tue, 27 Jan 2026 22:43:49 +0000 (23:43 +0100)] 
test: use build_ext4_image where possible

To speed up the test execution use `build_ext4_image` to build rootfs
ext4 images in cases where QEMU was only used to build an unencrypted
ext4 rootfs. This applies the improvement from commit 6e51e550abb8
("test(NFS): use build_ext4_image to build server rootfs") to all other
test cases.

12 days agotest: drop index parameter from qemu_add_drive
Benjamin Drung [Tue, 27 Jan 2026 22:09:07 +0000 (23:09 +0100)] 
test: drop index parameter from qemu_add_drive

Simplify `qemu_add_drive` by dropping the `index` parameter. Determine
the index dynamically from the content of `args`.

That way declaring `disk_index` is not needed any more and shellcheck is
happy.

12 days agotest(UEFI): let drive index start with 0
Benjamin Drung [Tue, 27 Jan 2026 22:18:54 +0000 (23:18 +0100)] 
test(UEFI): let drive index start with 0

Unify the tests and let the drive index for test 12 start at 0 as well.

12 days agotest: use a nameref variable in qemu_add_drive
Benjamin Drung [Tue, 27 Jan 2026 21:58:00 +0000 (22:58 +0100)] 
test: use a nameref variable in qemu_add_drive

Avoid the need for `eval` by using a nameref variable.

12 days agotest: remove fallback for id-name in qemu_add_drive
Benjamin Drung [Tue, 27 Jan 2026 21:36:19 +0000 (22:36 +0100)] 
test: remove fallback for id-name in qemu_add_drive

The documentation for `qemu_add_drive` says that `id-name` must be
specified and all consumers specify a name. So drop the fallback for
this parameter.

12 days agotest(NFS): use build_ext4_image to build server rootfs
Benjamin Drung [Tue, 27 Jan 2026 19:33:06 +0000 (20:33 +0100)] 
test(NFS): use build_ext4_image to build server rootfs

After commit d36012143c7c ("test: use systemd inside client test rootfs
if available") and commit 4aaf8f24110f ("test: include systemd-journald
in client test rootfs") the test 60 on opensuse:latest fails due to not
enough memory for starting the QEMU process to create the server rootfs
image.

Use `build_ext4_image` to build the server rootfs to completely avoid
needing to start a QEMU instance.

12 days agotest: increase ext4 size in build_ext4_image
Benjamin Drung [Tue, 27 Jan 2026 19:20:57 +0000 (20:20 +0100)] 
test: increase ext4 size in build_ext4_image

Adding a fixed amount of 10 MB to the ext4 image size might not be
enough (for example when using `build_ext4_image` in test 60).

So calculate the additional size by a percentaged and a fixed amount.

12 days agorevert(test): exclude systemd from server rootfs
Benjamin Drung [Tue, 27 Jan 2026 19:19:12 +0000 (20:19 +0100)] 
revert(test): exclude systemd from server rootfs

The network tests need systemd when they use systemd-networkd for
networking. The tests will fail with:

```
dracut[E]: Module 'systemd-networkd' depends on module 'systemd', which can't be installed
```

This reverts commit 30894ad4855018f6ec07664ce06bf5557d65e324.

12 days agotest: log exit code in case the client init script fails
Benjamin Drung [Mon, 26 Jan 2026 22:24:51 +0000 (23:24 +0100)] 
test: log exit code in case the client init script fails

To ease debugging, log the exit code in case the client init script
fails.

13 days agotest: exclude systemd from server rootfs
Benjamin Drung [Tue, 27 Jan 2026 14:52:53 +0000 (15:52 +0100)] 
test: exclude systemd from server rootfs

After commit d36012143c7c ("test: use systemd inside client test rootfs
if available") and commit 4aaf8f24110f ("test: include systemd-journald
in client test rootfs") the test 60 on opensuse:latest fails due to not
enough memory on the server rootfs image.

So revert those two changes partially: create the server rootfs images
without systemd. Also create the client test rootfs without systemd.

13 days agotest: include systemd-journald in client test rootfs
Benjamin Drung [Tue, 27 Jan 2026 12:04:27 +0000 (13:04 +0100)] 
test: include systemd-journald in client test rootfs

After commit d36012143c7c ("test: use systemd inside client test rootfs
if available") some tests became racy (for example test 20 on
debian:latest or fedora:latest). There is `made it to the test rootfs!`
in the logs but not the `All OK`.

Following warning can be found in the logs:

```
systemd[1]: systemd-journald.socket: Unit configuration changed while unit was running, and no socket file descriptors are open. Unit not functional until restarted.
systemd[1]: systemd-udevd-kernel.socket: Unit configuration changed while unit was running, and no socket file descriptors are open. Unit not functional until restarted.
systemd[1]: systemd-journald-dev-log.socket: Unit configuration changed while unit was running, and no socket file descriptors are open. Unit not functional until restarted.
```

Include `systemd-journald` in client test root file system when systemd
is used to ensure that systemd-journald continues working.

Hopefully fixes: https://github.com/dracut-ng/dracut-ng/issues/2137

13 days agotest: use EXIT trap to poweroff client rootfs
Benjamin Drung [Mon, 26 Jan 2026 21:43:17 +0000 (22:43 +0100)] 
test: use EXIT trap to poweroff client rootfs

Use an trap on `EXIT` to poweroff the client rootfs. This will cover all
kinds of failure and allows using `set -eu` in the init script.

13 days agofix(dracut): move defining DRACUT_LDCONFIG to dracut-functions.sh
Benjamin Drung [Mon, 26 Jan 2026 16:35:55 +0000 (17:35 +0100)] 
fix(dracut): move defining DRACUT_LDCONFIG to dracut-functions.sh

The function `ldconfig_paths` in `dracut-functions.sh` uses
`DRACUT_LDCONFIG`. Therefore move defining `DRACUT_LDCONFIG` into
`dracut-functions.sh`.

13 days agotest: avoid printing wall message on shutdown
Benjamin Drung [Mon, 26 Jan 2026 15:54:40 +0000 (16:54 +0100)] 
test: avoid printing wall message on shutdown

Calling `systemctl poweroff` in the client test rootfs causes this
warning:

```
Failed to connect to system scope bus via local transport: No such file or directory
```

Installing D-Bus in the client test rootfs changes the warning to:

```
Failed to set wall message, ignoring: Transport endpoint is not connected
Call to PowerOff failed: Transport endpoint is not connected
```

The man page for systemctl poweroff says: "Shut down and power-off the
system. This is mostly equivalent to systemctl start poweroff.target
--job-mode=replace-irreversibly --no-block, but also prints a wall
message to all users."

So call this equivalent command instead to not trying to print wall
message on shutdown.

2 weeks agotest: use systemd inside client test rootfs if available
Benjamin Drung [Mon, 26 Jan 2026 15:17:45 +0000 (16:17 +0100)] 
test: use systemd inside client test rootfs if available

Some tests (for example test 10 on ubuntu:devel) show this warning:

```
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to system scope bus via local transport: Host is down
```

This is caused by calling `systemctl --failed` in the client test rootfs
where systemd is not available/used.

Use systemd inside the client test rootfs if available to allow querying
the failed services from the initrd.