public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Tuijnman <daniel@ATComputing.nl>
To: linux-kernel@vger.kernel.org
Subject: Block device driver info in /proc?
Date: Mon, 15 Jul 2002 17:34:50 +0200	[thread overview]
Message-ID: <20020715173450.B21106@ATComputing.nl> (raw)

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


                 reply	other threads:[~2002-07-15 15:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020715173450.B21106@ATComputing.nl \
    --to=daniel@atcomputing.nl \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox