4.19.2011

Recomplie Kernel CentOS 5.6 (From RPM-Source)

Environment:
OS: CentOS5.6
Kernel: 2.6.18-238.5.1-el5

  1. Download Kernel RPM Source from CentOS website link
  2. Install RPMS file "rpm -ivh kernel-2.6.18-238.5.1.el5.src.rpm"
    (many warning "user mockbuild does not exist is normal")
  3. cd /usr/src/redhat/SPECS
  4. rpmbuild -bp kernel-2.6.spec   #Run the patch for kernel source
  5. cd /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i386
  6. nano Makefile #Update "EXTRAVERSION = -238.netatalk" (Optional)
  7. make menuconfig
  8. Update your config e.g. Networking -> Networking options -> Appletalk protocol support
  9. make all
  10. make rpm        #RPM fine will stored in "/usr/src/redhat/RPMS/i386/"
  11. rpm -ivh kernel-2.6.18-238.5.1.netatalk.rpm    #install rpm kernel
  12. /sbin/new-kernel-pkg --package kernel --mkinitrd --depmod --install 2.6.18-238.netatalk    #Update Grub config and create initrd image, "-238.netatalk" is the EXTRAVERSION setting from the SPECS file, which is part of kernel modules directory name, you can check the /lib/modules/ to find correct directory name.