Tuesday, October 04, 2005

 

linux: kernel manual update

Kernel installation:
here are the steps to install a new kernel manually (I am currently trying how to do it --i.e. configuration included-- through .deb package; I will post-it when I have a running solution)
(do everything as root or using sudo)
1) download your kernel from www.kernel.org
2) unzip your file in /usr/src/
for example, as root run 'tar -xzf linux-2.6.13.2.gz /usr/src/'
3) enter into your newly created directory: 'cd linux-2.6.13.2'
run 'make clean'
run 'make mrproper' if you want your kernel config not to be loaded and start from a fresh default one
4) run 'make menuconfig' or 'make xconfig'
=> select the options you want
if anything goes wrong on step 5) and 6), then try different choices in menuconfig or xconfig
for instance it did not work for me when the first option ('Prompt for development and/or incomplete code/drivers') is enabled and not the second but it worked fine when I uncheck the first one
5) run 'make bzImage'
=> if successful, this should create a 'bzImage' file in ./arch/xxx/boot/ (replace xxx with your architecture -- i386 for instance)
6) run 'make modules'
=> this will compile modules (i.e. options flagged as 'M' when making menuconfigure or xconfig)
7) if successful, run 'make modules_install'
=> this will install your newly compiled modules in /lib/modules/kernelversion (i.e. in /lib/modules/2.6.13.2/ with kernel version 2.6.13.2).
Therefore if you rebuild a kernel on an already existing/running version, maybe you should make a copy of your /lib/modules/kernelversion prior to running 'make modules_install"
8) copy the newly created kernel (the bzImage file) and System.map file in /boot/
'cp ./arch/i386/boot/bzImage /boot/bzImage.kernelversion' -- replace kernelversion with your kernel version, i.e. 2.6.13.2 in our example
'cp System.map /boot/'
9) create an initrd file: 'mkinitrd -o /boot/initrd.kernelversion-img kernelversion' -- replace with your kernel version -- i.e. with kernelversion2.6.13.2 twice in our example
10) you need to modify your boot loader:
- if you run grub as boot loader, edit /boot/grub/menu.lst by adding a new entry (copy an old one and modify the path to fit your newly created files)
for example on my computer, it gives:
title Debian GNU/Linux, kernel 2.6.13.2
root (hd0,0)
kernel /boot/arch/i386/boot/bzImage-2.6.13.2
initrd /boot/arch/i386/boot/initrd-2.6.13.2.img
savedefault
boot

- if you run lilo, refer to man lilo

That's it! You should now be able to reboot your computer and load your new kernel.

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?