Note: Lots more information available on FC4 Kernel Notes.
This guide is how I custom compiled my kernel. My installation of FC3 can be found on my Personal Fedora Core 3 Installation Guide. Similar notes for FC2 can be found on my Advanced Fedora Core 2 Notes. This page is for technical and involved processes. Keep in mind this works for me, so take care in doing proper backups to critical files whenever trying something.
Compiling your own kernel will allow you to thoroughly tweak your linux system. This involves add/remove various features that may or may not work or speeding up your system.
My system is an Athlon XP system with an NVidia video card, I use no extra kernel patches or drivers other than the Nvidia driver.
You will need about 350-400MB of free space on your system.
Verify you have a FC3 kernel.src.rpm properly installed. Install as stated in FC3: Install Kernel Source.
For convenience make any necessary softlinks:
[root@charon src]# cd /usr/src [root@charon src]# ln -s redhat/BUILD/kernel-2.6.9/linux-2.6.9/ linux [root@charon src]# ln -s redhat/BUILD/kernel-2.6.9/linux-2.6.9/ linux-2.6.9
Obtain the latest 2.6 kernel source (FC3 uses a 2.6 based kernel) from kernel.org. Make sure to use a mirror.
The latest stable version of the Linux kernel is: 126.96.36.199 2005-03-18 06:40 UTC
As root decompress it to /usr/src/
[root@charon download]# bzip2 -cd linux-188.8.131.52.tar.bz2 | tar xvf - -C /usr/src/
Change to the new kernel directory
[root@charon download]# cd /usr/src/linux-184.108.40.206/
If you wish to apply some kernel patch, do so before the next step. As an example:
[root@charon linux-220.127.116.11]# patch -p0 < kernel.patch
Put the kernel source in a proper/clean state:
[root@charon linux-18.104.22.168]# make mrproper
Copy the previous Fedora .config file from the fedora kernel.src.rpm, this will be your starting point for customizing the kernel.
[root@charon linux-22.214.171.124]# ls /usr/src/linux-2.6.9/configs/ kernel-2.6.9-i586.config kernel-2.6.9-ppc64iseries.config kernel-2.6.9-i586-smp.config kernel-2.6.9-ppc.config kernel-2.6.9-i686.config kernel-2.6.9-s390.config kernel-2.6.9-i686-smp.config kernel-2.6.9-s390x.config kernel-2.6.9-ia64.config kernel-2.6.9-x86_64.config kernel-2.6.9-ppc64.config kernel-2.6.9-x86_64-smp.config [root@charon linux-126.96.36.199]# uname -rm 2.6.9-1.667 i686 [root@charon linux-188.8.131.52]# cp /usr/src/linux-2.6.9/configs/kernel-2.6.9-i686.config /usr/src/linux-184.108.40.206/.config
Note: If you have another kernel source, either from another
RPM or a previously downloaded kernel source, you can use that .config
instead of Fedora's. For example:
[root@charon linux-220.127.116.11]# cp /usr/src/linux-2.6.10/.config /usr/src/linux-18.104.22.168/.config
Bring the .config file up to date to match the new kernel. This will prompt for many new options. If you know what they are, answer them correctly. Otherwise just hit [Enter].
[root@charon linux-22.214.171.124]# make oldconfig
Once done, configure all the necessary options in the kernel by using any of the following:
text based questions: make config text based GUI: make menuconfig GTK based GUI: make gconfig QT based GUI: make xconfig (recommended)
Note: You must have the qt-devel-3.3.3-8 RPM installed to run make xconfig.
Disable or enable anything that you may or may not want. Be very careful when changing things with which you are unfamiliar. If you do not know what it is, leave it to the default value. Some things I personally change:
* "Processor type and features" - set correctly (Athlon/Duron/K7 - for me) * "Power management options (ACPI, APM)" - I enable "Software Suspend" and "Suspend-to-Disk Support" - I disable "CPU Frequency Scaling" - My Athlon does not support it * My system DOES NOT have or support any of the following: - "PCMCIA/CardBus support" - "Fusion MPT devive support" - "IEEE 1394 (FireWire) support" - "Amateur Radio Support" - "Bluetooth subsystem support" - "ISDN subsystem" * Some things I stronly recommend: - "File systems > DOS/FAT/NT Filesytems > NTFS file system support" - Things like "NFS", "SMB" and "CIFS" are needed to allow for things like network file access (Samba, etc.)
Note: IF you are updating from a RECENT kernel (ex: 2.6.10 to 2.6.11) AND you copied your .config correctly most of these changes will be set and you need only to verify new features.
Note: For people who wish to remove the FB_RIVA module that the Nvidia installer mentions. (This is NOT necessary, but since people have requested it, I am making a note.) Go to:
Device Drivers > Graphics support > Support for frame buffer devices > nVidia Riva support (FB_RIVA) [N]
Save the config, and compile. This step may take between 15min - 2hours depending on the speed of your system.
[root@charon linux-126.96.36.199]# make all
Once done compiling, install it.
[root@charon linux-188.8.131.52]# make modules_install [root@charon linux-184.108.40.206]# make install
Edit /boot/grub/grub.conf, you'll find that the kernel has already been added, but the default=1 points to your previous kernel. Set default=0. Also add 3 to the end of the kernel line. This will disable the X server.
kernel /boot/vmlinuz-220.127.116.11 ro root=LABEL=/ 3
Reboot into your new kernel, but before you do, make sure you have the Nvidia driver (or any other driver) easy to access. ... [REBOOT] ... If it fails to boot into the new kernel, read the data provided in the error and go back to your previous kernel. Go to the config step and try to change the device or feature that may have caused the problem.
Once in the new kernel install the Nvidia driver. Note: I install this the following way to allow for the driver to load in each kernel instead of only one.
[root@charon download]# sh NVIDIA-Linux-x86-1.0-7167-pkg1.run --extract-only [root@charon download]# cd NVIDIA-Linux-x86-1.0-7167-pkg1/usr/src/nv/ [root@charon nv]# make install
Test it, by running init 5, if that doesn't work, try: modprobe nvidia, then run init 5. When you know it works go and edit /boot/grub/grub.conf remove the 3 at the end of the kernel line.
Any other drivers that you may have been added should be re-installed now. EVERY driver that did not come default in the kernel or in Fedora, will most likely require re-installation.
Help Out: If you found this guide or any Resource helpful, please consider supporting this site by recommending this page to others or linking to this page. I appreciate all the support I receive. Thank you in advance.
Disclaimer: The author makes no claim to the accuracy of the information provided. This information is provided in the hope that it will be useful, but WITHOUT ANY WARRANTY. There is no implied support from referencing this guide. Any help that is provided is at will. Use this information at your own risk. Always make proper backups and use caution when modifying critical system files.
PLEASE DO NOT mirror, translate or duplicate this page without contacting me.
Copyright © 2003-2013 by Mauriat Miranda (mjmwired.net).