Date: Tue, 31 May 2011 18:01:58 -0500 From: Antonio Olivares <olivares14031@gmail.com> To: Xn Nooby <xnooby@gmail.com> Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: A small script to customize FreeBSD Message-ID: <BANLkTin_vrAVcwGdsTKLv8T1T=CHj2_8NA@mail.gmail.com> In-Reply-To: <BANLkTin%2BODPaYLUXH83inyPFxHvcUZQ8Kw@mail.gmail.com> References: <BANLkTi=5TTgA94sd6KU-XToS=qDBnNYWTg@mail.gmail.com> <BANLkTinvg0ewgvTKbzGk94AyGz%2B1yxmQLg@mail.gmail.com> <BANLkTin%2BODPaYLUXH83inyPFxHvcUZQ8Kw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>> You could always have ${1:-theuser} instead to have a default of >> theuser, but take the value for username as the first argument. >> >> Chris >> > > That's a good idea. =A0The user was originally called "me", but I wanted > something that could be searched and replaced without breaking "gnome" > and "home". =A0Using a parameter would be even better, thanks!. > _______________________________________________ For the sound setup: loadSoundVBX() { echo loadsoundVBX... kldload snd_driver cat /dev/sndstat echo 'snd_ich_load=3D"YES"' >> /boot/loader.conf } kldload snd_driver will load the sound driver that it thinks would be the best, but then the driver is changed to ``snd_ich`` in the script. If a user has ``snd_hda``, then the script should output snd_hda and substitute in the loading statement. I see the following code could do the job, but it might need some testing := ( #!/bin/sh # # Detect sound driver for driver in /boot/kernel/snd_*; do driver=3D$(echo ${driver} | sed 's|/boot/kernel/snd_||') if [ ${driver} =3D "driver.ko" ]; then continue; fi kldload snd_${driver} if [ -c /dev/mixer0 ]; then echo "I'm smelling 'snd_${driver}'" echo "snd_${driver}_load=3D\"YES\"" >> /boot/loader.conf exit 0 fi kldunload snd_${driver} done This found in here: http://forums.freebsd.org/showthread.php?t=3D22726 The script looks very nice and it could be a valuable asset for the future. Still, there are some things that we(users) need to do by hand and get our hands dirty :) In my case, I could not determine my sound card, I did not get very nice information from cat /dev/sndstat [olivares@tricorehome ~]$ cat /dev/sndstat FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64) Installed devices: pcm0: <HDA VIA VT1708B_1 PCM #0 Analog> (play/rec) default pcm1: <HDA VIA VT1708B_1 PCM #1 Analog> (play) pcm2: <HDA VIA VT1708B_1 PCM #2 Digital> (play) But thanks to list members and their experience, someone suggested to use snd_hda and it worked to perfection :) Regards, Antonio
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTin_vrAVcwGdsTKLv8T1T=CHj2_8NA>