CRUX : Home

Home :: Documentation :: Download :: Development :: Community :: Wiki :: Ports :: Bugs :: Links :: About

Back to wiki start page

Categories: General

Building a Kernel


James Mills


This is covered also in the latest copy of the handbook available at the Main Documentation Page.

Obtaining Source

By default, a kernel source will be installed to /usr/src/linux-<version> . Newer sources, however, may be available for download at . Download the sources and place the tarball in /usr/src/ .


Extract the tarball and configure options relating to your system. configuration is done using "make menuconfig" * :

$ tar jxvf linux-<VERSION>.tar.bz2
$ cd linux-<VERSION>
$ make menuconfig

As an alternative to starting from scratch, before running "make menuconfig," you may obtain the current working configuration file by using the "zcat" command. This is available if proc support is compiled into the currently running kernel:

$ zcat /proc/config.gz > .config
$ make menuconfig

Compiling and Installation

Once the configuration is complete, the "make" command will compile a working kernel image and install modules onto the system:

$ make all
$ make modules_install

Once complete, the image should be moved to a more appropriate location (commonly in /boot), with a name of your choosing:

$ cp arch/x86/boot/bzImage /boot/bzImage-<VERSION>

Updating Boot Loader

To finish the process, the boot must be updated before rebooting the system. If using lilo, remember to issue the "lilo" command after editing /etc/lilo.conf:

$ lilo
$ reboot