From 6d9b530bf493e83c423c7c4058b4bbb44a85db46 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sun, 21 Jun 2020 13:14:08 +0200 Subject: [PATCH] [KRNL-5830] improved detection for non-symlinked kernel on disk --- include/tests_kernel | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/tests_kernel b/include/tests_kernel index 72e5082b..d445bb65 100644 --- a/include/tests_kernel +++ b/include/tests_kernel @@ -674,7 +674,10 @@ LogText "Result: found a symlink, retrieving destination" FOUND_VMLINUZ=$(readlink "${FOUND_VMLINUZ}") LogText "Result: destination file is ${FOUND_VMLINUZ}" - VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's/^vmlinuz-//') + VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's#^/boot/##' | ${SEDBINARY} 's/^vmlinuz-//') + LogText "Result: version derived from file name is '${VERSION_ON_DISK}'" + elif [ -f "${FOUND_VMLINUZ}" ]; then + VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's#^/boot/##' | ${SEDBINARY} 's/^vmlinuz-//') LogText "Result: version derived from file name is '${VERSION_ON_DISK}'" fi