Solved

separate modules-dir same kernel version how?

Posted on 2001-06-24
4
240 Views
Last Modified: 2010-04-20
Hi.
Say for instance I compile 2 kernel images, each same version, but different modules used in each.  If you have a modules directory with unused modules (at least in my experience) or modules compiled for a different image despite same kernel version, you get unresolved dependencies for those modules, and I hate, absolutely hate those errors dispite how harmless they may be.
I was informed that perhaps in theory I could have 2 separate system.map files each pointing to a different modules directory, but then how would I specify the different system.map file to be used with selected kernel through lilo?  

I guess the main question here is more referring to the different modules directory for each image (despite same version), than to the system.map...

Or, on a more generalized level, how to avoid these unresolved dependency errors.  I am only suspecting that it's because of different modules per image despite version, and am only suspecting that a different modules dir for each image resolving the problem.

Thank you.
Mike
"Checkbook!!"
0
Comment
Question by:Checkbook
  • 2
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 250 total points
ID: 6226215
One solution, that works for sure on a RedHat system, is to modify the "EXTRAVERSION" define in the top level Makefile. Then save your .config file and "make mrproper". Restore the .config file and configure and build the kernel & modules in the normal manner. The modules dir will take on a name derived from the "VERSION", "PATHCHLEVEL", "SUBLEVEL", and "EXTRAVERSION" defines. You can copy the bzImage to vmlinux-????, where ??? is the same string as the modules install as. Likewise for the System.map. For example, on my 7.1 system I find:

VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 2
EXTRAVERSION = -2

in the makefile. The modules are installed in /lib/modules/2.4.2-2 and /boot contains:

System.map-2.4.2-2 -> System.map
vmlinux-2.4.2-2
vmlinuz-2.4.2-2    -> vmlinuz

If I were to change the Makefile so that "EXTRAVERSION = -test1" I'd have:

/lib/modules/2.4.2
/lib/modules/2.4.2-test1

System.map-2.4.2-2
System.map-2.4.2-test1
vmlinux-2.4.2-2
vmlinux-2.4.2-test1
vmlinuz-2.4.2-2
vmlinuz-2.4.2-test1

And I can make the symbolic links as desired. Of course you'd want to add an extra stanza to lilo.conf with a different label so that you could boot either of the kernels, perhaps something like:

image=/boot/vmlinuz-2.4.2-2
        label=linux
        read-only
        root=/dev/hda1

image=/boot/vmlinuz-2.4.2-test1
        label=test1
        read-only
        root=/dev/hda1

And if you need to use initrd you can make multiple versions of that with the same naming scheme.

I always do a "make mrproper" each time I change the Makefile to be sure that everything will be built in a consistant manner.
0
 

Author Comment

by:Checkbook
ID: 6226235
I hope somebody somewhere pays you guys good money because the knowledge you have is worth every penny.
Thank you.
I really appreciate this forum.  If it were fee-based information, I would pay it.

I have many more questions. :)  You know, I emailed RedHat support with the same question (I had their free 30 day support deal as I purchased their boxed set), and they told me that if I recompiled my kernel they no longer supported me, even though it was not a question about compiling - it was about modules - this same question.

Anyways, thanks again.  If I am knowledgeable on something I too will share it.
0
 

Author Comment

by:Checkbook
ID: 6226238
See previous comment.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 6226287
Thanks for your most generous compliment. I'm always glad when I can help someone.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Install Predefined Certificate on Ubunto 4 48
How to make a Bash alias that takes parameters 5 71
linux 13 75
Web resource - Man pages for SUSE Enterprise Linux 11 1 40
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.:
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

809 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