Kernel configuration: Difference between revisions

From LFScript
No edit summary
No edit summary
Line 26: Line 26:
<pre>make defconfig</pre>
<pre>make defconfig</pre>


The kernel source comes with a configuration tool included called <code>menuconfig</code>. Menuconfig is an ncurses based text user interface, which allows easy selection of the features you like to include in your kernel.
The kernel source comes with a configuration tool included called <code>menuconfig</code>. 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 <code>make menuconfig</code>:
 
<pre>sudo apt-get install ncurses-dev</pre>
 
Then, start the configuration tool:


<pre>make menuconfig</pre>
<pre>make menuconfig</pre>


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 <code>make menuconfig</code>:
You can navigate the menu using the up and down keys, pressing enter to enter a submenu.


<pre>sudo apt-get install ncurses-dev</pre>
To select an option to include in the kernel, press <code>Y</code>. The option should become prefixed with a checked box: <code>[*]</code>.


=== Important things to include ===
=== Important things to include ===
Recent development versions of LFS require you to include support for <code>devtmpfs</code>:
<pre>Device Drivers  --->
  Generic Driver Options  --->
    Maintain a devtmpfs filesystem to mount at /dev</pre>


== Saving your configuration ==
== Saving your configuration ==


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

Revision as of 20:38, 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

Saving your configuration

Using your configuration with LFScript