Skip to content

Rebuild Kernel CentOS

Lieven Hollevoet edited this page Sep 22, 2014 · 1 revision

taken from Ron's email on the Misterhouse mailing list:

Build Kernel from source on CentOS 4.2 with latest updates:

Get depedencies:

  1. yum install rpm-build kernel-devel.i686
  2. yum install redhat-rpm-config.noarch ncurses-devel
Check kernel version:
  1. uname -r
2.6.9-22.0.2.EL

Get source package:

  1. cd /house/install
  2. wget
http://ftp.nluug.nl/ftp/pub/os/Linux/distr/CentOS/4.2/updates/SRPMS/kernel-2 .6.9-22.0.2.EL.src.rpm
  1. rpm -Uvh kernel-2.6.9-22.0.2.EL.src.rpm
Build source-code with all the RedHat patches:
  1. cd /usr/src/redhat/SPECS
  2. rpmbuild -bp --target i686 kernel-2.6.spec
Configure kernel:
  1. cd ../BUILD/kernel-2.6.9/linux-2.6.9
  2. ln -s /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 /usr/src/linux
  3. make mrproper
  4. cp /boot/config-2.6.9-22.0.2.EL .config
Optional change kernel name:
  1. vi Makefile
EXTRAVERSION = -22.0.2.EL-CUSTOM

Use menuconfig to enable/disable any non-standard modules.. (here you can disable the HID drivers) If you don't plan to modify any settings, you can skip this step.

  1. make menuconfig
Build kernel and modules:
  1. make bzImage
  2. make modules && make modules_install
  3. make install
  4. vi /boot/grub/grub.conf
default=1 -> default=0

Reboot and confirm new kernel is being used

  1. uname -r
2.6.9-22.0.2.EL-CUSTOM
Clone this wiki locally