search in /lib/modules/$(uname -r) for vmlinuz, config, System.map

On Fedora machines /lib/modules/$(uname -r) has all the files.
This commit is contained in:
Harald Hoyer 2018-01-19 12:35:16 +01:00 committed by Stéphane Lesimple
parent 14ca49a042
commit ccc0453df7

View File

@ -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