Linux module compilation

TJ ubuntu at
Fri Nov 30 21:16:13 UTC 2007

See the Wiki page

The first stanza gives an example of building out-of-tree for a
particular flavour.

My usual procedure is:

1.) Clean the build tree
make O=../build ARCH=<arch> [SUBARCH=<subarch>] mrproper

2.) Base Configure
make O=../build ARCH=<arch> [SUBARCH=<subarch>] defconfig

cat debian/config/<arch>/config{,.generic} > ../build/.config
make O=../build ARCH=<arch> [SUBARCH=<subarch>] oldconfig

3.) Build kernel
make O=../build ARCH=<arch> [SUBARCH=<subarch>]

for User-Mode Linux
make O=../build ARCH=um [SUBARCH=<subarch>] linux
make O=../build ARCH=um [SUBARCH=<subarch>] modules
strip -S ../build/linux

4.) Install kernel and modules
sudo make O=../build ARCH=um [SUBARCH=<subarch>] INSTALL_MOD_PATH=/
sudo cp ../build/vmlinux /boot/vmlinuz-<version>


More information about the kernel-team mailing list