Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] Fwd: [Sgl-Discuss] Hardware autodetection

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: nealbirch <nealbirch AT attbi.com>
  • To: Jason Flatt <jasonflatt AT wizard.com>
  • Cc: sm-discuss AT lists.ibiblio.org, abrice2 AT cox.net
  • Subject: Re: [SM-Discuss] Fwd: [Sgl-Discuss] Hardware autodetection
  • Date: Sun, 29 Sep 2002 09:55:58 -0400

Jason Flatt wrote:
This was sent to the list a few months back.
Subject: [Sgl-Discuss] Hardware autodetection
Date: 09 Jul 2002 23:50:02 -0700
From: Aaron Brice <abrice2 AT cox.net>
To: sgl-discuss AT sourcemage.org

So I've been thinking lately that hardware autodetection and
configuration would be a handy thing. I remember installing SGL and
having trouble figuring out what kernel module my D-Link ethernet card
should use

agreed!


However, attached is a script that is a first attempt to duplicate some
of the functionality. It depends on lspci from the pciutils spells, and
the hwdata spell that I just submitted to sgl-spell-submit. It only
checks the PCI bus, but can give you the kernel modules needed for a
category of hardware.

For example, instead of asking the user what module to use for the
ethernet card, you can put:

MOD=$(devlist.sh --module --category NETWORK_ETHERNET)

For the alsa-driver spell, instead of using the dialog to let a user
select the audio module, you could do:

CARD=$(devlist.sh --module --category MULTIMEDIA_AUDIO)

Again, as far as I know this only works for stuff on the PCI bus. I
don't have any ISA cards or ISA slots for that matter, but I assume
lspci will not display ISA cards.

Before I go any further I'd like to see if anyone else has opinions on
the subject. Maybe kudzu would be the way to go, or maybe there's an
easy-to-configure autoconfiguration utility out there somewhere that I
wasn't able to find..

# CLASSFILE is the file containing the class id definitions
CLASSFILE=/usr/src/linux/include/linux/pci_ids.h
# MODFILE maps the device id's to linux modules
MODFILE=/usr/share/hwdata/pcitable
>8 snip! 8<
-m, --module
display *only* the kernel modules required for the specified categories (or all modules if no category is specified). Output is one module per line

-c, --category
Used to specify a certain type of PCI device. For example,
specifying --category NETWORK_ETHERNET will display only the
ethernet card, if found. The categories are found in
/usr/src/linux/include/pci_ids.h and start with PCI_CLASS_
-h, --help
This message
>8 snip!8<
if [ ! -e $MODFILE ]; then
echo "Must cast the hwdata spell first"

WHERE IS THE HWDATA SPELL!!!! argh! This is great! did it just fall through the cracks or what?!

MY problem with most of the ways to figure the info was cross-referencing the data we can pull by polling the equipement with a (at the time I thought not-available to us) list.

Good job, Aaron! And Thanks Jason for bringing it back to our attention!

neal


--
"You can fool some of the people all of the time
--and those are the ones you have to concentrate on!"
GW Bush-- from the N.Y. Times





Archive powered by MHonArc 2.6.24.

Top of Page