Kernel compilation under CentOS

The package kernel-sources is needed

You need to make sur /usr/src/linux is a symlink pointing to the kernel sources directory

Example : lrwxrwxrwx 1 root root 9 Jul 2 13:57 linux -> linux-2.4 lrwxrwxrwx 1 root root 18 Sep 29 18:57 linux-2.4 -> linux-2.4.21-37.EL drwxr-xr-x 16 root root 4096 Nov 2 15:33 linux-2.4.21-37.EL

If not : cd /usr/src ln -s linux-2.4 linux

Then : cd /usr/include for link in asm linux scsi ; do mv $link $link-old ; done --> should avoid error when compiling the kernel ln -s /usr/src/linux/include/asm-i386 asm --> this link is needed for a proper compilation ln -s /usr/src/linux/include/linux linux --> dito ln -s /usr/src/linux/include/scsi scsi --> dito cd /usr/src/linux cp /usr/src/linux/configs/kernel-2.4.21-i686.config .config --> copy the old or current kernel config file

make menuconfig

make bzImage --> if errors "ln -s /usr/src/linux/include/asm-generic /usr/include/asm-generic" make modules make modules_install make install

We make a backup of our custom config file : cp /usr/src/linux/.boot /boot/config-2.x.x-EXTRAVERSION

The new kernel is located under /boot and the configuration of grub should be updated, verify the default kernel.

More info : http://lea-linux.org/cached/index/Kernel-kernel.html




Thanks for reading this post!


Did you find an issue in this article?

- click on the following Github link
- log into Github with your account
- click on the line number containing the error
- click on the "..." button
- choose "Reference in new issue"
- add a title and your comment
- click "Submit new issue"

Your feedback is much appreciated! πŸ€œπŸΌπŸ€›πŸΌ

You can also drop me a line below!