Skip to content

fix(dracut): use entry token instead of machine-id for output path detection - #2446

Draft
mxsb wants to merge 7 commits into
dracut-ng:mainfrom
mxsb:fix/dracut-sh-entry-token
Draft

fix(dracut): use entry token instead of machine-id for output path detection#2446
mxsb wants to merge 7 commits into
dracut-ng:mainfrom
mxsb:fix/dracut-sh-entry-token

Conversation

@mxsb

@mxsb mxsb commented May 15, 2026

Copy link
Copy Markdown

dracut.sh hardcodes $MACHINE_ID for output path detection when no explicit output file is given. When the system is configured with a non-machine-id entry token (e.g. via bootctl --entry-token=os-id), directory checks fail because the actual directories use the entry token, not the 32-char machine-id hex string.

Resolve the entry token from $KERNEL_INSTALL_ENTRY_TOKEN, /etc/kernel/entry-token, or fall back to $MACHINE_ID. Use it for all BLS directory lookups, mountpoint fallbacks, and the UKI output filename.

Same class of bug as #2443 / #2444, but in the core dracut command rather than the rescue install hook.

Fixes: #2445

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

…tection

dracut.sh hardcodes $MACHINE_ID for output path detection when no
explicit output file is given. When the system is configured with a
non-machine-id entry token (e.g. via bootctl --entry-token=os-id),
directory checks fail because the actual directories use the entry
token, not the 32-char machine-id hex string.

Resolve the entry token from $KERNEL_INSTALL_ENTRY_TOKEN,
/etc/kernel/entry-token, or fall back to $MACHINE_ID. Use it for
all BLS directory lookups, mountpoint fallbacks, and the UKI output
filename.

Update man pages and --help text to document the new <ENTRY_TOKEN>
resolution chain.

Add tests to TEST-43 verifying outfile path detection with a custom
entry token file and env var precedence.

Fixes: dracut-ng#2445
@mxsb
mxsb requested a review from a team as a code owner May 15, 2026 15:54
@github-actions github-actions Bot added test Issues related to testing man docs labels May 15, 2026
shfmt requires no quotes around parameter expansion inside [[ ]].
@devkontrol

devkontrol commented May 15, 2026

Copy link
Copy Markdown
Collaborator

@mxsb - Can you rebase your changes instead of merging main into it?

CC @aafeijoo-suse @Nowa-Ammerlaan @mrc0mmand

@devkontrol
devkontrol marked this pull request as draft August 10, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs man test Issues related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dracut.sh output path detection hardcodes $MACHINE_ID, fails with non-machine-id entry tokens

2 participants