Compiling kernel 3 vanilla 4 fedora
Hi all!
Today i’ve decided to share with you how to compile a vanilla kernel for use with your fedora box.
I’ll be showing you how to do it for a x86_64 system but it should be similar for i386.
- Start by getting your kernel tar here: kernel.org site.
- As root issue the following:
cd /usr/src/kernels
- Issue the following to install some dependencies:
yum install gcc ncurses ncurses-devel kernel-devel -y
- After that copy your downloaded kernel there to by issuing:
cp /<FOLDER_WHERE_YOUR_DOWNLOADED_KERNEL_IS>/linux-<VERSION>.tar.bz2 .
- Untar the kernel:
tar -xvjf linux-<VERSION>.tar.bz2
- Change the kernel name to make it more appropriate:
mv linux-<VERSION> <VERSION>.1-95.$fedoraver.$arch
Ex:
mv linux-3.0.4 3.0.4.1-95.fc14.x86_64 cd <VERSION>.1-95.$fedoraver.$arch
- After moving into the kernel folder edit the Makefile as bellow:
VERSION = 3 PATCHLEVEL = 0 SUBLEVEL = 4 EXTRAVERSION = .1-95.fc14.x86_64 NAME = Sneaky Weasel
Save the file.
- To complete run:
make oldconfig
- Editing the kernel options is not mandatory. If you want to compile right after the oldconfig, there’s no problem, jump that part and move straight for the makes. Here you edit accordingly with your box settings.
make menuconfig
After finishing save your changes and continue as described bellow:
make bzImage && make modules && make modules_install
This will take a while you may go for a coffee break.
- After everything finishes, you do the following simple tasks:
cp arch/x86_64/boot/bzImage /boot/vmlinuz-3.0.4.1-95.fc14.x86_64 cp System.map /boot/System.map-3.0.4.1-95.fc14.x86_64 cp .config /boot/config-3.0.4.1-95.fc14.x86_64
- Now you generate the image:
cd /boot mkinitrd initramfs-3.0.4.1-95.fc14.x86_64.img 3.0.4.1-95.fc14.x86_64
- Now edit grub settings file to boot the new kernel. Just copy the current kernel entry and make the changes to the version numbers setting yours and you are done.
cd grub vi menu.lst
Here you can see an example:
title Fedora (3.0.4.1-95.fc14.x86_64) root (hd0,5) kernel /vmlinuz-3.0.4.1-95.fc14.x86_64 ro root=/dev/mapper/vg_dell-lv_root rd_LVM_LV=vg_dell/lv_root rd_LVM_LV=vg_dell/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=pt-latin1 rhgb quiet intel_iommu=off initrd /initramfs-3.0.4.1-95.fc14.x86_64.img
- Save the file, recheck to see if you missed something and reboot.
Enjoy the advantages of your new kernel.
Good luck!
As soon as you start being asked with changes against the new kernel, do an enter everytime. By doing this you will apply the defaults for all items without interfering with the settings.
Leave a Comment