Ken, /proc/pci contains much of the info provided by lspci. For an initrd script, you might want to consider looking at the linux-live scripts used to build many of the livecds you find online (include the SL flavor made by Urs). I believe if you look at Urs's livecd-trunk, you will find linux-live.sl/initrd/liblinuxlive. This file has procedures for probing all common modules for a certain type of support (e.g. modprobe_usb_sata_modules). Brute force seems the standard way to go. I've made livecds in several ways, and have not run into a situation where I had to manually identify and probe modules for a specific IDE or SATA controller. Are you doing something drastically different from the norm? Cheers, Mark Ken Teh wrote: > Hi Troy, > > I'm looking for something more basic. I'm trying to craft an init > script for an initrd image to load appropriate drivers. Nothing > fancy. Just the basics. Like what sort of hard drives are on the > system. SATA or IDE? The SATA issue confuses me since there is a > plethora of SATA drivers. Does the init script have to try each one > to see if it finds a match or is there something in /proc or /sys that > provides some identification? > > The only tool I have in my initrd image is busybox and it doesnt have > an lspci equivalent. The /proc system contains a subdirectory that > lists all devices on PCI but as bus.device files. I tried cat'ing the > files but they are not ascii. I'm guessing it's possible to walk > these files to extract the information I need. I can dig deeper but > to save time, I'd ask if someone already knows the answer. > > Ken > > > > > Troy Dawson wrote: >> Mark Stodola wrote: >>> I believe most of anaconda's "magic" comes from probing the PCI and >>> USB bus for vendor and device IDs. If you dig into a driver (for >>> example, e1000e), you will find a pcitable listing all of the IDs >>> the driver supports. If you look in /lib/modules/<kernel>/ you will >>> find a modules.pcimap and modules.usbmap among other bus types. >>> >>> Hope that helps. >>> >>> Cheers, >>> Mark >>> >>> Ken Teh wrote: >>>> How does a system determine the appropriate sata driver? >>>> Specifically, how does anaconda figure out to write >>>> >>>> alias scsi_hostadapter ata_piix >>>> >>>> in my modprobe.conf and to bind it into my initrd image? >>>> >>>> I took apart boot.iso but didnt find anything "readable" that >>>> indicated how this was determined. >>>> >>>> Thanks! >>>> >>>> Ken >>>> >>> >>> >> >> Hi Ken, >> On SL 5, alot of that data comes from hwdata, which is in the >> /usr/share/hwdata directory. >> The main ones people and programs look at is >> pci.ids and usb.ids >> But there are other files in there. >> Troy > -- Mr. Mark V. Stodola Digital Systems Engineer National Electrostatics Corp. P.O. Box 620310 Middleton, WI 53562-0310 USA Phone: (608) 831-7600 Fax: (608) 831-9591