Solved

rh7.3 building a custom kernel

Posted on 2002-05-24
7
366 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
ID: 7032151
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
ID: 7032301
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
ID: 7032789
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:medent
ID: 7033127
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
ID: 7033438
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
ID: 7038933
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
ID: 7038989
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

863 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

28 Experts available now in Live!

Get 1:1 Help Now