I am new to rebuilding the kernel and kernel modules and such, so I apologize if this is a poor question.
I am running Centos 6.8 , 2.6.32.642.el6.x86_64. I am trying learn about device drivers and such, and my reference text starts with rebuilding the kernel. It's instructions seem kinda dated, so I've also been googling.
I rebuilt the kernel, with a minor change to main.c I then moved the resulting bzImage into the boot directory:
cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.32-custom.el6.x86_64
I then added an entry to etc/grub.conf, that is identical to the one already there, but with the different kernel name.
I then reboot, and on reboot, I get a kernel panic, which indicates that it can't find modules.dep in /lib/modules/2.6.32
But everything I've read indicates that the modules should be located at /lib/modules/2.6.32-custom.el6.x86_64,
So to try that, I softlinked /lib/modules/2.6.32-642.el6.x86_64 to /lib/modules/2.6.32-custom.el6.x86_64:
ln -s /lib/modules/2.6.32-642.el6.x86_64 /lib/modules/2.6.32-642.el6.x86_64
but as expected it didn't fix the error, because it (the kernel?) is looking in /lib/modules/2.6.32/ instead of /lib/modules/2.6.32-custom.el6_x86_64
My question is, where SHOULD the kernel be looking for modules and/or how do I change it, and/or what is driving it to look where it is looking?