public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Block device driver info in /proc?
@ 2002-07-15 15:34 Daniel Tuijnman
  0 siblings, 0 replies; only message in thread
From: Daniel Tuijnman @ 2002-07-15 15:34 UTC (permalink / raw)
  To: linux-kernel

Hello,

I'm looking for a robust way to match block devices with the
corresponding device driver modules. Not just IDE and SCSI disks, but
also disks attached to disk array controllers as the Compaq IDA or
CCISS. All these modules present info in the /proc filesystem.

My question is, is there a uniform way to find it, i.e., is there a
standard for the /proc layout?

Or should I resort to make my own table to match device names to module
names? That's a solution I don't like, as it means adapting my program
each time a new device comes to the market.

Background of this question: I'm writing a Linux installer, and I need
to add the right entries to /etc/modules.conf
(e.g.: alias block-major-82 cpqarray),
and to pass the right modules to mkinitrd so Linux can be booted from
a disk attached to such a device. So then I need to find out which
(loaded) modules correspond to which devices. I can read in
/proc/partitions which disks there are, with their device names and 
major numbers, but how can I relate this to the module that drives it?

For the Compaq IDA controller, for instance, /proc/partitions tells me I
have a disk /dev/ida/c0d0 with major device number 82,
then /proc/devices tells me block device 82 is named ida0, and then I
can find a file /proc/driver/block/cpqarray/ida0 from which I can infer
that the module name is cpqarray. Does this work for other drivers the
same? Or is there another way to match the two?

Cheers,
Daniel Tuijnman


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-07-15 15:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-15 15:34 Block device driver info in /proc? Daniel Tuijnman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox