View previous topic :: View next topic |
Author |
Message |
CRC Tux's lil' helper
Joined: 30 Mar 2003 Posts: 90 Location: Dallas, TX, USA
|
Posted: Sat Jun 07, 2003 6:53 am Post subject: Auto-create modules.autoload |
|
|
These days, pcmcia and usb are controlled by hotplug, and ISA is dead, but finding the modules for your PCI cards can be a pain. Ideally, modules.conf controls everything to load the right drivers when you open the device, but this can be a pain to set up, and isn't really necessary. Gentoo uses a simple "modules.autoload" for loading various modules at boot time.
But ... what modules do you need? Try this script. It will scan your PCI bus and find the modules for you!!
Code: |
#!/bin/sh
pci_module_array () {
while read JUNK ID JUNK
do
VENDOR=`echo $ID | cut -b1-4`
DEVICE=`echo $ID | cut -b5-8`
ENTRY=`echo 0x0000${VENDOR} 0x0000${DEVICE}`
grep "$ENTRY" /lib/modules/`uname -r`/*.pcimap | cut -d ' ' -f1
done
}
for MODULE in `pci_module_array < /proc/bus/pci/devices | sort -u`
do
# echo "Loading $MODULE ..."
# modprobe -q $MODULE >/dev/null 2>&1
echo $MODULE
done
|
Comment out the "echo $MODULE" line and uncomment the other two if you'd rather make this an init script to just load the modules. Great for CD-ROMS! Also try redirecting the output using >>/etc/modules.autoload _________________ Unix/Linux Consulting & Hosting
We Support Gentoo!
http://CoolRunningConcepts.com
Freenode: Taro! |
|
Back to top |
|
|
Esben Apprentice
Joined: 29 Jun 2002 Posts: 244 Location: Copenhagen/Denmark
|
Posted: Sat Jun 07, 2003 9:32 am Post subject: |
|
|
That' s a rather cool script Too bad I don't have more than one pci-device _________________ regards, Esben
True trade is honest, but not merciful. Politics is dishonest, no matter how merciful... and war is neither honest nor merciful.... therefore, choose trade above politics, but politics above war. |
|
Back to top |
|
|
GenKiller n00b
Joined: 04 Mar 2003 Posts: 66 Location: United States of America
|
Posted: Tue Jun 10, 2003 5:21 pm Post subject: |
|
|
Very neat script! This is perfect for a project I'm working on. Thanks for sharing it with us! _________________ http://www.digital-drip.com |
|
Back to top |
|
|
scoobydu Veteran
Joined: 16 Feb 2003 Posts: 1076 Location: 'Mind the Gap'
|
Posted: Tue Jun 10, 2003 5:28 pm Post subject: |
|
|
Neat script
Although it only finds my audfigy2, but not my network card or raid controller??
Thanks for sharing it though .. |
|
Back to top |
|
|
CRC Tux's lil' helper
Joined: 30 Mar 2003 Posts: 90 Location: Dallas, TX, USA
|
Posted: Tue Jul 01, 2003 12:58 am Post subject: |
|
|
For this to work, you have to have all your modules compiled. It only finds modules you have compiled! _________________ Unix/Linux Consulting & Hosting
We Support Gentoo!
http://CoolRunningConcepts.com
Freenode: Taro! |
|
Back to top |
|
|
|