diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install index efb184cd..3907e303 100755 --- a/install.d/50-dracut.install +++ b/install.d/50-dracut.install @@ -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. @@ -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