Lines Matching +full:sub +full:- +full:modules
1 // -*- mode:doc; -*-
4 === Infrastructure for packages building kernel modules
7 build and install Linux kernel modules. Some packages only contain a kernel
9 modules. Buildroot's helper infrastructure supports either case.
11 [[kernel-module-tutorial]]
12 ==== +kernel-module+ tutorial
17 ----
25 08: FOO_SOURCE = foo-$(FOO_VERSION).tar.xz
27 10: FOO_LICENSE = GPL-2.0
30 13: $(eval $(kernel-module))
31 14: $(eval $(generic-package))
32 ----
34 Lines 7-11 define the usual meta-data to specify the version, archive name,
37 On line 13, we invoke the +kernel-module+ helper infrastructure, that
42 xref:generic-package-tutorial[+generic-package+ infrastructure].
51 executables...). Using the +kernel-module+ infrastructure on its own is
56 ----
64 08: FOO_SOURCE = foo-$(FOO_VERSION).tar.xz
66 10: FOO_LICENSE = GPL-2.0
74 18: FOO_CONF_OPTS = --enable-bar
77 21: FOO_CONF_OPTS = --disable-bar
80 24: $(eval $(kernel-module))
81 26: $(eval $(autotools-package))
82 ----
84 Here, we see that we have an autotools-based package, that also builds
85 the kernel module located in sub-directory +driver/base+ and, if libbar
86 is enabled, the kernel module located in sub-directory +driver/bar+, and
91 [[kernel-module-reference]]
92 ==== +kernel-module+ reference
94 The main macro for the kernel module infrastructure is +kernel-module+.
95 Unlike other package infrastructures, it is not stand-alone, and requires
96 any of the other +*-package+ macros be called after it.
98 The +kernel-module+ macro defines post-build and post-target-install
99 hooks to build the kernel modules. If the package's +.mk+ needs access
100 to the built kernel modules, it should do so in a post-build hook,
101 *registered after* the call to +kernel-module+. Similarly, if the
103 installed, it should do so in a post-install hook, *registered after*
104 the call to +kernel-module+. Here's an example:
106 ----
107 $(eval $(kernel-module))
114 $(eval $(generic-package))
115 ----
118 +host-kernel-module+ variant to build a host kernel module.
123 * +FOO_MODULE_SUBDIRS+ may be set to one or more sub-directories (relative
124 to the package source top-directory) where the kernel module sources are.
131 [[kernel-variables]]
140 retrieved with running `make -C $(LINUX_DIR) kernelrelease`