Re: kernel recompile...questions

Jon Lewis (jlewis@inorganic5.fdt.net)
Sat, 11 Jul 1998 03:59:15 -0400 (EDT)


On Fri, 10 Jul 1998, Rusty Brooks wrote:

> This is a very complex issue, especially since modules that are compiled
> in one kernel will often not work in another kernel, even the same version
> number.
>
> For preserving I tend to use the same trick as with the kernel (i.e.
> links). If the "new" kernel crashes, I reboot to the old, ignore the
> module warnings and move the modules back, or fixwhat went wrong. Of
> course, this implies that you shouldn't have any system dependant
> resources in modules (i.e. if you _need_ an ethernet card to boot
> properly, you should have this built into the kernel.
>
> If anyone has a more elegant solution to the modules dilemma, let us know!

I did this recently for a system on which I was testing various different
compilations of the same kernel, and then found that Red Hat 5.1 has init
scripts setup in a similar (though strange...they run lilo rather than
look at /proc) way. Instead of putting modules in
/lib/modules/$kernel_version, you put them in /lib/modules/$kernel_label.
i.e.

image = /kernels/vmlinuz-2.0.34a-secure
root = /dev/sda1
label = 2.0.34a
read-only

# cat /proc/cmdline
auto BOOT_IMAGE=2.0.34a ro root=801 ramdisk=0 mem=127M panic=20

For this kernel, you'd have the modules in /lib/modules/2.0.34a. Your
startup scripts would then do a cat /proc/cmdline to find out what kernel
booted, do an ln -sf /lib/modules/$kernel_label /lib/modules/current, and
have the scripts setup to load modules out of /lib/modules/current. Then
you can have as many variations of the same kernel release as you like,
and not worry about which modules go with which kernel.

------------------------------------------------------------------
Jon Lewis <jlewis@fdt.net> | Spammers will be winnuked or
Network Administrator | drawn and quartered...whichever
Florida Digital Turnpike | is more convenient.
______http://inorganic5.fdt.net/~jlewis/pgp for PGP public key____

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html