Skip to content

Commit

Permalink
selftests/kexec: update searching for the Kconfig
Browse files Browse the repository at this point in the history
First check /lib/modules/`uname -r`/config, before using the IKCONFIG.
In addition, the configs.ko might be compressed.  Fix the configs.ko
name.

Reviewed-by: Petr Vorel <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
  • Loading branch information
mimizohar committed Dec 31, 2021
1 parent cef5cd2 commit 9be6dc8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tools/testing/selftests/kexec/kexec_common_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,20 @@ kconfig_enabled()
return 0
}

# Attempt to get the kernel config first via proc, and then by
# extracting it from the kernel image or the configs.ko using
# scripts/extract-ikconfig.
# Attempt to get the kernel config first by checking the modules directory
# then via proc, and finally by extracting it from the kernel image or the
# configs.ko using scripts/extract-ikconfig.
# Return 1 for found.
get_kconfig()
{
local proc_config="/proc/config.gz"
local module_dir="/lib/modules/`uname -r`"
local configs_module="$module_dir/kernel/kernel/configs.ko"
local configs_module="$module_dir/kernel/kernel/configs.ko*"

if [ -f $module_dir/config ]; then
IKCONFIG=$module_dir/config
return 1
fi

if [ ! -f $proc_config ]; then
modprobe configs > /dev/null 2>&1
Expand Down

0 comments on commit 9be6dc8

Please sign in to comment.