diff mbox series

lib/tst_kconfig.c: supplement config path

Message ID 1636427858-2182-1-git-send-email-xuyang2018.jy@fujitsu.com
State Accepted
Headers show
Series lib/tst_kconfig.c: supplement config path | expand

Commit Message

Yang Xu \(Fujitsu\) Nov. 9, 2021, 3:17 a.m. UTC
We should add /lib/modules/$(uname -r)/build/.config for parsing.
So we can avoid parsing not-found-error when using our own compiled kernel.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 lib/tst_kconfig.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Cyril Hrubis Nov. 9, 2021, 11:08 a.m. UTC | #1
Hi!
Applied, good catch, thanks.
diff mbox series

Patch

diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
index 5af67b0a5..d433b8cf6 100644
--- a/lib/tst_kconfig.c
+++ b/lib/tst_kconfig.c
@@ -32,6 +32,12 @@  static const char *kconfig_path(char *path_buf, size_t path_buf_len)
 
 	uname(&un);
 
+	/* Common install module path */
+	snprintf(path_buf, path_buf_len, "/lib/modules/%s/build/.config", un.release);
+
+	if (!access(path_buf, F_OK))
+		return path_buf;
+
 	/* Debian and derivatives */
 	snprintf(path_buf, path_buf_len, "/boot/config-%s", un.release);