> ----------
> From: Richard Adams[SMTP:[EMAIL PROTECTED]]
> Reply To: [EMAIL PROTECTED]
> Sent: 27 April 1999 10:54
> To: Maurice Hendrix
> Cc: [EMAIL PROTECTED]
> Subject: Re: compiling many kernels
>
> According to Maurice Hendrix: While burning my CPU.
>
> > way it should be (made) possible to point the kernel to a unique
> location
> > for the modules. I've seen that the version number of the kernel also
> > defines the name of the directory in /lib where the modules will be
> stored.
> >
> > > RH does some linking in the modules directory, i belive "prefered" is
> the
> > > word used, you might want to comment out that part of the boot script
> > > before
> > > trying the above. I belive its /etc/rc.d/rc.sysinit.
> > >
> > I think I came across something there. IIRC it *was* in rc.sysinit...
> I'm
> > starting to see the light. I'll try somethings tonight when I get home
> and
> > let you know later.
>
You wouldn't believe how brilliantly RH52 has solved this. Here's a piece of
the rc.sysinit:
| if [ -f /proc/ksyms ]; then
| USEMODULES=y
| else
| USEMODULES=
|
fi
|
| # Set up kernel version-dependent symlinks.
| rm -f
/lib/modules/preferred
| if [ -n "$USEMODULES" ]; then
| ktag="`cat
/proc/version`"
| mtag=`grep -l "$ktag" /lib/modules/*/.rhkmvtag` 2>
/dev/null
| if [ -n "$mtag" ]; then
| mver=`echo $mtag | sed -e
's,/lib/modules/,,' -e 's,/.rhkmvtag,,' -e 's,[ ].*$,,'`
| ln
-sf /lib/modules/$mver /lib/modules/preferred
| ln -sf
/boot/System.map-$mver /boot/System.map
| ln -sf
/boot/module-info-$mver /boot/module-info
| fi
| fi
|
| if [ -x
/sbin/depmod -a -n "$USEMODULES" ]; then
| # Get ready for kerneld if
module support in the kernel
| echo -n "Finding module dependencies...
"
| if [ -e /lib/modules/preferred ]; then
| depmod -a
preferred
| else
| depmod -a
| fi
| echo "done"
| fi
See? All you have to do when compiling a new kernel under a RedHat 5.2
installation is make and install the modules, then reboot to the new kernel
and do
# cat /proc/version > /lib/modules/<kernel-version>/.rhkmvtag
# mv /lib/modules/<kernel-version> /lib/modules/<some-other-name>
# reboot
where <kernel-version> is the version of the kernel :-\ eg. /2.0.36 which I
rename to 2.0.36.L8 (L8 being the LILO boot option to start that kernel)
Thus each kernel can keep it's own set of modules in a separate directory.
It's a pity this isn't a default feature of Linux.
Next problem coming up ;-)
--
Maurice Hendrix