From 9f979fc9486af3c7c924d3f9f837f06616c61829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 18 Jan 2022 18:58:58 +0100 Subject: [PATCH 02/23] fix(kernel-install): do not generate an initrd when one was specified 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) --- install.d/50-dracut.install | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.42.0