Build kernel and modules

From wiki.network-crawler.de
Jump to: navigation, search

NOT READY JET! I am on it...

Introdution

This Howto should tell you shortly how to build your own kernel. First of all you should know whether you want a vanilla kernel or a modfied kernel especially for your distribution.

Different kernel types

Vanilla kernel

Vanilla kernels are not modified - means the kernel was released by Linus Torvalds.

Distribution kernels

Nearly all distributions modify the vanilla kernel for their own wishes with own patches, mainly in order to add support for drivers or features which have not officially been released as stable (Slackware relies on vanilla kernels).

Prearrangement

First of all you should know what hardware youre kernel later runs on. If you already run a linux on your target try:

/sbin/lspci

And:

cat /proc/cpuinfo

Installation of the needed tools

Use RPM, apt, YAST, portage, etc.. if you have a distribution to install kernel source package. Or download youre favorite kernel at: kernel.org

Make a directory like: /usr/src

cd /usr/src
tar xfvj linux-x.x.x-x.tar.bz2

or

tar xfvz linux-x.x.x-x.tar.gz
ln -s linux-x.x.x-x linux

The make prozess

cd linux
make menuconfig
make modules
make modules_install

Creating the ramdisk

cd /boot
mkinitrd -o /boot/initrd.img-x.x.x.x x.x.x.x

where x.x.x.x is the kernel version btw. the version of the kernel modules to load.

Configuring grub

Add s.th. like this in /boot/grub/menu.list

title MyLinux (/dev/hdc3)
kernel (hd1,2)/boot/vmlinuz root=/dev/hda3
initrd (hd1,2)/boot/initrd

Where /dev/hdc3 is the 3rd partiotion on hdc and hd1,2 is the 3rd partition on the first harddisk