Diff of /doc/build-system-guide.txt [e05a5d] .. [f3b989]  Maximize  Restore

  Switch to side-by-side view

--- a/doc/build-system-guide.txt
+++ b/doc/build-system-guide.txt
@@ -73,6 +73,48 @@
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
+Kernel Modules
+Some of the tests need to build kernel modules, happily LTP has
+infrastructure for this.
+ifneq ($(KERNELRELEASE),)
+obj-m := module01.o
+top_srcdir	?= ../../../..
+include $(top_srcdir)/include/mk/testcases.mk
+MAKE_TARGETS		:= test01 test02 module01.ko
+include $(top_srcdir)/include/mk/module.mk
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
+This is example Makefile that allows you build kernel modules inside of LTP.
+The prerequisities for the build are detected by the 'configure' script.
+The 'REQ_VERSION_MAJOR' and 'REQ_VERSION_PATCH' describe minimal kernel
+version for which the build system tries to build the module.
+The buildsystem is also forward compatible with changes in Linux kernel
+internal API so that if modul fails to build the failure is ignored both on
+build and installation. If the userspace counterpart of the test fails to load
+the module because the file does not exists, the test is skipped.
+Note the 'ifneq($(KERNELRELEASE),)', the reason it's there is that the
+Makefile is executed twice, once by LTP build system and once by kernel
+kbuild, see 'Documentation/kbuild/modules.txt' in the Linux kernel tree for
+details on external module build.
 Make Rules and Make Variables