diff options
author | mboelen <michael@cisofy.com> | 2014-09-19 19:55:00 +0400 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2014-09-19 19:55:00 +0400 |
commit | b0e739a15dd311c2b13286b3964b8533893f09a4 (patch) | |
tree | cb6e7015d80c9013a90ae229715c9fad12b744c1 /include | |
parent | 74fc711965eefa132c5258ed4f6c2b05f7213ad2 (diff) |
Support /boot/vmlinuz-linux for Arch systems to determine kernel version
Diffstat (limited to 'include')
-rw-r--r-- | include/tests_kernel | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/tests_kernel b/include/tests_kernel index 1696d93b..d91ea124 100644 --- a/include/tests_kernel +++ b/include/tests_kernel @@ -464,6 +464,25 @@ if [ -f /boot/vmlinuz ]; then logtext "Result: found /boot/vmlinuz" ReportException "${TEST_NO}:1" "Can't determine kernel version on disk, need debug data" + elif [ -f /boot/vmlinuz-linux ]; then + logtext "Result: /found /boot/vmlinuz-linux (usually Arch Linux or similar)" + logtext "Test: checking kernel version on disk" + VERSION_ON_DISK=`file -b /boot/vmlinuz-linux | awk '{ if ($1=="Linux" && $7=="version") { print $8 }}'` + if [ ! "${VERSION_ON_DISK}" = "" ]; then + logtext "Result: found version ${VERSION_ON_DISK}" + ACTIVE_KERNEL=`uname -r` + logtext "Result: active kernel version ${ACTIVE_KERNEL}" + if [ "${VERSION_ON_DISK}" = "${ACTIVE_KERNEL}" ]; then + REBOOT_NEEDED=0 + logtext "Result: no reboot needed, active kernel is the same version as the one on disk" + else + REBOOT_NEEDED=1 + logtext "Result: reboot needed, as there is a difference between active kernel and the one on disk" + fi + else + logtext "Result: could not find the version on disk" + ReportException "${TEST_NO}:4" "Could not find the kernel version from /boot/vmlinux-linux" + fi else logtext "Result: /boot/vmlinuz not on disk, trying to find /boot/vmlinuz*" FIND=`ls /boot/vmlinuz* 2> /dev/null` |