Kernel configuration

From LFScript
Revision as of 22:38, 31 January 2012 by Marcel (talk | contribs)

Configuring your kernel is something that is often overlooked by new LFScript users. However, it is very important that you create a configuration file. It often makes the difference between a usable system and one that only gives you a kernel panic.

Downloading the kernel source

LFScript is capable of downloading all source code you need, automatically. The Linux kernel is part of the basic LFS system, which means that the next command will also download the kernel source for you:

./lfscript -BS

All source code is saved to the sources directory.

cd sources

Configuring the kernel

Extract your kernel source, and enter the source directory:

tar xf linux-3.*.tar.bz2
cd linux-3.*

It is recommended that you clean the source tree first:

make mrproper

Next, create a default configuration. This is not strictly necessary, but it gives you a basis to build your own configuration on:

make defconfig

The kernel source comes with a configuration tool included called menuconfig. Menuconfig has an ncurses based text user interface, which allows easy selection of the features you like to include in your kernel.

If your host system does not have the ncurses development package installed, the command may fail. On Ubuntu, for example you may need to run the next command, prior to make menuconfig:

sudo apt-get install ncurses-dev

Then, start the configuration tool:

make menuconfig

You can navigate the menu using the up and down keys, pressing enter to enter a submenu.

To select an option to include in the kernel, press Y. The option should become prefixed with a checked box: [*].

Important things to include

Recent development versions of LFS require you to include support for devtmpfs:

Device Drivers  --->
  Generic Driver Options  --->
     Maintain a devtmpfs filesystem to mount at /dev

Saving your configuration

Using your configuration with LFScript