Solved

separate modules-dir same kernel version how?

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux server cannot access samba share 12 91
Linux "time" command output redirection 16 121
Anti-virus for Linux Server 15 127
I think my Ubuntu 12.10 box is hacked, but not sure... 13 53
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

867 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

15 Experts available now in Live!

Get 1:1 Help Now