Rebuild the kernel (complie kernel) from Kernel source.
Some people shake their heads at the mention of compiling a Linux kernel because it sounds difficult. In fact, it is easier than it seems and takes only a few steps. Prepare the machine for compilation and follow the steps below.
Before compiling the kernel, prepare development tools such as a C compiler and libraries.
Once the machine is ready, begin compiling the kernel.
1. download kernel source จาก kernel.org
2. ใช้คำสั่ง tar -xvjf <kernel source>
3. เข้าไปที่ directory ที่ทำการแตกไฟล์ออกมาเมื่อกี้
4. รัน make clean
5. รัน make mrproper
6. รัน make menuconfig หรือ make xconfig (ทำการเปิด feature ต่างๆ)
7. รัน make dep (ถ้า kernel version 2.6 ขึ้นไปไม่ต้องรันคำสั่งนี้ก็ได้)
8. รัน make
9. รัน make modules
English reading note — translation of the instructions above:
- Download the kernel source from kernel.org.
- Run tar -xvjf <kernel source>.
- Enter the directory where you just extracted the files.
- Run make clean.
- Run make mrproper.
- Run make menuconfig or make xconfig to enable the desired features.
- Run make dep. You can skip this command for kernel version 2.6 or later.
- Run make.
- Run make modules.
Once compiled, the built kernel is stored in /arch//.
Copy it to /boot, as shown:
#cp /usr/src/linux-2.6.5-1.358/arch/i386/boot/bzImage /boot/vmlinuz-2.6.5-1.358-custom
Next, edit /etc/grub.conf and add the lines below.
title Custom Kernel (2.6.5-1.358)
root (hd0,0)
kernel /vmlinuz-2.6.5-1.358-custom ro root=LABEL=/
initrd /initrd-2.6.5-1.358.img
Finally, reboot the machine so the system loads the new kernel.