Dracut Fails to Build Initrd if a DKMS Module Fails – Changed Behavior?

Hi everyone,

I’ve recently noticed a change in Dracut’s behavior after updating or installing a new kernel. Previously, if a DKMS module failed to build, Dracut would log an error but still proceed with generating the initrd just without the failed module. However, now it seems that Dracut fails entirely when a DKMS module cannot be built, preventing the creation of the initrd.

My Setup & Issue

I use a ZFS-RAID DAS, and as many of you know, ZFS support often lags behind newer kernels. This was never an issue before because I had both an LTS kernel and the latest Zen kernel installed. The DKMS module would successfully build for the LTS kernel but fail for the Zen kernel. That was fine—I could boot into the LTS kernel for ZFS access and switch to Zen for gaming when needed.

However, since around the release of the 6.13 kernel (within the last couple of weeks), I’ve encountered a problem where all 6.13 kernels fail to build ZFS and do not generate an initrd at all. This makes the Zen kernel unbootable.

Currently, my boot menu still shows the Zen kernel entries, but since the initrd is missing, attempting to boot results in a kernel panic.

Questions

  1. Is there a way to restore the previous behavior, where Dracut would still create an initrd even if the DKMS build fails?
  2. As a workaround, is there a way to install zfs-dkms via yay or pacman while preventing an automatic module installation? That way, I could manually add the ZFS module only for the LTS kernel without affecting the Zen kernel.

I appreciate any insights or suggestions. Thanks in advance!

ZFS only has support up to 6.12 at the moment.

You could try commenting out set -e in the subshell that rebuilds the initramfs in /usr/share/libalpm/scripts/dracut-install. This one: garuda-dracut-support/dracut-install · 1628b9f1103e56ee4ebfc80098c7e7df3e34d1df · Garuda Linux 🦅 / PKGBUILDs · GitLab

I wouldn’t necessarily recommend doing that in general, but perhaps it’s worth testing to see if you get the behavior you want.

Or you could test using the old version of the script: garuda-dracut-support/dracut-install · 7cd3e47259617139036d8d9a055c071e0f2c80c7 · Garuda Linux 🦅 / PKGBUILDs · GitLab

Once you have modified dracut-install, try regenerating the initrds again and see what happens.

sudo dracut-rebuild

If you only want ZFS modules for the LTS kernel, you could skip the DKMS package altogether and use the zfs-linux-lts packages instead.

❯ paru -Ss zfs-linux-lts
aur/zfs-linux-lts-headers 2.3.0_6.12.13.1-1 [+78 ~1.12]
    Kernel headers for the Zettabyte File System.
aur/zfs-linux-lts 2.3.0_6.12.13.1-1 [+78 ~1.12]
    Kernel modules for the Zettabyte File System.

A nice thing about that solution is you wouldn’t have to hack around in the dracut scripts at all to get it working.

3 Likes

Please post your garuda-inxi as requested by the template.

It would also be useful if you could post corresponding error messages.


As @BluishHumility has already mentioned, the problem is OpenZFS:

OpenZFS 2.3.0.
Supported Platforms: Linux kernels 4.18 - 6.12

Another option would be to downgrade linux-zen and linux-zen-headers to version 6.12.10 and then add them to IgnorePkg in pacman.conf until version 6.13.x is supported. If you have an nvidia GPU, then you will probably need to downgrade the nvidia drivers as well.

2 Likes

I am aware that ZFS is currently not supporting Kernel 6.13.

The question was about the changed behavior of dracut. Until now the zfs module was just not build successfully but the initrd was created nonetheless.

Now the initrd is not created leaving me with GRUB boot entrys that are broken instead of just a missing zfs module.

