Kernel configuration: Difference between revisions

From LFScript
Line 69: Line 69:


== Saving your configuration ==
== Saving your configuration ==
When you quit the configuration tool, it will ask you if you want to save your configuration; Choose "yes".
Next, move the configuration file out of the kernel source:
<pre>cp -v .config ../../my_kernel.config</pre>
You don't need the kernel source tree any more, so remove it:
<pre>cd ../../
rm -rf sources/linux.3.*/</pre>


== Using your configuration with LFScript ==
== Using your configuration with LFScript ==

Revision as of 20:53, 31 January 2012

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

You should also be sure to include support for the file systems you want to use when you install your system:

File systems --->
  Second extended fs support
  Ext3 journalling file system support
  The Extended 4 (ext4) filesystem

If you want to build a Live CD of your system, you also need SquashFS support:

File systems --->
  Miscellaneous filesystems --->
    SquashFS 4.0 - Squashed file system support --->
      Include support for ZLIB compressed file systems
      Include support for LZO compressed file systems
      Include support for XZ compressed file systems

fsOS Live CD

In the fsos folder in LFScript, there is a text file called kernel.features. It contains a complete list of everything selected for the fsOS Live CD.

Saving your configuration

When you quit the configuration tool, it will ask you if you want to save your configuration; Choose "yes".

Next, move the configuration file out of the kernel source:

cp -v .config ../../my_kernel.config

You don't need the kernel source tree any more, so remove it:

cd ../../
rm -rf sources/linux.3.*/

Using your configuration with LFScript