X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=Documentation%2Fkbuild%2Fmodules.txt;h=1821c077b435cd64eac847dc1ec69d5386dc6ad6;hb=2cb5998b5f0ccc886fdda3509059eef297b49577;hp=2e7702e94a786c0942c91134da25fef40ecc07b4;hpb=a12f66fccf2e266ad197df142b5ebafc6a169a8c;p=linux-2.6-omap-h63xx.git diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt index 2e7702e94a7..1821c077b43 100644 --- a/Documentation/kbuild/modules.txt +++ b/Documentation/kbuild/modules.txt @@ -43,7 +43,7 @@ are not planned to be included in the kernel tree. What is covered within this file is mainly information to authors of modules. The author of an external module should supply a makefile that hides most of the complexity, so one only has to type -'make' to build the module. A complete example will be present in +'make' to build the module. A complete example will be presented in chapter 4, "Creating a kbuild file for an external module". @@ -61,6 +61,7 @@ when building an external module. make -C M=`pwd` For the running kernel use: + make -C /lib/modules/`uname -r`/build M=`pwd` For the above command to succeed, the kernel must have been @@ -130,10 +131,10 @@ when building an external module. To make sure the kernel contains the information required to build external modules the target 'modules_prepare' must be used. - 'module_prepare' exists solely as a simple way to prepare + 'modules_prepare' exists solely as a simple way to prepare a kernel source tree for building external modules. Note: modules_prepare will not build Module.symvers even if - CONFIG_MODULEVERSIONING is set. Therefore a full kernel build + CONFIG_MODVERSIONS is set. Therefore a full kernel build needs to be executed to make module versioning work. --- 2.5 Building separate files for a module @@ -248,7 +249,7 @@ following files: --> filename: Makefile KERNELDIR := /lib/modules/`uname -r`/build all:: - $(MAKE) -C $KERNELDIR M=`pwd` $@ + $(MAKE) -C $(KERNELDIR) M=`pwd` $@ # Module specific targets genbin: @@ -450,7 +451,7 @@ kernel refuses to load the module. Module.symvers contains a list of all exported symbols from a kernel build. ---- 7.1 Symbols fron the kernel (vmlinux + modules) +--- 7.1 Symbols from the kernel (vmlinux + modules) During a kernel build, a file named Module.symvers will be generated. Module.symvers contains all exported symbols from the kernel and @@ -485,7 +486,7 @@ Module.symvers contains a list of all exported symbols from a kernel build. Sometimes, an external module uses exported symbols from another external module. Kbuild needs to have full knowledge on all symbols to avoid spitting out warnings about undefined symbols. - Two solutions exist to let kbuild know all symbols of more than + Three solutions exist to let kbuild know all symbols of more than one external module. The method with a top-level kbuild file is recommended but may be impractical in certain situations. @@ -522,6 +523,13 @@ Module.symvers contains a list of all exported symbols from a kernel build. containing the sum of all symbols defined and not part of the kernel. + Use make variable KBUILD_EXTRA_SYMBOLS in the Makefile + If it is impractical to copy Module.symvers from another + module, you can assign a space separated list of files to + KBUILD_EXTRA_SYMBOLS in your Makfile. These files will be + loaded by modpost during the initialisation of its symbol + tables. + === 8. Tips & Tricks --- 8.1 Testing for CONFIG_FOO_BAR