summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMimi Zohar <zohar@linux.ibm.com>2021-12-03 10:20:42 -0500
committerMimi Zohar <zohar@linux.ibm.com>2021-12-31 13:16:13 -0500
commit9be6dc8059bb235ffb0666690a26c0df15cc6d9e (patch)
tree50d4492062987d7a5f99b295771f74e4070c790a /tools
parentcef5cd25a453805237f0c4e789218d987d674290 (diff)
downloadlinux-9be6dc8059bb235ffb0666690a26c0df15cc6d9e.tar.gz
selftests/kexec: update searching for the Kconfig
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 <pvorel@suse.cz> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/kexec/kexec_common_lib.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/testing/selftests/kexec/kexec_common_lib.sh b/tools/testing/selftests/kexec/kexec_common_lib.sh
index 43017cfe88f7..5a1b8ae04c64 100755
--- a/tools/testing/selftests/kexec/kexec_common_lib.sh
+++ b/tools/testing/selftests/kexec/kexec_common_lib.sh
@@ -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