Archive

Posts Tagged ‘compile’

Compiling a new kernel

April 1st, 2009 admin No comments

1) We must have installed the following packages:

  • kernel-package
  • libncurses5-dev
  • fakeroot
  • wget
  • bzip2
  • build-essential

If not, try to useapt-get [package name]after aapt-get update

2) Move to /usr/src/ path. To do this, usecd /usr/src

3) Get the Kernel. To this, open your browser and go tohttp://www.kernel.org and download the latest, or you needed.

You can use “wget” to this. For example if we want to use the 2-6-25 Kernel, we type this in the consolewget http://www.eu.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.5.tar.gz

4) When the kernel have been downloaded. Unpack the ‘tar.gz’, usingtar xvf [tar.gz package name]

5) Make a simbolic link to the original folder which contains the (Just unpacked) Kernel. Typeln -s [Kernel folder name] linux.

Why we do this? The folder we created with “ln -s” it’s a simply link to the original folder. This folder it’s only to facilitate the work.

6) Move to the symnolic link folder “linux”. Just typecd linux

7) Make sure you’re in /usr/src/linux folder, and now typemake clean && make mrproper

8 ) Now, typemake menuconfigNOTE: There’s other kinds of compile, but i ever use this. It’s the most easy and secure, i think.

A screen like that will be loaded

In this, you must select the things you need to run your system and the modules you want.

Before this, you must save a configuration file with the settings you’ve selected.

9) Then, you must type the following:

make all
make modules_install
make install

10) We’ve installed out Kernel, but now we should say the system where’s the new Kernel.

To this, type:

depmod [number of kernel]Example -> depmod 2.6.21.5

apt-get install yaird

mkinitrd.yaird -o /boot/initrd.img-[Number of kernel] [Number of kernel]

update-grub

After all, we’ve compiled our own Kernel :) . To load it, just reboot the computer.

Categories: Tutorials Tags: , , ,