Praji’s Weblog

Welcome to praji’s world


leave a comment »




1. Get the kernel source

2. Check the server settings
	cat /proc/cpuinfo

3. Download the kernel
	cd /usr/src/kernels
	tar -zxf linux-2.6.21.tar.gz
	cd linux-2.6.21

4. Configure the kernel
	cp /boot/config-`uname -r` .config
	make menuconfig

5. Prepare kernel image
	make bzImage

6. Install Kernel modules
	make modules
	make modules_install

7. Install the kernel
	make install

	Do the following
	a) cp .config /boot/config-2.6.21
	b) cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.21
	c) cp /boot/
	d) mkinitrd /boot/initrd-2.6.21.img 2.6.21

	Now alter grub
	vi /etc/grub.conf
        Add line
              title CentOS-4 i386 (2.6.21)
        		root (hd0,0)
        		kernel /vmlinuz-2.6.21 ro root=LABEL=/ panic=3
        		initrd /initrd-2.6.21.img

8. Set the grub to load the new kernel after reboot
	Type grub in the console
	Type	savedefault --default=1 --once

9. Reboot the server

10. Check the kernel version
	uname -a




1. Install the required packages:
	apt-get install kernel-package libncurses5-dev fakeroot wget bzip2

2. Download the latest kernel
	cd /usr/src
	tar xjf linux-
	cd linux-

3. Select the required kernel features and compile the kernel source
	make menuconfig
	make-kpkg clean
	fakeroot make-kpkg --revision=custom.1.0 kernel_image 

4. If the compilation stops with an error, run
	make clean

	and then re-run the previous commands starting with
	make menuconfig

5. Go ahead with
	cd ../
	dpkg -i kernel-image-

	This will install your new kernel and also update grub configuration file.

6. Create a ramdisk of your new kernel, otherwise your system will most likely not boot:
	cd /boot/
	mkinitrd -o /boot/initrd.img-

7. Now edit /boot/grub/menu.lst and put the following entry after the kernel directive of the new kernel:
	initrd  /boot/initrd.img-

	But if the /boot is on a separate partition, the entry should be as follows:
	initrd  /initrd.img-

8. Reboot your machine with new kernel:
	shutdown -r now

9. If everything is ok your machine should come up with the new kernel. You can run
	uname -a

Written by praji

February 3, 2008 at 6:32 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: