Bug 2516033 - dracut-crypt-generator uses return instead of exit, causing spurious exit code 2 on systems without /etc/crypttab
Summary: dracut-crypt-generator uses return instead of exit, causing spurious exit cod...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 45
Hardware: aarch64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Pavel Valena
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-08-14 14:14 UTC by Jaroslav Groman
Modified: 2026-09-10 18:46 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)
Fedora 45 Branched 20260814.n.0 Minimal aarch64 boot log (218.45 KB, text/plain)
2026-08-14 14:15 UTC, Jaroslav Groman
no flags Details

Description Jaroslav Groman 2026-08-14 14:14:17 UTC
On every boot, the following error is logged during the initrd phase:
'/usr/lib/systemd/system-generators/dracut-crypt-generator' failed with exit status 2.
This occurs on systems with no encrypted volumes and no /etc/crypttab.

Root Cause

The generator script usr/lib/systemd/system-generators/dracut-crypt-generator (installed inside the initramfs by the 90crypt dracut module) uses return statements to exit early:

[ -e /etc/crypttab ] || return 0

systemd executes generators as standalone processes, not sourced shell scripts. When return is used outside of a function in a non-sourced script, the shell treats it as an error and exits with code 2. systemd then logs this as a generator failure.
The script has multiple return statements that should be exit.

Reproducible: Always

Steps to Reproduce:
1. Boot any Fedora 45 aarch64 (or likely any arch) system with dracut 111-1.fc45
2. The system must not have encrypted volumes (no /etc/crypttab)
3. Check the journal: journalctl -b | grep dracut-crypt-generator
Actual Results:
Errors in boot log:
(gene[NNN]: '/usr/lib/systemd/system-generators/dracut-crypt-generator' failed with exit status 2.

Expected Results:
No error. The generator should exit cleanly with code 0 when there is nothing to do.

Additional Information:
- dracut: 111-1.fc45
- Kernel: 7.2.0-0.rc6.260807gf9a2394a2348.52.fc45.aarch64
- Reproduced on: GNOME Workstation, KDE Plasma, Xfce, Minimal -- all Fedora 45 aarch64 spins on Raspberry Pi 4
- Not present in: dracut 109-7.fc45 (earlier boots did not show this error)
- Impact: Cosmetic only -- boot continues normally. But it creates unnecessary noise in every boot log.

Comment 1 Jaroslav Groman 2026-08-14 14:15:54 UTC
Created attachment 2154511 [details]
Fedora 45 Branched 20260814.n.0 Minimal aarch64 boot log

Comment 2 Fedora Blocker Bugs Application 2026-09-05 14:25:44 UTC
Proposed as a Freeze Exception for 45-beta by Fedora user dustymabe using the blocker tracking app because:

 The dracut-crypt-generator failing seems harmless but it breaks CoreOS CI because we check that no generators fail during our boots. We have worked around this by pinning on older versions of dracut, but would like dracut-112  that has the fix.

Comment 3 Dusty Mabe 2026-09-05 14:26:32 UTC
This is fixed upstream https://github.com/dracut-ng/dracut/pull/2494 and is in dracut 112 so should get fixed when that is released to Fedora.

Comment 4 Kamil Páral 2026-09-07 11:14:46 UTC
Accepted as a Beta freeze exception in https://forge.fedoraproject.org/quality/blocker-review/issues/2172

Comment 5 Hans de Goede 2026-09-10 08:53:37 UTC
I don't believe that getting dracut 112 into Fedora 45 at this point in the cycle is realistic.

You may want to submit a PR with the fix backported for the Fedora dracut package at:

https://github.com/redhat-plumbers/dracut-fedora/

This uses a standard packit workflow.

Comment 6 Adam Williamson (Fedora) 2026-09-10 18:46:23 UTC
In the end we signed off Beta-1.3 for release without this. Dropping FE status.


Note You need to log in before you can comment on or make changes to this bug.