From: sam@ravnborg.org
To: linux-kernel@vger.kernel.org
Cc: "Robert P. J. Day" <rpjday@mindspring.com>,
Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH 24/28] kbuild: fixup Documentation/kbuild/modules.txt
Date: Sun, 24 Sep 2006 23:18:20 +0200 [thread overview]
Message-ID: <11591327063733-git-send-email-sam@ravnborg.org> (raw)
In-Reply-To: <11591327063625-git-send-email-sam@ravnborg.org>
From: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
Documentation/kbuild/modules.txt | 46 +++++++++++++++++++-------------------
1 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt
index a2a178d..2e7702e 100644
--- a/Documentation/kbuild/modules.txt
+++ b/Documentation/kbuild/modules.txt
@@ -24,7 +24,7 @@ In this document you will find informati
--- 6.1 INSTALL_MOD_PATH
--- 6.2 INSTALL_MOD_DIR
=== 7. Module versioning & Module.symvers
- --- 7.1 Symbols fron the kernel (vmlinux + modules)
+ --- 7.1 Symbols from the kernel (vmlinux + modules)
--- 7.2 Symbols and external modules
--- 7.3 Symbols from another external module
=== 8. Tips & Tricks
@@ -63,14 +63,15 @@ when building an external module.
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 built with
- modules enabled.
+ For the above command to succeed, the kernel must have been
+ built with modules enabled.
To install the modules that were just built:
make -C <path-to-kernel> M=`pwd` modules_install
- More complex examples later, the above should get you going.
+ More complex examples will be shown later, the above should
+ be enough to get you started.
--- 2.2 Available targets
@@ -89,13 +90,13 @@ when building an external module.
Same functionality as if no target was specified.
See description above.
- make -C $KDIR M=$PWD modules_install
+ make -C $KDIR M=`pwd` modules_install
Install the external module(s).
Installation default is in /lib/modules/<kernel-version>/extra,
but may be prefixed with INSTALL_MOD_PATH - see separate
chapter.
- make -C $KDIR M=$PWD clean
+ make -C $KDIR M=`pwd` clean
Remove all generated files for the module - the kernel
source directory is not modified.
@@ -129,23 +130,22 @@ 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' solely exists as a simple way to prepare
- a kernel for building external modules.
+ 'module_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 needs to be executed to make
- module versioning work.
+ CONFIG_MODULEVERSIONING is set. Therefore a full kernel build
+ needs to be executed to make module versioning work.
--- 2.5 Building separate files for a module
It is possible to build single files which are part of a module.
- This works equal for the kernel, a module and even for external
- modules.
+ This works equally well for the kernel, a module and even for
+ external modules.
Examples (module foo.ko, consist of bar.o, baz.o):
make -C $KDIR M=`pwd` bar.lst
make -C $KDIR M=`pwd` bar.o
make -C $KDIR M=`pwd` foo.ko
make -C $KDIR M=`pwd` /
-
+
=== 3. Example commands
@@ -177,7 +177,7 @@ Then, to install the module use the foll
M=`pwd` \
modules_install
-If one looks closely you will see that this is the same commands as
+If you look closely you will see that this is the same command as
listed before - with the directories spelled out.
The above are rather long commands, and the following chapter
@@ -311,7 +311,7 @@ following files:
Include files are a necessity when a .c file uses something from other .c
files (not strictly in the sense of C, but if good programming practice is
used). Any module that consists of more than one .c file will have a .h file
-for one of the .c files.
+for one of the .c files.
- If the .h file only describes a module internal interface, then the .h file
shall be placed in the same directory as the .c files.
@@ -368,13 +368,13 @@ directory and therefore need to deal wit
handle this too.
Consider the following example:
-
+
|
+- src/complex_main.c
| +- hal/hardwareif.c
| +- hal/include/hardwareif.h
+- include/complex.h
-
+
To build a single module named complex.ko, we then need the following
kbuild file:
@@ -462,12 +462,12 @@ Module.symvers contains a list of all ex
Sample:
0x2d036834 scsi_remove_host drivers/scsi/scsi_mod
- For a kernel build without CONFIG_MODVERSIONING enabled, the crc
+ For a kernel build without CONFIG_MODVERSIONS enabled, the crc
would read: 0x00000000
Module.symvers serves two purposes:
1) It lists all exported symbols both from vmlinux and all modules
- 2) It lists the CRC if CONFIG_MODVERSION is enabled
+ 2) It lists the CRC if CONFIG_MODVERSIONS is enabled
--- 7.2 Symbols and external modules
@@ -479,7 +479,7 @@ Module.symvers contains a list of all ex
the external module is being built, this file will be read too.
During the MODPOST step, a new Module.symvers file will be written
containing all exported symbols that were not defined in the kernel.
-
+
--- 7.3 Symbols from another external module
Sometimes, an external module uses exported symbols from another
@@ -499,7 +499,7 @@ Module.symvers contains a list of all ex
./foo/ <= contains the foo module
./bar/ <= contains the bar module
The top-level Kbuild file would then look like:
-
+
#./Kbuild: (this file may also be named Makefile)
obj-y := foo/ bar/
@@ -521,7 +521,7 @@ Module.symvers contains a list of all ex
build is finished, a new Module.symvers file is created
containing the sum of all symbols defined and not part of the
kernel.
-
+
=== 8. Tips & Tricks
--- 8.1 Testing for CONFIG_FOO_BAR
--
1.4.1
next prev parent reply other threads:[~2006-09-24 22:16 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-24 21:17 [PATCH 1/28] kconfig: support DOS line endings sam
2006-09-24 21:17 ` [PATCH 2/28] kbuild: consistently decide when to rebuild a target sam
2006-09-24 21:17 ` [PATCH 3/28] kbuild: add unifdef sam
2006-09-24 21:18 ` [PATCH 4/28] kbuild: replace use of strlcpy with a dedicated implmentation in unifdef sam
2006-09-24 21:18 ` [PATCH 5/28] kbuild: use in-kernel unifdef sam
2006-09-24 21:18 ` [PATCH 6/28] remove RPM_BUILD_ROOT from asm-offsets.h sam
2006-09-24 21:18 ` [PATCH 7/28] kconfig: linguistic fixes for Documentation/kbuild/kconfig-language.txt sam
2006-09-24 21:18 ` [PATCH 8/28] kbuild: linguistic fixes for Documentation/kbuild/modules.txt sam
2006-09-24 21:18 ` [PATCH 9/28] kbuild: linguistic fixes for Documentation/kbuild/makefiles.txt sam
2006-09-24 21:18 ` [PATCH 10/28] kbuild: ignore references from ".pci_fixup" to ".init.text" sam
2006-09-24 21:18 ` [PATCH 11/28] kbuild: modpost on vmlinux regardless of CONFIG_MODULES sam
2006-09-24 21:18 ` [PATCH 12/28] kbuild: make V=2 tell why a target is rebuild sam
2006-09-24 21:18 ` [PATCH 13/28] kbuild: make -rR is now default sam
2006-09-24 21:18 ` [PATCH 14/28] kbuild: preperly align SYSMAP output sam
2006-09-24 21:18 ` [PATCH 15/28] kbuild: add missing return statement in modpost.c:secref_whitelist() sam
2006-09-24 21:18 ` [PATCH 16/28] kbuild: create output directory for hostprogs with O=.. build sam
2006-09-24 21:18 ` [PATCH 17/28] kbuild: remove debug left-over from Makefile.host sam
2006-09-24 21:18 ` [PATCH 18/28] kbuild: fail kernel compilation in case of unresolved module symbols sam
2006-09-24 21:18 ` [PATCH 19/28] kbuild: update help in top level Makefile sam
2006-09-24 21:18 ` [PATCH 20/28] Documentaion: update Documentation/Changes with minimum versions sam
2006-09-24 21:18 ` [PATCH 21/28] kbuild: clarify "make C=" build option sam
2006-09-24 21:18 ` [PATCH 22/28] kbuild: fix for some typos in Documentation/makefiles.txt sam
2006-09-24 21:18 ` [PATCH 23/28] kbuild: Extend kbuild/defconfig tags support to exuberant ctags sam
2006-09-24 21:18 ` sam [this message]
2006-09-24 21:18 ` [PATCH 25/28] kbuild: correct and clarify versioning info in Makefile sam
2006-09-24 21:18 ` [PATCH 26/28] kbuild: fix "mkdir -p" usage in scripts/package/mkspec sam
2006-09-24 21:18 ` [PATCH 27/28] dontdiff: add utsrelease.h sam
2006-09-24 21:18 ` [PATCH 28/28] kbuild: add distclean info to 'make help' and more details for 'clean' sam
2006-09-24 22:20 ` [PATCH 18/28] kbuild: fail kernel compilation in case of unresolved module symbols Al Viro
2006-09-24 22:35 ` Sam Ravnborg
2006-09-24 22:36 ` Al Viro
2006-09-24 22:47 ` Sam Ravnborg
2006-09-24 22:48 ` Al Viro
2006-09-25 6:24 ` [PATCH 13/28] kbuild: make -rR is now default Jan Engelhardt
2006-09-25 18:02 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11591327063733-git-send-email-sam@ravnborg.org \
--to=sam@ravnborg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rpjday@mindspring.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox