...
> I read somewhere that one big advantage of unices is the extensive
> recycling of ideas and concepts.
Don't you know it!
For the PCMCIA driver collection, I had the need for something like
scsidev, but didn't know that it existed at that time. So I wrote
something somewhat similar, but also along the lines of what you have
in mind. My "scsi_info" command produces information like:
# scsi_info /dev/sda1
SCSI_ID="0,4,0"
MODEL="Syquest EZ135S"
FW_REV="1_12"
I also have a similar tool for IDE drives:
# ide_info /dev/hda
MODEL="TOSHIBA MK1824FCV"
FW_REV="P0.09 B"
SERIAL_NO="Z4J60510"
Then, the scripts for configuring SCSI devices do things like:
eval `scsi_info /dev/$DEVICE`
ADDRESS="$SCHEME,$TYPE,$SOCKET,$SCSI_ID"
case $ADDRESS in
*,sr,*,*,*,*)
# stuff for CD-ROM's
*,*,*,0,4,0)
# stuff for my Syquest drive
;;
esac
-- Dave Hinds
dhinds@hyper.stanford.edu