public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: linux-integrity@vger.kernel.org
Cc: Petr Vorel <pvorel@suse.cz>,
	Nageswara Sastry <rnsastry@linux.ibm.com>,
	Mimi Zohar <zohar@linux.ibm.com>, Takashi Iwai <tiwai@suse.de>,
	Joey Lee <jlee@suse.com>, Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v1 2/2] selftests/kexec: update searching for the Kconfig
Date: Wed, 22 Dec 2021 16:30:52 -0500	[thread overview]
Message-ID: <20211222213052.6771-3-zohar@linux.ibm.com> (raw)
In-Reply-To: <20211222213052.6771-1-zohar@linux.ibm.com>

First check /lib/modules/`uname -r`/config, before using the IKCONFIG.
In addition, the configs.ko might be compressed.  Fix the configs.ko
name.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
---
Distros: is storing the Kconfig in /lib/modules/`uname -r`/config common?

 tools/testing/selftests/kexec/kexec_common_lib.sh | 13 +++++++++----
 1 file 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
-- 
2.27.0


  parent reply	other threads:[~2021-12-22 21:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 21:30 [PATCH v1 0/2] selftest/kexec: minor update to the existing test Mimi Zohar
2021-12-22 21:30 ` [PATCH v1 1/2] selftest/kexec: fix "ignored null byte in input" warning Mimi Zohar
2021-12-23  8:41   ` Petr Vorel
2021-12-22 21:30 ` Mimi Zohar [this message]
2021-12-23  8:35   ` [PATCH v1 2/2] selftests/kexec: update searching for the Kconfig Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211222213052.6771-3-zohar@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=jlee@suse.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pvorel@suse.cz \
    --cc=rnsastry@linux.ibm.com \
    --cc=shuah@kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox