Page 1 of 1

Making a kernel on CentOS 6/7

Posted: Sat Apr 04, 2015 10:26 pm
by Nanook
On non-broken operating systems, the normal procedure when making a kernel is:

make xconfig (or the configuration program of your preference)
Configure the kernel to your liking.
make clean; make; make modules_install install

However, under CentOS 6 you'll get missing module complaints, and under CentOS 7, it will scribble your boot partition rendering your machine unbootable until you re-install grub2.

So on these machines:

make xconfig
make clean; make; make modules_install
cp arch/x86_64/boot/bzImage /boot/vmlinuz-(version)
cp /boot/
cp .config /boot/config-version
mkinitrd /boot/initramfs-(version).img (version)

On CentOS 6, hand edit /boot/grub/menu.lst to add the new kernel

On CentOS 7 type:

grub2-mkconfig -o /boot/grub2/grub.cfg

You should be able to boot your new kernel now.