[LTP] [PATCH ltp] m4/ltp-kernel_devel.m4: get LINUX_VERSION from LINUX_DIR during configure

Yixin Zhang yixin.zhang@intel.com
Mon Jun 4 08:33:06 CEST 2018


If LINUX_DIR is given, get LINUX_VERSION for kernel source code instead
of `uname -r`. So when we need to build .ko with a kernel differernt
than the one on current host PC, we only need to provide
"--with-linux-dir", and LINUX_VERSION will be generated automatically.

Signed-off-by: Yixin Zhang <yixin.zhang@intel.com>
---
 m4/ltp-kernel_devel.m4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/m4/ltp-kernel_devel.m4 b/m4/ltp-kernel_devel.m4
index 1c4e71f73..477a34aa9 100644
--- a/m4/ltp-kernel_devel.m4
+++ b/m4/ltp-kernel_devel.m4
@@ -47,6 +47,7 @@ AC_ARG_WITH([linux-dir],
 AC_SUBST(LINUX_DIR)
 
 if test -f "$LINUX_DIR/Makefile"; then
+	LINUX_VERSION=`make -C ${LINUX_DIR} -s kernelversion`
 	LINUX_VERSION_MAJOR=`make -C ${LINUX_DIR} -s kernelversion | cut -d. -f1`
 	LINUX_VERSION_PATCH=`make -C ${LINUX_DIR} -s kernelversion | cut -d. -f2`
 fi
-- 
2.14.1



More information about the ltp mailing list