rh7.3 building a custom kernel

I'm having trouble building a custom kernel that will run on various x86 servers. I've done this before on the RedHat 7.2 OS without a problem. I simply make sure all the components are selected in the .config for the target servers I plan to run this kernel on. The problem I am having with 7.3 is I can only run the kernel on server that I created it on. If I try to run on a different machine configuration (ie root is an adaptec scsi controller instead of and IBM ips raid controller), then I cant get the machine to boot, it fails with VFS panic init not found.
So the question would be...if I can run custom kernels built using the SAME .config file on the "adaptec" server as the "ibm" server, why are'nt these kernels interchangeable?
medentAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jlevieConnect With a Mentor Commented:
As soon as you posted that last comment I realized what you problem is. And an earlier comment had the clue, but I missed it.

You are building the kernel and creating a matching initrd on one system and trying to use that initrd image on another box that doesn't have the same devices. The problem here is that the initrd image that you copy over doesn't support the boot device on the other system. The solution is to copy over the new kernel, System.map, modules, etc., and then create a matching initrd on the target system. The result should then boot since the initrd image will have the correct modules for the target system.
0
 
jlevieCommented:
Obviously the kernels that RedHat ships aren't running on the machine that built them so it can be done if you build the kernel with the right options. A goos starting place when building  kernel is to load the RedHat config that was used to build the kernel for your CPU type and then customize that. Those configs are located in /usr/src/linux-2.4/configs.

Also if you build a new kernel for a system that needs intird to boot you'll have to re-build /boot/initrd-2.???.img.
0
 
medentAuthor Commented:
1) I will try one of the premade configs as you suggested. I have been hacking the "default" config after doing make mrproper, which seems to select almost everything (not sure what governs this default- redhat?).
2) as far as the initrd goes, yes I use it, and yes I create a new one... I then take the vmlinuz initrd.img and associated /lib/modules dir, and put into a cpio ball, for general use... PS - I seen comments where the root filesystem driver should not be loaded as a Module, and thought might be related, but i think thats yester-year because we RH default install appears to load them as Modules...
0
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

 
jlevieCommented:
The advantage of having the driver for the root file system built into the kernel is that you then don't have to use initrd for dirvers other than IDE (like SCSI, or RAID). As far as I know there's no performance penalty for using a loadable module and there is the advantage of being able to update the driver without having to build a new kernel.

The default config is literally that. It essentially has nothing to do with a Redhat system or how they configure the kernels they ship. If you were to get kernel sources from kernel.org that's the config that you'd see. I suppose that if one were a kernel hacker and had a full understanding of what everyone of those options do and how it affects other things (and some of the interactions aren't all that obvious) one could start with the default config. Personally I find it easier to fine tune one of RedHat's configs.
0
 
medentAuthor Commented:
I tried using one of RH's premade configs, and again it only works (boots) on the system it was made on. They are both i686 machines, but different scsi controllers...here is the info on the failing screen:
Loading ips module ...  (but there is no ips card)
Hint insmod errors can be caused by incorrect module par..
Error insmod exited normally
Loadin JBD module
Journaling block device driver loaded
Creating root device
Mounting root filesystem
kmod:failed to exec /sbin/modprobe -s -k block-magor-8
mount: error 6 mounting ext3
Freeing unused kernel memory
Kernel Panic: No int found , Try passing init= option to the kernel
0
 
medentAuthor Commented:
That did work, although that leaves me wondering about your 1st comment ("Obviously the kernels..."). These "generic" kernel packages that Redhat puts out include an initrd. This initrd has all scsi devices as modules, like the custom one i am building...
If possible, I would rather not have to build this file on all the target servers. It sounds like I am working around the "real" issue...
0
 
medentAuthor Commented:
In regards to my last comment- I just looked at the redhat kernel rpm, and there is no pre-made initrd, therefore a custom one is made during rpm install, so now your answer makes complete sense, Thank You. :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.