mirror of
https://github.com/speed47/spectre-meltdown-checker
synced 2025-01-03 18:15:57 +01:00
feat: enhance kernel image version detection for some old kernels
This commit is contained in:
parent
2f6a6554a2
commit
d2f46740e9
@ -1004,6 +1004,10 @@ if [ -z "$vmlinux" ] || [ ! -r "$vmlinux" ]; then
|
|||||||
[ -z "$vmlinux_err" ] && vmlinux_err="couldn't extract your kernel from $opt_kernel"
|
[ -z "$vmlinux_err" ] && vmlinux_err="couldn't extract your kernel from $opt_kernel"
|
||||||
else
|
else
|
||||||
vmlinux_version=$(strings "$vmlinux" 2>/dev/null | grep '^Linux version ' | head -1)
|
vmlinux_version=$(strings "$vmlinux" 2>/dev/null | grep '^Linux version ' | head -1)
|
||||||
|
if [ -z "$vmlinux_version" ]; then
|
||||||
|
# try harder with some kernels (such as Red Hat) that don't have ^Linux version before their version string
|
||||||
|
vmlinux_version=$(strings "$vmlinux" 2>/dev/null | grep -E '^[[:alnum:]][^[:space:]]+ \([^[:space:]]+\) #[0-9]+ .+ (19|20)[0-9][0-9]$' | head -1)
|
||||||
|
fi
|
||||||
if [ -n "$vmlinux_version" ]; then
|
if [ -n "$vmlinux_version" ]; then
|
||||||
# in live mode, check if the img we found is the correct one
|
# in live mode, check if the img we found is the correct one
|
||||||
if [ "$opt_live" = 1 ]; then
|
if [ "$opt_live" = 1 ]; then
|
||||||
@ -1015,6 +1019,8 @@ else
|
|||||||
else
|
else
|
||||||
_info "Kernel image is \033[35m$vmlinux_version"
|
_info "Kernel image is \033[35m$vmlinux_version"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
_verbose "Kernel image version is unknown"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user