Solved

separate modules-dir same kernel version how?

Posted on 2001-06-24
4
232 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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