* [LTP] [PATCH ltp] m4/ltp-kernel_devel.m4: get LINUX_VERSION from LINUX_DIR during configure
@ 2018-06-04 6:33 Yixin Zhang
2018-06-04 11:24 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Yixin Zhang @ 2018-06-04 6:33 UTC (permalink / raw)
To: ltp
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* [LTP] [PATCH ltp] m4/ltp-kernel_devel.m4: get LINUX_VERSION from LINUX_DIR during configure
2018-06-04 6:33 [LTP] [PATCH ltp] m4/ltp-kernel_devel.m4: get LINUX_VERSION from LINUX_DIR during configure Yixin Zhang
@ 2018-06-04 11:24 ` Cyril Hrubis
2018-06-05 1:24 ` Zhang, Yixin
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2018-06-04 11:24 UTC (permalink / raw)
To: ltp
Hi!
> 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.
Looking at the m4 file for kernel-devel it seems we only use the
LINUX_VERSION in order to construct the LINUX_DIR path and the rest of
the code, i.e. include/mk/module.mk uses the LINUX_VERSION_MAJOR and
LINUX_VERSION_MINOR generated based on the LINUX_DIR.
What is the LINUX_VERSION variable needed for? It does not seem to be
used anywhere outside the m4 kernel devel file.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [PATCH ltp] m4/ltp-kernel_devel.m4: get LINUX_VERSION from LINUX_DIR during configure
2018-06-04 11:24 ` Cyril Hrubis
@ 2018-06-05 1:24 ` Zhang, Yixin
0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Yixin @ 2018-06-05 1:24 UTC (permalink / raw)
To: ltp
Hi Cyril,
I've double check the code and re-test multiple times today and you are right,
the "LINUX_VERSION" variable has nothing to do with building kernel module.
There was something wrong with my environment yesterday I think.
Please ignore this patch, thanks.
Yixin
On 2018-06-04 at 13:24:02 +0200, Cyril Hrubis wrote:
> Hi!
> > 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.
>
> Looking at the m4 file for kernel-devel it seems we only use the
> LINUX_VERSION in order to construct the LINUX_DIR path and the rest of
> the code, i.e. include/mk/module.mk uses the LINUX_VERSION_MAJOR and
> LINUX_VERSION_MINOR generated based on the LINUX_DIR.
>
> What is the LINUX_VERSION variable needed for? It does not seem to be
> used anywhere outside the m4 kernel devel file.
>
> --
> Cyril Hrubis
> chrubis@suse.cz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-05 1:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-04 6:33 [LTP] [PATCH ltp] m4/ltp-kernel_devel.m4: get LINUX_VERSION from LINUX_DIR during configure Yixin Zhang
2018-06-04 11:24 ` Cyril Hrubis
2018-06-05 1:24 ` Zhang, Yixin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox