In general, here are the steps you want to follow for Redhat or Fedora to build the kernel (this process assumes you are running as root):
1. Download the kernel source RPM.
2. Install the kernel source:
rpm -Uvh kernel-2.6.*.src.rpm
3. Change to the directory with the spec file:
cd /usr/src/redhat/SPECS/
4. Create the build environment (substitute x86_64 for i686 if you are building on an AMD64 or EM64T):
rpmbuild -bp --target=i686 kernel-2.6.spec
5. Change to the directory for the build:
cd /usr/src/redhat/BUILD/kernel-*/linux-*/
6. Copy the appropriate config file from the configs directory:
/bin/cp -v -f configs/kernel-2.6.*-i686.config ./.config
7. Update Makefile kernel id. To do this edit the file "Makefile", and change the "EXTRAVERSION" to reflect the actual update version and add an identifier so you know this is a custom kernel:
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 15
EXTRAVERSION = -1.1831_FC4mm
8. Tell the build process to use the configuration file you copied from the configs directory:
make oldconfig
9. Make sure there are no already built files:
make clean
10. If you need to modify the configuration (remember to save your changes):
make xconfig
11. If you need to apply patches, do that now. For example:
cd drivers/acpi/
patch < /usr/local/src/toshiba_acpi_*.patch
cd ../../
12. Build the installable rpm file:
make rpm
13. Install the freshly built kernel rpm:
rpm -ivh /usr/src/redhat/RPMS/i386/kernel-2.6.*
14. Create the initial ramdisk, update the loader (grub) menu and update the kernel module dependency list:
new-kernel-pkg --install --make-default --mkinitrd --depmod 2.6.x-y.zzzzaa
15. Verify that grub has been properly updated:
cat /boot/grub/grub.conf
16. Reboot to select the new kernel:
shutdown -r now
|