Saturday, August 29, 2009

Steps for Kernel Compilation – 2.6.30

The following steps are a guideline to recompile the kernel. I have tested it today on my debian installation and i hope that it should work fine on all systems. If there are any mistakes please let me know. Remember to be a root to do the following steps. But before beginning with the following steps you need to have gcc­version­2.95­3. To install this version see the steps are

1. Step­-1

Download the kernel source code from the internet . You have to pick up the 2.6.30 kernel version. The format of the file is in tar format so you would have to untar it. You can create your own directory to untar it but i would advise to keep the kernel source in /usr/src/. After copying the tar image of the kernel, untar it by issuing the command tar – xvf linux­kernel­2.6.30.tar

2. Step-­2

Now is the time to configure the options that we have to keep in our new kernel. So go in the source code directory which would be something like /usr/src/linux­kernel­2.6.30 and key in the command make menuconfig. For running menuconfig you should have ncurses library installed, which can be done by installing libncurses package from your synaptic package managers. The make menuconfig would look something like as under:­

3. Step – 3

Selection of modules – Now we have to select the modules. Make sure that in the Processor type and features­> symmetric multiprocessing support is disabled. Selected and deselected of items is done using space bar. You can read the details of an item using inbuilt context sensitive help. Just place your cursor at the command and press ?. You would then see the context sensitive help. It causes lot of problems so remove it. After deselect this you can go back by pressing escape. Also now go to the device drivers­>character devices and deselect Direct rendering manager. This also causes a lot of troubles because of hardware incompatibility.
After these two things you can come back to the main menu by pressing escape. Here select file systems and select ext3 to be loaded as inbuilt and not a module. These changes are sufficient and rest is your own wish. After selecting and deselecting the packages, press escape again and again until it asks you to save. So say yes as the screen under.

4. Step­-4

Running makefile – Now after saving the menuconfig file, key in the command make. This would compile all the modules and all files in two stages and create configuration files.

5. Step­-5

Making Modules – After make is done now key in the command make modules_install. This command installs all the modules for the kernel in /lib/modules/2.6.30.

6. Step­-6

Now the bzImage of the kernel is created which is the bunzipped compressed image. Copy this image to boot directory by the following command cp /arch/i386/boot/bzImage /boot/vmlinuz­2.6.30.

7. Step­-7

Now is the time to create a RAMFS i.e. initrd which loads the filesystem in memory. so to get that key in the command as mkramfs ­o /boot/initrd.img­2.6.30 2.6.30.

8. Step­-8

Now type the command grub update on command prompt.

9. Step­-9

Congratulations. You can boot into the new kernel now.

No comments:

Post a Comment