System:
Kernel: 6.12.13-lqx2-1-lqx arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
clocksource: tsc avail: hpet,acpi_pm parameters: audit=0
intel_pstate=disable amd_pstate=disable
BOOT_IMAGE=/@/boot/vmlinuz-linux-lqx
root=UUID=6626eb59-3453-4a87-a542-b7e7d8223c3b rw rootflags=subvol=@
quiet rd.luks.uuid=5590807e-ccc9-4d70-98b8-fe9f9b2d35eb
rd.luks.options=discard loglevel=3 ibt=off
Desktop: KDE Plasma v: ERR-101 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
Distro: Garuda base: Arch Linux
Machine:
Type: Laptop System: GPD product: G1619-05 v: Ver.1.0 serial: <filter>
Mobo: GPD model: G1619-05 v: Ver.1.0 serial: <filter> part-nu: 1
uuid: - UEFI: GPD v: 0.17
date: 12/04/2024
Battery:
ID-1: BAT0 charge: 70.3 Wh (100.0%) condition: 70.3/67.1 Wh (104.7%)
volts: 16.4 min: 15.4 model: Standard SR Real Battery type: Li-ion
serial: <filter> status: full
Device-1: hidpp_battery_0 model: Logitech MX Keys Wireless Keyboard
serial: <filter> charge: 100% (should be ignored) rechargeable: yes
status: full
Device-2: hidpp_battery_1 model: Logitech MX Ergo Multi-Device Trackball
serial: <filter> charge: 55% (should be ignored) rechargeable: yes
status: discharging
CPU:
Info: model: AMD Ryzen AI 9 HX 370 w/ Radeon 890M socket: FP8LPDDR5x
bits: 64 type: MT MCP arch: N/A level: v4 note: check family: 0x1A (26)
model-id: 0x24 (36) stepping: 0 microcode: 0xB204019
Topology: cpus: 1x dies: 1 clusters: 1 cores: 12 threads: 24 tpc: 2
smt: enabled cache: L1: 960 KiB desc: d-12x48 KiB; i-12x32 KiB L2: 12 MiB
desc: 12x1024 KiB L3: 24 MiB desc: 1x16 MiB, 1x8 MiB
Speed (MHz): avg: 2000 min/max: 1600/2000 boost: enabled
base/boost: 2000/5150 scaling: driver: acpi-cpufreq governor: performance
volts: 1.2 V ext-clock: 100 MHz cores: 1: 2000 2: 2000 3: 2000 4: 2000
5: 2000 6: 2000 7: 2000 8: 2000 9: 2000 10: 2000 11: 2000 12: 2000
13: 2000 14: 2000 15: 2000 16: 2000 17: 2000 18: 2000 19: 2000 20: 2000
21: 2000 22: 2000 23: 2000 24: 2000 bogomips: 95817
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities: <filter>
Graphics:
Device-1: Advanced Micro Devices [AMD/ATI] Strix [Radeon 880M / 890M]
driver: amdgpu v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 ports:
active: DP-1 off: eDP-1 empty: DP-2, DP-3, DP-4, DP-5, DP-6, HDMI-A-1,
Writeback-1 bus-ID: c5:00.0 chip-ID: 1002:150e class-ID: 0380 temp: 33.0 C
Device-2: Tripath USB Camera driver: N/A type: USB rev: 2.0
speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-1.1:3 chip-ID: 058e:3864
class-ID: 0e02
Device-3: Logitech HD Pro Webcam C920 driver: snd-usb-audio type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 5-1.1.3:6
chip-ID: 046d:082d class-ID: 0102 serial: <filter>
Display: unspecified server: X.Org v: 24.1.5 with: Xwayland v: 24.1.5
compositor: kwin_wayland driver: X: loaded: amdgpu unloaded: modesetting
alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: :1 screens: 1
Screen-1: 0 s-res: 5120x1440 s-dpi: 96 s-size: 1355x381mm (53.35x15.00")
s-diag: 1408mm (55.42")
Monitor-1: DP-1 res: mode: 5120x1440 hz: 165 scale: 100% (1) dpi: 109
size: 1192x335mm (46.93x13.19") diag: 1238mm (48.75") modes: N/A
API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
device: 1 drv: swrast gbm: drv: radeonsi surfaceless: drv: radeonsi x11:
drv: radeonsi inactive: wayland
API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.3.4-arch1.1
glx-v: 1.4 direct-render: yes renderer: AMD Radeon Graphics (radeonsi
gfx1150 LLVM 19.1.7 DRM 3.59 6.12.13-lqx2-1-lqx) device-ID: 1002:150e
memory: 15.62 GiB unified: no
API: Vulkan v: 1.4.303 layers: 5 device: 0 type: integrated-gpu name: AMD
Radeon Graphics (RADV GFX1150) driver: N/A device-ID: 1002:150e
surfaces: xcb,xlib device: 1 type: cpu name: llvmpipe (LLVM 19.1.7 256
bits) driver: N/A device-ID: 10005:0000 surfaces: xcb,xlib
Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
de: kscreen-console,kscreen-doctor gpu: amdgpu_top wl: wayland-info
x11: xdpyinfo, xprop, xrandr
Audio:
Device-1: Advanced Micro Devices [AMD/ATI] Rembrandt Radeon High Definition
Audio driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s
lanes: 16 bus-ID: c5:00.1 chip-ID: 1002:1640 class-ID: 0403
Device-2: Advanced Micro Devices [AMD] Family 17h/19h/1ah HD Audio
driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
bus-ID: c5:00.6 chip-ID: 1022:15e3 class-ID: 0403
Device-3: Logitech HD Pro Webcam C920 driver: snd-usb-audio type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 5-1.1.3:6
chip-ID: 046d:082d class-ID: 0102 serial: <filter>
API: ALSA v: k6.12.13-lqx2-1-lqx status: kernel-api tools: N/A
Server-1: PipeWire v: 1.2.7 status: n/a (root, process) with:
1: pipewire-pulse status: active 2: wireplumber status: active
3: pipewire-alsa type: plugin 4: pw-jack type: plugin
tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel Wi-Fi 6E AX210/AX1675 2x2 [Typhoon Peak] driver: iwlwifi
v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1 bus-ID: c3:00.0
chip-ID: 8086:2725 class-ID: 0280
IF: wlp195s0 state: up mac: <filter>
Device-2: Realtek RTL8153 Gigabit Ethernet Adapter driver: r8152 type: USB
rev: 3.0 speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 6-1.1.2:4
chip-ID: 0bda:8153 class-ID: 0000 serial: <filter>
IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Device-3: Realtek RTL8153 Gigabit Ethernet Adapter driver: r8152 type: USB
rev: 3.0 speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 6-1.1.4:5
chip-ID: 0bda:8153 class-ID: 0000 serial: <filter>
IF: eth1 state: down mac: <filter>
IF-ID-1: virbr0 state: down mac: <filter>
Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant
Bluetooth:
Device-1: Intel AX210 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-5:7 chip-ID: 8087:0032
class-ID: e001
Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 5.3
lmp-v: 12 status: discoverable: no pairing: no class-ID: 6c010c
Drives:
Local Storage: total: 5.46 TiB used: 4.25 TiB (77.9%)
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 990 PRO 4TB
size: 3.64 TiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
lanes: 4 tech: SSD serial: <filter> fw-rev: 4B2QJXD7 temp: 27.9 C
scheme: GPT
SMART: yes health: PASSED on: 30d 11h cycles: 117
read-units: 64,340,690 [32.9 TB] written-units: 37,926,768 [19.4 TB]
ID-2: /dev/nvme1n1 maj-min: 259:2 vendor: Western Digital
model: WD BLACK SN770M 2TB size: 1.82 TiB block-size: physical: 512 B
logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
fw-rev: 731100WD temp: 23.9 C scheme: GPT
SMART: yes health: PASSED on: 4d 10h cycles: 89
read-units: 7,733,425 [3.95 TB] written-units: 4,782,755 [2.44 TB]
Partition:
ID-1: / raw-size: 1.82 TiB size: 1.82 TiB (100.00%) used: 824.6 GiB (44.3%)
fs: btrfs block-size: 4096 B dev: /dev/dm-0 maj-min: 254:0
mapped: luks-5590807e-ccc9-4d70-98b8-fe9f9b2d35eb
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 728 KiB (0.2%) fs: vfat block-size: 512 B dev: /dev/nvme1n1p1
maj-min: 259:3
ID-3: /home raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 824.6 GiB (44.3%) fs: btrfs block-size: 4096 B dev: /dev/dm-0
maj-min: 254:0 mapped: luks-5590807e-ccc9-4d70-98b8-fe9f9b2d35eb
ID-4: /var/log raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 824.6 GiB (44.3%) fs: btrfs block-size: 4096 B dev: /dev/dm-0
maj-min: 254:0 mapped: luks-5590807e-ccc9-4d70-98b8-fe9f9b2d35eb
ID-5: /var/tmp raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 824.6 GiB (44.3%) fs: btrfs block-size: 4096 B dev: /dev/dm-0
maj-min: 254:0 mapped: luks-5590807e-ccc9-4d70-98b8-fe9f9b2d35eb
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: zram size: 46.67 GiB used: 0 KiB (0.0%) priority: 100
comp: zstd avail: lzo-rle,lzo,lz4,lz4hc,deflate,842 max-streams: 24
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 34.8 C mobo: N/A
Fan Speeds (rpm): N/A
Info:
Memory: total: 48 GiB note: est. available: 46.67 GiB used: 4.89 GiB (10.5%)
Processes: 540 Power: uptime: 2m states: freeze,mem,disk suspend: s2idle
wakeups: 0 hibernate: platform avail: shutdown, reboot, suspend, test_resume
image: 18.66 GiB services: org_kde_powerdevil,upowerd Init: systemd v: 257
default: graphical tool: systemctl
Packages: 1733 pm: pacman pkgs: 1716 libs: 438 tools: octopi,paru
pm: flatpak pkgs: 17 Compilers: clang: 19.1.7 gcc: 14.2.1
Shell: garuda-inxi (sudo) default: Bash v: 5.2.37 running-in: konsole
inxi: 3.3.37
Garuda (2.6.26-1.1):
System install date:     2024-07-01
Last full system update: 2025-02-15
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut
Windows dual boot:       No/Undetected
Failed units:

Thanks that’s exactly what i need.

zfs-linux-lts

I’m still wondering about the changed dracut behavior.

Did you test?

Or do you prefer to wonder?

3 Likes

I guess i have to wonder because my dracut-install looks like:

File: /usr/share/libalpm/scripts/dracut-install
#!/bin/bash -e

all=0
lines=()

while read -r line; do
if [[ "${line}" != */vmlinuz ]]; then
# triggers when it's a change to dracut files
all=1
continue
fi

lines+=("/${line%/vmlinuz}")

pkgbase="$(<"${lines[-1]}/pkgbase")"
install -Dm644 "/${line}" "/boot/vmlinuz-${pkgbase}"
done

if ((all)); then
lines=(/usr/lib/modules/*)
fi

for line in "${lines[@]}"; do
if ! pacman -Qqo "${line}/pkgbase" &>/dev/null; then
# if pkgbase does not belong to any package then skip this kernel
continue
fi

pkgbase="$(<"${line}/pkgbase")"
kver="${line##*/}"

echo ":: Building initramfs for ${pkgbase} (${kver})"
dracut -L 3 --force "/boot/initramfs-${pkgbase}.img" "${kver}"

echo ":: Building fallback initramfs for ${pkgbase} (${kver})"
dracut -L 1 --force --no-hostonly -o "network" "/boot/initramfs-${pkgbase}-fallback.img" "${kver}"
done

Also the fresh install i did on a spare notebook to test out solutions has the exact same file.

Did the fresh install with a garuda-dr460nized-linux-zen-240428.iso downloaded about 8 hours ago.

It seems its the commit a348146f of dracut-install file (one version earlyer).
Shouldn’t the install file be updated alongside everything else using garuda-update?

Good catch! My guess is there was a little oopsie with the PKGBUILD back when they merged that PR for running the build commands in subshells. I’ll see if I can get it straightened out later when I have a chance to sit down at the computer.

Edit:

Yep, it looks like the pkgver never got bumped.

garuda-dracut-support 1.1.1 should be coming down momentarily, so we can finally try it out after all this time.

Well, I now have a working LTS with ZFS again, though not in the way I had imagined.

First, I had to remove zfs-dkms. I can’t stress enough if I hadn’t had a legacy kernel installed, Dracut would have simply removed the initrd of the upgraded kernels, leaving me with nothing!

This triggered a rebuild of all initrd, which seemed fine so far.

Then, I installed zfs-linux-lts, which triggered a rebuild of the LTS kernels—again, so far, so good.
Next, I installed zfs-utils, followed by running garuda-update remote fix to ensure everything was in order.

However, this somehow triggered another rebuild of all initrd, and Dracut attempted to insert a non-existent ZFS module into the initrd. Fortunately, this failed on the first kernel it found and then stopped.

Removing zfs-image-lts and zfs-utils and then forcing a Dracut rebuild still resulted in the same error—Dracut continued trying to add a ZFS module that doesn’t exist!

To resolve this, I had to manually add ZFS to Dracut omit-zfs.conf. After that, the Dracut rebuild worked correctly.

In the end, I had to download the ZFS source and build it manually—only for one of the LTS kernels I had installed.

On my second laptop, by avoiding the installation of zfs-image-lts and manually building ZFS from the start, adding ZFS to omit-zfs.conf was unnecessary.

Now, I have one fully functional system and another semi-functional one that still seems to believe some kind of ZFS module is globally installed…

I wish Dracut would simply ignore incompatible modules like it did before. :frowning:

But on the bright side i learned a lot! :wink:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.