Tools for LinuxKernel development


Some notes

You can use DistCC or ccache (or both) to speed up compilation.

The main trick is to only make ONE target on the command line. i.e. don't try and do this make -j6 CC=distcc all modules_install or else the build will get screwed up and the whole thing will get remade each time.

Instead do this:

make -j6 CC=distcc all
make modules_install INSTALL_MOD_PATH=~/tmp

To update the .config file with questions for new options do a make oldconfig

To output build files to another directory (so you don't mix source and object code) do make O=outputdir all

To make files in just one source code directory do make dir. To make the modules in a directory and link them do make M=dir. Remember to put a trailing slash after the directory name.

NB The above two may require you to have built your config etc first.

To enable extra error checks when compiling do make EXTRA_CFLAGS=-W.

A script to copy a new LinuxKernel to remote machines:

#! /bin/bash
# syntax m machine_num directory version
rm $H/tmp/lib/modules/$VER/build
rm $H/tmp/lib/modules/$VER/source
rsync $SRC/ root@jandi$1:/boot/$VER
rsync $SRC/arch/i386/boot/bzImage root@jandi$1:/boot/vmlinuz-$VER
rsync $SRC/vmlinux root@jandi$1:/boot/vmlinux-$VER
rsync -av $H/tmp/lib/modules/$VER root@jandi$1:/lib/modules

It has also been suggested to use kgdb with qemu and/or kgdboe to help with debugging.