public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] How to build LTP for a kernel different than the one on the building machine?
@ 2018-05-15  3:29 Zhang, Yixin
  2018-05-15 10:41 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Yixin @ 2018-05-15  3:29 UTC (permalink / raw)
  To: ltp

Hello,

I'm trying to run LTP in my test environment, after some investigation I've one question on the building processes of LTP. When building some of the test cases binary, it need to access the kernel header, some of which may changes between different kernel version. So is there a way to build LTP on the building machine with kernel, say v4.14, for a test machine with test target v4.16? 

In the configure file I see below line about "--with-linux-dir" and "LINUX_DIR":
6280 # Check whether --with-linux-dir was given.
6281 if test "${with_linux_dir+set}" = set; then :
6282   withval=$with_linux_dir; LINUX_DIR="${withval}"
6283 else
6284   if test -n "$LINUX_VERSION"; then :
6285   LINUX_DIR="/lib/modules/$LINUX_VERSION/build"
6286 fi
6287 fi

And "LINUX_DIR" is used in and only in "include/mk/module.mk":
56 %.ko: %.c .dep_modules ;
57
58 .dep_modules: $(MODULE_SOURCES)
59     @echo "Building modules: $(MODULE_SOURCES)"
60     -$(MAKE) -C $(LINUX_DIR) M=$(abs_srcdir)
61     rm -rf *.mod.c *.o *.ko.unsigned modules.order .tmp* .*.ko .*.cmd Module.symvers
62     @touch .dep_modules

So the question is, beside kernel module, is there any other cases also need kernel headers? If there is, or I want to add some cases which is sensitive to kernel header version, how should I create a Makefile for that? And how should I build such a test binary when the building machine has a kernel version different than the test machine? 
Thanks all:)

Yixin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-16  9:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-15  3:29 [LTP] How to build LTP for a kernel different than the one on the building machine? Zhang, Yixin
2018-05-15 10:41 ` Cyril Hrubis
2018-05-16  9:53   ` Zhang, Yixin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox