diff options
-rw-r--r-- | documentation/kernel-dev/kernel-dev-common.xml | 67 |
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 96c7933805..784bf0b8f9 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'> | ||
666 | While it is always preferable to work with sources integrated into the Linux | ||
667 | kernel sources, if you have need of an external kernel module, the hello-mod | ||
668 | recipe is available as a template to create your own out-of-tree Linux kernel | ||
669 | module recipe. It is available in the poky repository at: | ||
670 | |||
671 | meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb | ||
672 | |||
673 | To get started, copy this recipe to your layer and provide it with a meaningful name, such as | ||
674 | mymodule_1.0.bb. In the same directory, create a directory named "files" where | ||
675 | you can store any source files, patches, or other files necessary for building | ||
676 | the module which do not come with the sources. Finally, update the recipe as | ||
677 | appropriate for the module. Typically you will need to set the following | ||
678 | variables: | ||
679 | |||
680 | o DESCRIPTION | ||
681 | o LICENSE* | ||
682 | o SRC_URI | ||
683 | o PV | ||
684 | |||
685 | Depending on the build system used by the module sources, you may need to make | ||
686 | adjustments. For example, a typical module Makefile will look much like that | ||
687 | provided 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 | |||
700 | The important point to note here is the KERNEL_SRC variable. The module bbclass | ||
701 | class sets this, as well as KERNEL_PATH, to ${STAGING_KERNEL_DIR} with the | ||
702 | necessary Linux kernel build information to build modules. If your module | ||
703 | Makefile uses a different variable, you may want to override the do_compile() | ||
704 | step, or create a patch to the Makefile to work with the more typical KERNEL_SRC | ||
705 | or KERNEL_PATH variables. | ||
706 | |||
707 | After you have prepared the recipe, you will likely want to include the module | ||
708 | in your images. To do this, see the documentation for the following variables in | ||
709 | the Yocto Project Reference Manual and set one of them as appropriate in your | ||
710 | machine config file: | ||
711 | |||
712 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS | ||
713 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS | ||
714 | MACHINE_EXTRA_RDEPENDS | ||
715 | MACHINE_EXTRA_RRECOMMENDS | ||
716 | |||
717 | As modules are often not required for boot and may be excluded from certain | ||
718 | build configurations, the following allows for the most flexibility: | ||
719 | |||
720 | MACHINE_EXTRA_RRECOMMENDS += "kernel-module-mymodule" | ||
721 | |||
722 | Where the value is derived by appending the module filename without the .ko | ||
723 | extension to the string "kernel-module-". | ||
724 | |||
725 | As it is an RRECOMMENDS (and not an RDEPENDS) variable, the build will not fail | ||
726 | if this module is not available to include in the image. | ||
727 | </literallayout> | ||
728 | </para> | ||
729 | </section> | 662 | </section> |
730 | </chapter> | 663 | </chapter> |
731 | <!-- | 664 | <!-- |