From ccc0453df73150b3f50b47ab343561e44ceed639 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jan 2018 12:35:16 +0100 Subject: [PATCH] search in /lib/modules/$(uname -r) for vmlinuz, config, System.map On Fedora machines /lib/modules/$(uname -r) has all the files. --- spectre-meltdown-checker.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index ea19de0..fc09ef4 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -586,6 +586,7 @@ if [ "$opt_live" = 1 ]; then fi # if we didn't find a kernel, default to guessing if [ ! -e "$opt_kernel" ]; then + [ -e /lib/modules/$(uname -r)/vmlinuz ] && opt_kernel=/lib/modules/$(uname -r)/vmlinuz [ -e /boot/vmlinuz ] && opt_kernel=/boot/vmlinuz [ -e /boot/vmlinuz-linux ] && opt_kernel=/boot/vmlinuz-linux [ -e /boot/vmlinuz-linux-libre ] && opt_kernel=/boot/vmlinuz-linux-libre @@ -599,6 +600,8 @@ if [ "$opt_live" = 1 ]; then # system.map if [ -e /proc/kallsyms ] ; then opt_map="/proc/kallsyms" + elif [ -e /lib/modules/$(uname -r)/System.map ] ; then + opt_map=/lib/modules/$(uname -r)/System.map elif [ -e /boot/System.map-$(uname -r) ] ; then opt_map=/boot/System.map-$(uname -r) fi @@ -609,6 +612,8 @@ if [ "$opt_live" = 1 ]; then gunzip -c /proc/config.gz > $dumped_config # dumped_config will be deleted at the end of the script opt_config=$dumped_config + elif [ -e /lib/modules/$(uname -r)/config ]; then + opt_config=/lib/modules/$(uname -r)/config elif [ -e /boot/config-$(uname -r) ]; then opt_config=/boot/config-$(uname -r) fi