Re: [PATCH 5/5] kbuild: external module build doc

Jari Ruusu
2004-06-15T19:20:26Z

Sam Ravnborg wrote:
> --- /dev/null Wed Dec 31 16:00:00 196900
> +++ b/Documentation/kbuild/extmodules.txt 2004-06-14 22:25:21 +02:00
[snip]
> +A more advanced example
> +- - - - - - - - - - - -
> +This example shows a setup where a distribution has wisely decided
> +to separate kernel source and output files:
> +
> +Kernel src:
> +/usr/src/linux-<kernel-version>/
> +
> +Output from a kernel compile, including .config:
> +/lib/modules/linux-<kernel-version>/build/
^^^^^
Wrong! The 'build' symlink has always pointed to kernel source dir in
separate source and object directory case. Maybe you meant:

Output from a kernel compile, including .config:
/lib/modules/linux-<kernel-version>/object/
^^^^^^
> +External module to be compiled:
> +/home/user/module/src/
> +
> +To compile the module located in the directory above use the
> +following command:
> +
> + cd /home/user/module/src
> + make -C /usr/src/linux-<kernel-version> \
> + O=/lib/modules/linux-<kernel-version>/build \
^^^^^
O=/lib/modules/linux-<kernel-version>/object
^^^^^^
> + M=`pwd`
> +
> +Then to install the module use the following command:
> +
> + make -C /usr/src/linux-<kernel-version> \
> + O=/lib/modules/linux-<kernel-version>/build \
^^^^^
O=/lib/modules/linux-<kernel-version>/object
^^^^^^
> + M='pwd` modules_install
[snip]
> +Prepare the kernel for building external modules
> +------------------------------------------------
> +When building external modules the kernel is expected to be prepared.
> +This includes the precense of certain binaries, the kernel configuration
> +and the symlink to include/asm.
> +To do this a convinient target is made:
> +
> + make modules_prepare
> +
> +For a typical distribution this would look like the follwoing:
> +
> + make modules_prepare O=/lib/modules/linux-<kernel version>/build
^^^^^
make modules_prepare O=/lib/modules/linux-<kernel version>/object
^^^^^^
Sam, You don't seem to have any idea how much breakage you introduce if you
insist on redirecting the 'build' symlink from source tree to object tree.

--
Jari Ruusu 1024R/3A220F51 5B 4B F9 BB D3 3F 52 E9 DB 1D EB E3 24 0E A9 DD