Solved

rh7.3 building a custom kernel

Posted on 2002-05-24
7
354 Views
Last Modified: 2013-12-16
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?
0
Comment
Question by:medent
  • 4
  • 3
7 Comments
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
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
 

Author Comment

by:medent
Comment Utility
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
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 

Author Comment

by:medent
Comment Utility
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
 
LVL 40

Accepted Solution

by:
jlevie earned 500 total points
Comment Utility
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
 

Author Comment

by:medent
Comment Utility
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
 

Author Comment

by:medent
Comment Utility
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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now