VMLINUZ="/boot/Image-${KVERSION}"
fi
fi
- else
- VMLINUZ=$(find /boot/vmlinuz-* -type f 2> /dev/null | tail -1)
- ! [ -f "$VMLINUZ" ] && VMLINUZ=$(find /lib/modules/ -type f -name vmlinuz 2> /dev/null | tail -1)
fi
+ ! [ -f "${VMLINUZ-}" ] && VMLINUZ=$(find /boot/vmlinuz-* -type f 2> /dev/null | tail -1)
+ ! [ -f "${VMLINUZ-}" ] && VMLINUZ=$(find /lib/modules/ -type f -name vmlinuz 2> /dev/null | tail -1)
+
if ! [ -f "$VMLINUZ" ]; then
echo "Could not find a Linux kernel version to test with!" >&2
echo "Please install linux." >&2
# only set -kernel if -initrd is specified
if [[ $* == *-initrd* ]]; then
+ for arg in "$@"; do
+ [[ $1 == *-initrd* ]] && break
+ done
+
+ KVERSION=$(lsinitrd "$arg" | grep modules.dep | head -1 | rev | cut -d'/' -f2 | rev)
set_vmlinux_env
ARGS+=(-kernel "$VMLINUZ")
fi