Solved

rh7.3 building a custom kernel

Posted on 2002-05-24
7
401 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
RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

 

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
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 how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

636 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