On Wed, 4 Mar 2009, peasthope@xxxxxxx wrote: > Folk, > > This was given to me as an example of a > script to fix the order of loading of devices. > > alias snd-card-0 snd-emu10k1 > options snd-emu10k1 index=0 > remove snd-emu10k1 { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-emu10k1 > alias snd-card-1 snd-intel8x0 > remove snd-ca0106 { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-ca0106 > options snd-intel8x0 index=1 > remove snd-intel8x0 { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0 > alias snd-card-2 snd-usb-audio > options snd-usb-audio index=2 > > I understand an alias of course. These are my questions. No, you probably do not. This is NOT the same as the alias of the bash shell. It is a command to modprobe telling it that if it receives a request to load the module snd-card-1 it should actually load snd-intel8x0. > > "options" isn't a shell command. What is it? It is a command to modprobe, which is the command which reads and interprets this file. It says that if the first name following the options word is called, it should be called with the listed options. Ie, if snd-intex8x0 is loaded, it should be loaded with the option, index=1 Ie, the command insmod snd-intel8x0 index=1 should be used. > > "remove" also isn't a shell command. What is it? It is a command to modprobe. > > What is the objective of "alsactl store 0 >/dev/null"? that says run the command alsactl with the options store 0, and redirect the stdout to /dev/null. This stores the current settings of the soundcard 0 . > > The modprobe command unloads driver module > and "causes modprobe to ignore install and remove > commands in the configuration file ...". Without > drivers, how do sound devices work? The line remove snd-intel8x0 { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0 says, if you receive the command modprobe -r and-intel8x0, first open a shell and run /usr/sbin/alsactl store 0 >/dev/null 2>&1 followed by the command if not successful, and then run /sbin/modprobe -r --ignore-remove snd-intel8x0 which means run modprobe but do NOT look at the line starting with remove snd-intel8x0 (otherwise you would obviously have an infinite loop) > > Why is a "remove" and a "modprobe" command squeezed onto > one line rather than on successive lines? remove is an option to modprobe. > > Why is the order of these commands different for each device? > > Such a script belongs in modules.conf? No, it is NOT a script and it belongs in modprobe.conf. > > Thanks for any answers, ... Peter E. > > ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Alsa-user mailing list Alsa-user@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-user