Skip to content

51-dracut-rescue.install builds broken paths with non-machine-id entry tokens #2443

@mxsb

Description

@mxsb

Describe the bug
install.d/51-dracut-rescue.install hardcodes $MACHINE_ID for path construction (lines 88, 90, 96). When kernel-install is configured with a non-machine-id entry token (e.g. bootctl install --entry-token=os-idfedora), the paths diverge from what kernel-install actually creates.

Specifically, BOOT_DIR is set to /${MACHINE_ID}/0-rescue and LOADER_ENTRY to …/${MACHINE_ID}-0-rescue.conf, but the actual boot directory tree uses the entry token (e.g. fedora/). The suffix-strip BOOT_ROOT=${BOOT_DIR_ABS%"$BOOT_DIR"} also fails because $BOOT_DIR_ABS doesn't end with /${MACHINE_ID}/….

$KERNEL_INSTALL_ENTRY_TOKEN has been exported by kernel-install since systemd 253 but is not used by this script.

Distribution used
Fedora 43

Dracut version
107 (also reproducible on current main)

Init system
systemd (systemd-boot + UKI layout)

To Reproduce

# /etc/kernel/install.conf:
layout=uki
initrd_generator=dracut
uki_generator=ukify

# Set entry token to os-id:
bootctl install --entry-token=os-id   # writes "fedora" to /etc/kernel/entry-token

# Then:
kernel-install add-all
# → 51-dracut-rescue.install fails building incorrect paths

Expected behavior
The script should use $KERNEL_INSTALL_ENTRY_TOKEN (falling back to $MACHINE_ID) for path construction, matching how kernel-install organizes the boot directory.

Additional context
Workaround: ln -sf /dev/null /etc/kernel/install.d/51-dracut-rescue.install

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions