linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: How to identify contents of /lib/modules/*
@ 2003-04-16 18:57 Cameron, Steve
  0 siblings, 0 replies; 12+ messages in thread
From: Cameron, Steve @ 2003-04-16 18:57 UTC (permalink / raw)
  To: Paul.Clements; +Cc: linux-kernel


Paul.Clements@steeleye.com wrote:

> The truth is, the kernel rpms for this distro are not designed to be 
> installed side by side, they really ought to be upgraded (meaning the 
> old stuff gets removed, so there's no ambiguity). Do you actually 
> have customers that are installing multiple kernels and moving /lib/modules 
> dirs around? (I know we do this in our labs, and you may too, but I 
> can't imagine too many customers doing this...)

Yes, the RPMs in question overwrite the currently used kernel.... 
(then of course, the user is rather amazed and disgusted at the 
nerve of this RPM.   The next time he has such an RPM to install 
he remembers this event, and saves off his old kernel and 
/lib/modules directory before the RPM can destroy it.)

> > Also note, I can't just figure out which is the _running_ kernel  [...]
? Hmm... I'm not sure how feasible that's going to be... 

The problem case here is this one:

1) You have a brand new machine, with a brand new disk controller.
You install the OS, use a driver diskette for the brand new
disk controller.  The driver diskette is made for the default
kernel installed by the base media.  

2) You install a new errata kernel (because let's suppose the one on the CD
has known security problems, or something.)  However, you cannot 
reboot yet because the new errata kernel does not contain a driver which 
understands your new controller.

3) Install RPM driver for the new controller.  The RPM cannot rely on 
the running kernel, because you don't care about the running kernel,
you care about the errata kernel that you just installed, but which is
not yet running.

So feasible or no, we must try.  (Anyway, I think I have something
that will work, it's just kinda ugly, is all, and I was hoping
there was a beter way.)

> Is there any chance that SuSE (oops, let the cat out of the bag ;) 

I never said SuSE.  (Excellent guess though. :-)

> would accept your driver(s) into their distribution, or

Yes, that's no problem.  But it's always too late.
There will always be the case that we must support old
kernels that were deployed before the hardware that we're
trying to support.  And by "support" I also mean that
some level of testing has occurred, so this isn't possible.

Thanks for your thoughts on the matter.

-- steve

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: How to identify contents of /lib/modules/*
@ 2003-04-17 20:02 Perez-Gonzalez, Inaky
  0 siblings, 0 replies; 12+ messages in thread
From: Perez-Gonzalez, Inaky @ 2003-04-17 20:02 UTC (permalink / raw)
  To: 'Kristofer T. Karas', 'Linux Kernel Mailing List'
  Cc: 'Alan Cox', 'steve.cameron@hp.com'

> From: Kristofer T. Karas [mailto:ktk@enterprise.bidmc.harvard.edu]
>
> I have a worse problem.  :-)   I often run several instances of the
> identically version-numbered kernel, all available from the LILO boot
> menu, each instance having a different .config or perhaps compiled with
> a different gcc.  If each instance wants to share
> /lib/modules/[sameversion]/... then I've got a problem.

I solve that appending to EXTRAVERSION ... 2.5.66.5.2-rtfutex is the
latest build of the 20+ 2.5.66 slightly different kernels I have 
installed in the same machine for testing. And they all have different
module directories.

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: How to identify contents of /lib/modules/*
@ 2003-04-16 15:58 Cameron, Steve
  2003-04-16 16:01 ` Alan Cox
  0 siblings, 1 reply; 12+ messages in thread
From: Cameron, Steve @ 2003-04-16 15:58 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List

Alan Cox wrote:

> On Mer, 2003-04-16 at 03:00, Stephen Cameron wrote:
> > The task for the binary driver distributor becomes to figure out which
> > of these multiple errata kernels found in /boot corresponds to the 
> > /lib/modules directory, so we can drop the binary driver that was
> > made for that errata kernel in there, and not a driver made for the
> > wrong kernel.
> 
> if its an rpm based distro
> 
> 	rpm -qf /lib/modules/[version]/something
> 
> will tell you which kernel owns the file.
[...]

Yep. I thought of that too, which is why I had also written:

steve> Also, rpm -qf to try to id the RPM from which some /lib/modules file
steve> or vmlinuz won't necessarily work, as rpm can report they belong to 
steve> multiple RPMs in certain cases.

I think it's the use of "--force" option to RPM that causes this,
or else, faulty RPMs.  It's not so easy to make a well-behaved
RPM.  Having tried myself, sometimes I think maybe RPM 
really stands for "Revolting Pile of Manure". (no offense ;-) Of 
course I'm probably trying to bend it do a job for which perhaps 
it is not so well suited.

-- steve


^ permalink raw reply	[flat|nested] 12+ messages in thread
* How to identify contents of /lib/modules/*
@ 2003-04-16  2:00 Stephen Cameron
  2003-04-16 14:21 ` Alan Cox
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Stephen Cameron @ 2003-04-16  2:00 UTC (permalink / raw)
  To: linux-kernel


Hi, here's a problem I'm having, perhaps someone has some smart idea...

A certain major linux distribution distributes a number of binary 
kernels, errata kernels, which all report the exact same thing 
via "uname -r".  These kernels may differ by only a little
(only the .config file is different in some small way) or by 
a lot (binary drivers for one don't work (panic) on another).

I seem to be in the business of distributing binary drivers to customers,
like it or not.  Since there already exist multiple incompatible
errata kernels that all share the same uname -r and hence the same
directory for modules, and since all these errata kernels *might*
be found on a single machine in /boot.... (only one of which is likely
to be viable, since there is only one /lib/modules directory for
them all)...

The task for the binary driver distributor becomes to figure out which
of these multiple errata kernels found in /boot corresponds to the 
/lib/modules directory, so we can drop the binary driver that was
made for that errata kernel in there, and not a driver made for the
wrong kernel.

So far, the best idea I have come up with is to construct a database
of checksums of all the *.o files in the various /lib/modules directories
that come with the various errata kernels, then compare that database
against what is actually found in /lib/modules.  (note, the results will
likely never match _exactly_, since binary driver distributors like myself
can drop .o files in /lib/modules, and alos, this distribution doesn't use
the symbol name checksums, so identical *.o files appear occasionally in
/lib/modules for different errata kernels.)  Then count which errata kernel 
matches the most *.o files, and assume that must be the one (and probably
should have some minimum numver to match, lest the user have only kernels
we know nothing about)

This seems like a lot of contortions to go through and I'm wondering
if there's a simpler way to identify the contents of /lib/modules, 
aside from the 'uname -r' type string, and I just missed it.

Also note, I can't just figure out which is the _running_ kernel
(by checksumming /boot/vmlinuz, cross-checked against /etc/lilo.conf
or grub conf file, because in certain situations the running kernel
is only there to install another kernel.  And we want to provide
the option to install the driver for all the kernels on the system
that we can (reliably) find.)

Also, rpm -qf to try to id the RPM from which some /lib/modules file
or vmlinuz won't necessarily work, as rpm can report they belong to 
multiple RPMs in certain cases.

Thanks for any other ideas.

-- steve


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-04-17 19:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-16 18:57 How to identify contents of /lib/modules/* Cameron, Steve
  -- strict thread matches above, loose matches on Subject: below --
2003-04-17 20:02 Perez-Gonzalez, Inaky
2003-04-16 15:58 Cameron, Steve
2003-04-16 16:01 ` Alan Cox
2003-04-16 20:54   ` Henning P. Schmiedehausen
2003-04-16  2:00 Stephen Cameron
2003-04-16 14:21 ` Alan Cox
2003-04-16 16:06   ` Dominik Kubla
2003-04-17 18:08   ` Kristofer T. Karas
2003-04-16 15:18 ` Arjan van de Ven
2003-04-16 17:08 ` Jeremy Jackson
2003-04-16 17:20 ` Paul Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).