summaryrefslogtreecommitdiffstats
path: root/documentation/kernel-dev
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2013-01-14 19:59:38 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-16 15:59:20 (GMT)
commita0ac33680174f372d520a4f84b0799a6c01e8345 (patch)
tree8136450c0e3ba54d0fcdecf66049f47ea77d74f7 /documentation/kernel-dev
parentb34a14014c929b5672f6ff9f5b22a0720f5dcdc3 (diff)
downloadpoky-a0ac33680174f372d520a4f84b0799a6c01e8345.tar.gz
kernel-dev: Edits to the "Incorporating Out-of-Tree Modules" section.
Removed the original text. (From yocto-docs rev: 0f3e89c7e6b8249cd643822f33c8168ca7cd83c9) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/kernel-dev')
-rw-r--r--documentation/kernel-dev/kernel-dev-common.xml67
1 files changed, 0 insertions, 67 deletions
diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml
index 96c7933..784bf0b 100644
--- a/documentation/kernel-dev/kernel-dev-common.xml
+++ b/documentation/kernel-dev/kernel-dev-common.xml
@@ -659,73 +659,6 @@
659 a <filename>RDEPENDS</filename> variable, the build will not fail 659 a <filename>RDEPENDS</filename> variable, the build will not fail
660 if this module is not available to include in the image. 660 if this module is not available to include in the image.
661 </para> 661 </para>
662
663 <para>
664 Original Text:
665 <literallayout class='monospaced'>
666While it is always preferable to work with sources integrated into the Linux
667kernel sources, if you have need of an external kernel module, the hello-mod
668recipe is available as a template to create your own out-of-tree Linux kernel
669module recipe. It is available in the poky repository at:
670
671 meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
672
673To get started, copy this recipe to your layer and provide it with a meaningful name, such as
674mymodule_1.0.bb. In the same directory, create a directory named "files" where
675you can store any source files, patches, or other files necessary for building
676the module which do not come with the sources. Finally, update the recipe as
677appropriate for the module. Typically you will need to set the following
678variables:
679
680 o DESCRIPTION
681 o LICENSE*
682 o SRC_URI
683 o PV
684
685Depending on the build system used by the module sources, you may need to make
686adjustments. For example, a typical module Makefile will look much like that
687provided with hello-mod:
688
689 obj-m := hello.o
690
691 SRC := $(shell pwd)
692
693 all:
694 $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
695
696 modules_install:
697 $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
698 ...
699
700The important point to note here is the KERNEL_SRC variable. The module bbclass
701class sets this, as well as KERNEL_PATH, to ${STAGING_KERNEL_DIR} with the
702necessary Linux kernel build information to build modules. If your module
703Makefile uses a different variable, you may want to override the do_compile()
704step, or create a patch to the Makefile to work with the more typical KERNEL_SRC
705or KERNEL_PATH variables.
706
707After you have prepared the recipe, you will likely want to include the module
708in your images. To do this, see the documentation for the following variables in
709the Yocto Project Reference Manual and set one of them as appropriate in your
710machine config file:
711
712 MACHINE_ESSENTIAL_EXTRA_RDEPENDS
713 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS
714 MACHINE_EXTRA_RDEPENDS
715 MACHINE_EXTRA_RRECOMMENDS
716
717As modules are often not required for boot and may be excluded from certain
718build configurations, the following allows for the most flexibility:
719
720 MACHINE_EXTRA_RRECOMMENDS += "kernel-module-mymodule"
721
722Where the value is derived by appending the module filename without the .ko
723extension to the string "kernel-module-".
724
725As it is an RRECOMMENDS (and not an RDEPENDS) variable, the build will not fail
726if this module is not available to include in the image.
727 </literallayout>
728 </para>
729 </section> 662 </section>
730</chapter> 663</chapter>
731<!-- 664<!--