On Wed, 16 Jun 1999, Mark Wagnon wrote: > Brad wrote: > [snip] > > > > On my system, i put a script in /etc/init.d to automatically insert the > > proper sound modules on boot (after isapnp runs and configures the card) > > Brad, > > would you mind sharing your script? I took a loot at those in init.d > (most specifically that of xfstt) and I think I need some guidance > before I try to write my own.
No problem, although my script probably isn't a model you'll want to follow ;) /etc/init.d/skeleton would be a better model for just about every case you'll need. Also, there's a bit of redundancy here. I call isapnp, but the isapnptools package installs a script (run before this one) that does the same. I could probably then delete that line, i just need to get the time to test it... Ditto for changing some of those insmods to modprobes; when i wrote the script i didn't know how to use modprobe, and after that i didn't want to break something that worked. As a final note, i redirect all error messages to /dev/null. Works ok for me for this script, YMMV.
#!/bin/sh case "$1" in start) echo -n "Setting up sound card..." # Plug n Play config isapnp /etc/isapnp.conf 2> /dev/null # Install basic sound modules insmod soundcore 2> /dev/null insmod sound 2> /dev/null # init'ize uart thing, because sb needs it insmod uart401 2> /dev/null # Set up the actual sound card! Pulled numbers out of /etc/isapnp.conf insmod sb io=0x220 irq=9 dma=1 dma16=5 mpu_io=0x300 type=6 2> /dev/null # Midi support. Note that this automatically loads opl3.o as well modprobe adlib_card io=0x388 2> /dev/null echo "Done." esac exit 0