Skip to content

Commit

Permalink
fix(kernel-install): do not generate an initrd when one was specified
Browse files Browse the repository at this point in the history
According to the synopsis, kernel-install can be called with an
already-prepared initrd. In that case, no initrd should be generated by dracut.

(Cherry-picked commit 0b72cf5c4eca0e0db76e3e210cfdc48e6b49bb74 from PR#1825)
  • Loading branch information
keszybz authored and pvalena committed Jun 28, 2024
1 parent c6d18c3 commit 1bd8195
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions install.d/50-dracut.install
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
INITRD_OPTIONS_SHIFT=4

# If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory.
# In this case, do not create the initrd.
Expand Down Expand Up @@ -34,6 +35,9 @@ ret=0

case "$COMMAND" in
add)
# If the initrd was provided on the kernel command line, we shouldn't generate our own.
[ "$#" -gt "$INITRD_OPTIONS_SHIFT" ] && exit 0

if [[ $IMAGE == "uki.efi" ]]; then
IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/uki.efi
else
Expand Down

0 comments on commit 1bd8195

Please sign in to comment.