# Pack up $INITRD into a top-level initrd.gz, and copy out vmlinuz
find $INITRD -not -name udebs -printf '%P\n' | \
fakeroot cpio -o -H newc -D $INITRD | gzip > $TARGET_ARCH/initrd.gz
-VMLINUZ=$INITRD/boot/vmlinuz-$KERNELVERSION
+VMLINUZ="$INITRD/boot/vmlinuz-$KERNELVERSION"
+[ -r "$VMLINUZ" ] || VMLINUZ="$INITRD/boot/vmlinuz"
+[ -r "$VMLINUZ" ] || VMLINUZ="$INITRD/boot/vmlinux-$KERNELVERSION"
+[ -r "$VMLINUZ" ] || VMLINUZ="$INITRD/boot/vmlinux"
+cp $VMLINUZ $TARGET_ARCH/ && ln -sTf "${VMLINUZ#***/}" $TARGET_ARCH/kernel
#-- Note that this renames it to vmlinuz regarless of its real name
#-- Eg the riscv64 kernel is actually not compressed
-cp $VMLINUZ $TARGET_ARCH/vmlinuz
-