Solved

separate modules-dir same kernel version how?

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

776 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