Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

rh7.3 building a custom kernel

Posted on 2002-05-24
7
Medium Priority
?
407 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 2000 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

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

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

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…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

722 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