Booting from two kernels one single-proc, one SMP: Dual Module Paths???

Booting from two kernels one single-proc, one SMP: Dual Module Paths???

Post by Jeff Johnso » Sat, 19 Dec 1998 04:00:00



Hello,

    Here's one I am hoping someone can answer. Im running a dual CPU
system (P-II). I have a 2.0.36 kernel and have recompiled a SMP kernel.
I have the two existing in /boot and can select either from lilo at boot
time. How do a specify and keep separate two module trees under
/lib/modules for the modules compiled for the SMP kernel and the kernel
that is single processor. Or even more, do I need to keep separate
module trees for each of the kernels? I am assuming I do.

    If /lib/modules/preferred is linked to the SMP module tree then what
do I set within the system or kernel so the SMP kernel and initrd knows
to go to the SMP modules and the single proc kernel knows to source
modules it its own module tree?

-Jeff

ps: Again, I am not 100% sure I need to do this but I seem to see errors
during boot on modules that do not match up with the kernel being
booted. That makes me %99.5 percent sure I need to do this....

 
 
 

Booting from two kernels one single-proc, one SMP: Dual Module Paths???

Post by Entro » Mon, 21 Dec 1998 04:00:00



> Hello,

>     Here's one I am hoping someone can answer. Im running a dual CPU
> system (P-II). I have a 2.0.36 kernel and have recompiled a SMP kernel.
> I have the two existing in /boot and can select either from lilo at boot
> time. How do a specify and keep separate two module trees under
> /lib/modules for the modules compiled for the SMP kernel and the kernel
> that is single processor. Or even more, do I need to keep separate
> module trees for each of the kernels? I am assuming I do.

I don't know if it will work, but here's a suggestion: Look at the docs
for initrd (I think there should be some in the linux/Documentation
directory). Basically you should be able to build two ramdisks (one for
each kernel). The ramdisk will mount your root partition and create the
symlink you need, then unmount the root and allow the normal boot
process to continue. Then in lilo you specify which kernel uses which
ramdisk. Obviously any drivers you need for the ramdisk (e.g. for the
root filesystem) must be compiled into the kernel.

Another thought I just had (which might require a few things to be
compiled in, but doesn't need to stuff around with initrd) is to put
something really early in your bootup scripts (like right after root is
mounted read/write) to rig some sort of check on /proc/cpuinfo. If the
single processor kernel is running you should only have info for one
cpu, but for the SMP kernel there should be info on both. Then you can
use the result of that to rig the symlink.

Bruce
--
/--------------------------------------------------------------------\
| Bruce Merry (Entropy)            | bmerry at iafrica dot com       |
| Proud user of Linux!             | http://www.cs.uct.ac.za/~bmerry |
|                    Celibacy is not hereditary.                     |
\--------------------------------------------------------------------/