daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Jul 12th, 2012 26 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #
  3. #
  4. # Provided under the GNU General Public License version 2 or later or the GNU Free Documentation License version 1.2 or later, at your option.
  5. # See http://www.gnu.org/copyleft/gpl.html for the Warranty Disclaimer.
  6.  
  7. # This script upgrades ALSA on Ubuntu and Linux Mint systems from 2.6.24-28 (non)-ubuntu kernels onwards and is not following
  8. # official Ubuntu/Debian package handling rules
  9.  
  10. # This script is not compliant to Ubuntu official .deb package handling. This script overwrites the existing files and modules.
  11. # You won't see any changes on the revisions if you run e.g. synaptics..
  12. # If there are official ALSA updates supplied by Ubuntu repositories or kernel changes, these will overwrite your manual ALSA upgrade -
  13. # you need to re-run this script in this case.
  14. # You can check the Alsa revision by typing "cat /proc/asound/version" or "alsactl --version" or the utils by "aplay --version"
  15. #
  16. # Note: As usual  I'd like to recommend that you make a backup of your drive first. I don't guarantee for anything!
  17. #
  18. # The script compiles all drivers by default.
  19. #
  20. # The official thread connected to this script you'll find at: http://ubuntuforums.org/showthread.php?t=962695  
  21. #
  22. # You might want to go through the script and try to understand what it is doing. It's not rocket science. It's not a must though.
  23. #
  24. #  Changelog:
  25. #
  26. #  Rev: 1.00  01-01-2008 Temujin   initial idea
  27. #  Rev: 1.01  09-05-2008 soundcheck Changelog: Complete rewrite, bugfixes/cleanup
  28. #  Rev: 1.02  09-22-2008 soundcheck Changelog: A bit of cleanup/Intro of revison handling/Install drivers before libs/2.6.27 support/multiple alsa-rev support
  29. #  Rev: 1.03  10-04-2008 soundcheck Changelog: PackageUpdate AlsaLib 1.0.17a
  30. #  Rev: 1.04  10-05-2008 soundcheck Changelog: Output to logfile/different installation modes selectable/different alsa revisions stored on drive
  31. #  Rev: 1.05  10-16-2008 soundcheck Changelog: Bugfix typo "sequencer"
  32. #  Rev: 1.06  10-16-2008 soundcheck Changelog: introducing snddevices script, separate configure&make from make
  33. #                                        install, to avoid corrupt installations if one module compilation/installation fails    
  34. #  Rev: 1.07  10-17-2008 soundcheck Changelog: Using specific kernel headers for driver compilation, taking out soundevices
  35. #  Rev: 1.08  10-17-2008 soundcheck Changelog: script cleanup and introduction of "compile only" (dry run) option, take out kernel-headers option in driver config
  36. #  Rev: 1.09  10-25-2008 soundcheck Changelog: Added libasound2-dev to the package list. It seems that alsalib won't compile properly without it.
  37. #  Rev: 1.11  10-29-2008 soundcheck Changelog: run "make install" on lib befoe compiling alsa-utils
  38. #  Rev: 1.12  11-12-2008 soundcheck Changelog: alsa-driver 1.018a changelog http://www.alsa-project.org/main/index.php/Changes_v1.0.18_v1.0.18a
  39. #  Rev: 1.13-beta  11-30-2008 soundcheck Changelog: chmod of /devices; 2.6.28 kernel support, restore option, prepared for alsa-tools install
  40. #  Rev: 1.14  12-15-2008 soundcheck Changelog: introduction of latest alsa-driver snapshot-install (option -snap), introduction of help menu, clean up
  41. #  Rev: 1.15  12-16-2008 soundcheck Changelog: added asound.state workaround to get mixer-settings restored
  42. #  Rev: 1.16  01-21-2009 soundcheck Changelog: added kernel-headers compile option to alsa-driver/ support of 1.0.19
  43. #  Rev: 1.17  05-10-2009 soundcheck Changelog: Added 1.0.20 support, added 2.6.29 support
  44. #  Rev: 1.0.21-1 09-13-2009 soundcheck Changelog: Added 1.0.21 support, Kernel support up to 2.6.31, cosmetics
  45. #  Rev: 1.0.21-2 09-15-2009 soundcheck Changelog: minor corrections, scripts exits now if not all Packages can be loaded
  46. #  Rev: 1.0.21-3 09-15-2009 soundcheck Changelog: dependency libncursesw5-dev added
  47. #  Rev: 1.0.21-4 09-16-2009 soundcheck Changelog: dependency libavutil49 added
  48. #  Rev: 1.0.22.1-1 01-05-2010 soundcheck Changelog: 1.0.22.1 support, 2.6.32 support, change in workflows and cleanup, tools compile added, firmware copied to /lib/firmware, intro of libfltk-dev as dependency for hdsploader, improved dialogs, more easy selectable drivers, added linux-sound base to the alsa packages
  49. #  Rev: 1.0.22.1-1 01-06-2010 soundcheck Changelog: removed libavutil49 and python-dev-all from dependency list
  50. #  Rev: 1.0.23-1 05-10-2010 soundcheck Changelog: added 1.0.23 support , automatic update /upgrade removed, a little maintenance
  51. #  Rev: 1.0.23-2 05-11-2010 soundcheck Changelog: added cleanup function which removes the source code and other utilites required for compiling Alsa, xmlto installs now without recommends
  52. #  Rev: 1.0.24-1 02-04-2011: ALSA 1.0.24, put source in /opt to better comply with Debian policy.
  53. #  Rev: 1.0.24-2 02-07-2011: use --with-oss=no on Maverick or later
  54. #  Rev: 1.0.25-1 01-30-2012: ALSA 1.0.25
  55. #  Rev: 1.0.25-2 01-31-2012: fix alsa-utils build error
  56. ##--------------------------------------------------------------------------------------------------------------------------------------
  57. # Below package variables need to be adapted according to available package ids at  http://www.alsa-project.org/main/index.php/Download
  58. # otherwise the script execution will fail!
  59. ##--------------------------------------------------------------------------------------------------------------------------------------
  60.  
  61. PACKAGE=1.0.25
  62.  
  63. setpack () {
  64. DRIVER=alsa-driver-1.0.25
  65. FIRMWARE=alsa-firmware-1.0.25
  66. LIB=alsa-lib-1.0.25
  67. PLUGINS=alsa-plugins-1.0.25
  68. UTILS=alsa-utils-1.0.25
  69. TOOLS=alsa-tools-1.0.25
  70. OSS=alsa-oss-1.0.25
  71. }
  72.  
  73. #### edit tools array if required
  74. #TOOLSLIST =( ac3dec as10k1 envy24control hdsploader hdspconf hdspmixer \
  75. #             mixartloader pcxhrloader rmedigicontrol sb16_csp seq sscape_ctl \
  76. #            us428control usx2yloader vxloader echomixer ld10k1 qlo10k1 )
  77. #
  78. #Example RME cards: TOOLSLIST=( hdsploader hdspconf hdspmixer )
  79.  
  80. TOOLSLIST=( )
  81.  
  82.  
  83. ###Drivers: to improve the compilation time you might want to compile the driver required for your system
  84. ###         Change below variable accordingly: Default: CARDS="all"
  85. ###         Stripped down example: CARDS="usb-audio,hda-intel,hdsp,hrtimer,rtctimer"
  86.  
  87. CARDS="all"
  88. #CARDS="usb-audio,hda-intel,hdsp,hrtimer,rtctimer"
  89.  
  90. #####################################################################################################################################################
  91. #------------Usually NO Changes to be done below this line-----------------------------------------------------------------------------------------
  92. #####################################################################################################################################################
  93.  
  94. # script revision
  95. REV="$PACKAGE-2"
  96.  
  97. SRCDIR=/opt         # Sources will be stored here
  98. ALSASRCDIR=${SRCDIR}/alsa  # Packages will be stored here
  99. NOW=`date '+%m%d%y-%H.%M'`
  100. DATE=`date`
  101. LOGFILE=/var/log/AlsaUpgradeRev-$REV-$NOW.log
  102. KERNEL=`uname -r`
  103. CURRENTPACKAGE=`cat /proc/asound/version | grep "Sound" | awk '{ print $7 }'`
  104. KERNELPACKS=( `dpkg -l |  awk '{print $2}' | grep -e ${KERNEL}` )
  105.  
  106. ALSAPACKS=( linux-sound-base alsa-base alsa-utils libasound2 alsa-firmware  alsa-firmware-loaders alsa-oss alsa-tools alsa-tools-gui libasound2-plugins aconnectgui libpulse0  )
  107. TOOLPACKS=(  build-essential module-assistant  gettext  xmlto  bzip2 )
  108. DEVPACKS=( alsa-source python-dev libsysfs-dev libncurses5-dev libncursesw5-dev libpulse-dev libspeex-dev libavcodec-dev libavformat-dev libavutil-dev libmpeg4ip-dev liba52-0.7.4-dev libsamplerate0-dev libfltk1.1-dev libsdl1.2-dev linux-headers-$KERNEL )
  109. CLEANUPPACKS=( python-dev libsysfs-dev libncurses5-dev libncursesw5-dev libpulse-dev libspeex-dev libavcodec-dev libavformat-dev libavutil-dev libmpeg4ip-dev liba52-0.7.4-dev libsamplerate0-dev libfltk1.1-dev libsdl1.2-dev)
  110.  
  111.  
  112. #---------------------------------------------------------------------------------------------------------------------------------
  113.  
  114. #---You need to have root permissions to run the script----
  115.  
  116. if [ "$UID" -ne 0  ]
  117.  then
  118.  echo "Must be root to run this script..."
  119.  exit 0
  120. fi  
  121.  
  122. package () {
  123. echo -n "Continue to $1 $PACKAGE [y/n]: "
  124.    read yesno
  125.    case $yesno in
  126.                 y* | Y*         ) setpack ;;
  127.                 n* | N*         ) header "Nothing changed! " ; exit 0  ;;
  128.                 *               ) header "Nothing changed! " ; exit 0  ;;
  129. esac
  130.  
  131. ALSASRCDIR=${SRCDIR}/Alsa-${PACKAGE}
  132. clear
  133. }
  134.  
  135.  
  136.  
  137. header () {
  138. echo "
  139. ***************************************************************************
  140. *  ${1}
  141. ***************************************************************************"
  142. }
  143.  
  144. die () {
  145.   header "$1"
  146.   exit 1 #error
  147. }
  148.  
  149. greet () {
  150. clear
  151. echo "
  152. **$NOW****Alsa-Upgrade-Script-$REV *********************
  153. *
  154. * You'll be upgraded from Alsa $CURRENTPACKAGE to $PACKAGE
  155. *
  156. * Run -h option for further help and to look up the workflows
  157. *
  158. * Note1: Alsa won't be upgraded before you run the
  159. *        installation option "-i"!!
  160. *        The upgrade procedure shouldn't have any effect on Alsa
  161. *        until then. However - see Note2
  162. *
  163. * Note2: Do not delete the Alsa Source Directory under /opt!
  164. *        When starting the script the 2nd time with -d,
  165. *        the Alsa source dir will be deleted automatically!
  166. *        You won't have sound until you're done with that installation
  167. *
  168. * DISCLAIMER: Use this script at your own risk. I do not take any
  169. *             responsibility for any problems caused by running
  170. *             this script. Before running this script I strongly
  171. *             advise you to make a backup of your system.
  172. *             You might enter problems restoring the system to its
  173. *             original status when running the restore function
  174. *             supplied by the script.  
  175. *                            
  176. *  
  177. ***************************************************************************
  178.  
  179. "
  180. }
  181.  
  182.  
  183. prep () {
  184.  
  185. header "Working on following Alsa packages..."
  186. echo "Driver: $DRIVER"
  187. echo "Library: $LIB"
  188. echo "Plugins: $PLUGINS"
  189. echo "Utils: $UTILS"
  190. echo "Firmware: $FIRMWARE"
  191. echo "OSS: $OSS"
  192. echo "Installing tools: $TOOLS"
  193.  
  194. #installation of sources and dependencies required for compilation
  195.  
  196.  
  197. header "Checking availability of Alsa packages. Missing packages will be installed..."
  198.  
  199. for k in "${ALSAPACKS[@]}" ; do
  200.     if [ "$( dpkg -l  | grep "ii" | grep "$k" )" = "" ] ; then
  201.          header "$k will be installed"
  202.          apt-get -y install $k
  203.     else echo "$k already installed..."
  204.     fi
  205. done
  206.  
  207. header "Checking availability of supporting packages. Missing packages will be installed..."
  208.  
  209. for z in "${TOOLPACKS[@]}" ; do
  210.   if [ "$( dpkg -l  | grep "ii" | grep "$z" )" = "" ] ; then
  211.     header "$z will be installed"
  212.     if [ "$z" = "xmlto" ] ; then
  213.          apt-get -y install --no-install-recommends $z
  214.     else
  215.          apt-get -y install $z
  216.     fi
  217.   else echo "$z already installed..."
  218.   fi
  219. done
  220.  
  221. header "Checking availability of packages. Missing packages will be installed..."
  222.  
  223. for y in "${DEVPACKS[@]}" ; do
  224.   if [ "$( dpkg -l  | grep "ii" | grep "$y" )" = "" ] ; then
  225.     header "Package $y will be installed"
  226.     apt-get -y install $y
  227.     else echo "$y already installed..."
  228.   fi
  229. done
  230.  
  231. }
  232.  
  233. cleanup () {
  234.  
  235. # This function will clean up the built environment
  236.  
  237. header "Removing  supporting and source-code packages ..."
  238.  
  239. for p in "${CLEANUPPACKS[@]}" ; do
  240.   if [ "$( dpkg -l  | grep "ii" | grep "$p" )" != "" ] ; then
  241.     header "Package $p will be removed..."
  242.     apt-get -y remove $p
  243.     header  "Removal of $p done..."
  244.   else echo "Removal of $p failed, seems not to be installed anymore..."
  245.   fi
  246. done
  247.  
  248.  
  249.  
  250. echo "Done..."
  251.  
  252. # TODO check impact of below action
  253. #header "Removing unused libraries - apt-get autoremove"
  254. #apt-get -y autoremove
  255.  
  256. }
  257.  
  258. restorealsa () {
  259.  
  260. if [ "$( dpkg -l  | grep "ii" | grep  'alsa-source' )" = "" ] ; then
  261.     header "Package alsa-source will be installed first..."
  262.     apt-get -y install alsa-source
  263. fi
  264.  
  265. for z in "${KERNELPACKS[@]}" ; do
  266. header "Package $z will be reinstalled"
  267. apt-get -y --reinstall install $z
  268. done
  269.  
  270. for k in "${ALSAPACKS[@]}" ; do
  271. header "Package $k will be reinstalled"
  272. apt-get -y --reinstall install $k
  273. done
  274.  
  275. ####after restore of packages problems with some modules ( no soundcard ) therefore compilation of modules did the trick in my case
  276.  
  277. header "Compiling Alsa kernel modules to restore old setup"
  278. module-assistant -f -t -q a-i alsa-source
  279.  
  280. #header "Resetting old setup"
  281. #/etc/init.d/alsa-utils reset
  282.  
  283. depmod -a
  284.  
  285. }
  286.  
  287.  
  288.  
  289.  
  290. download () {
  291.  
  292. cd $SRCDIR
  293.  
  294. header "Downloading and extracting ALSA packages..."
  295. wget ftp://ftp.alsa-project.org/pub/driver/$DRIVER.tar.bz2 && tar -xjf $DRIVER.tar.bz2
  296. wget ftp://ftp.alsa-project.org/pub/firmware/$FIRMWARE.tar.bz2 && tar -xjf $FIRMWARE.tar.bz2
  297. wget ftp://ftp.alsa-project.org/pub/lib/$LIB.tar.bz2 && tar -xjf $LIB.tar.bz2
  298. wget ftp://ftp.alsa-project.org/pub/plugins/$PLUGINS.tar.bz2 && tar -xvf $PLUGINS.tar.bz2
  299. wget ftp://ftp.alsa-project.org/pub/utils/$UTILS.tar.bz2 && tar -xjf $UTILS.tar.bz2
  300. wget ftp://ftp.alsa-project.org/pub/tools/$TOOLS.tar.bz2 && tar -xjf $TOOLS.tar.bz2
  301. wget ftp://ftp.alsa-project.org/pub/oss-lib/$OSS.tar.bz2 && tar -xvf $OSS.tar.bz2
  302.  
  303. rm alsa*.tar.bz2
  304. rm -rf $ALSASRCDIR         # old sources will be deleted in any case if download gets started, Alsa won't work with deleted source-dir
  305. mkdir -p $ALSASRCDIR && mv alsa-* $ALSASRCDIR
  306.  
  307. }
  308.  
  309.  
  310. compile () {
  311.  
  312. header "Prepare for compilation and installation..."
  313.  
  314. test -d $ALSASRCDIR || die "$ALSASRCDIR not found - nothing to compile! Run download -d option first"
  315.  
  316. cd $ALSASRCDIR
  317.  
  318. test -d $DRIVER || die "$DRIVER  not found"
  319. test -d $FIRMWARE || die "$FIRMWARE not found"
  320. test -d $LIB || die "$LIB not found"
  321. test -d $PLUGINS || die "$PLUGINS not found"
  322. test -d $UTILS || die "$UTILS not found"
  323. test -d $TOOLS || die "$TOOLS not found"
  324. test -d $OSS || die "$OSS not found"
  325.  
  326.  
  327. #alsa-driver Note: Drivers to be installed before library#####################################################################################
  328. header "Compiling drivers..."
  329. cd $ALSASRCDIR/$DRIVER
  330. make clean
  331. ./configure --with-kernel=/usr/src/linux-headers-$KERNEL --with-cards=$CARDS --with-card-options=all --with-sequencer=yes --with-oss=no --prefix=/usr || die "$DRIVER configure failed"
  332. make || die "$DRIVER make failed"
  333.  
  334. #alsa-lib#####################################################################################################################################
  335. header "Compiling library..."
  336. cd $ALSASRCDIR/$LIB
  337. make clean
  338. ./configure --prefix=/usr || die "$LIB configure failed"
  339. make || die "$LIB make failed"
  340.  
  341. #alsa-plugins#################################################################################################################################
  342. header "Compiling plugins..."
  343. cd $ALSASRCDIR/$PLUGINS
  344. make clean
  345. ./configure  --prefix=/usr || die "$PLUGINS configure failed"
  346. make || die "$PLUGINS make failed"
  347.  
  348. #alsa-firmware###############################################################################################################################
  349. header "Compiling firmware..."
  350. cd $ALSASRCDIR/$FIRMWARE
  351. make clean
  352. ./configure --prefix=/usr || die "$FIRMWARE configure failed"
  353. make || die "$FIRMWARE make failed"
  354.  
  355. ## utils will be compiled and installed later on, since lib needs to be installed first
  356.  
  357. #alsa-oss####################################################################################################################################
  358. header "Compiling OSS..."
  359. cd $ALSASRCDIR/$OSS
  360. make clean
  361. ./configure --prefix=/usr || die "$OSS configure failed"
  362. make || die "$OSS make failed"
  363.  
  364. }
  365.  
  366.  
  367. installation () {
  368.  
  369. test -d $ALSASRCDIR || die "$ALSASRCDIR not found - nothing to install! Run download -d option first"
  370.  
  371. header "Installing all packages..."
  372.  
  373. header "Installing driver..."
  374. cd $ALSASRCDIR/$DRIVER
  375. make install || die "Nothing to install! Run compile -c option first"
  376.  
  377. #needed to prevent build error
  378. apt-get -y remove libasound2-dev
  379.  
  380. header "Installing library..."
  381. cd $ALSASRCDIR/$LIB
  382. make install
  383. header "Installing plugins..."
  384. cd $ALSASRCDIR/$PLUGINS
  385. make install
  386. header "Installing firmware..."
  387. cd $ALSASRCDIR/$FIRMWARE
  388. make install
  389. cp -rf /usr/share/alsa/firmware/* /lib/firmware # workaround !!!
  390. header "Installing OSS..."
  391. cd $ALSASRCDIR/$OSS
  392. make install
  393.  
  394.  
  395. #alsa-utils need to be compiled after lib installation!!#############################################################################
  396. header "Compiling utils..."
  397. cd $ALSASRCDIR/$UTILS
  398. make clean
  399.  
  400. ./configure --prefix=/usr || die "$UTILS configure failed"
  401. make || die "$UTILS make failed"
  402. header "Installing utils..."
  403. make install
  404.  
  405. #copy modules to respective kernel modules directory!! Note: Only the currently booted  kernel will be upgraded.
  406.  
  407. cd ${ALSASRCDIR}/${DRIVER}/
  408. find ./ -name ''*.ko'' > /tmp/alsa_modules
  409.  
  410. header "Copy modules to target directories..."
  411. if [ "`uname -a| grep "2.6.24"`" != "" ] ; then
  412.  tar -cv -T /tmp/alsa_modules -f /lib/modules/`uname -r`/ubuntu/sound/alsa-driver/${DRIVER}.tar
  413.  cd /lib/modules/`uname -r`/ubuntu/sound/alsa-driver
  414.  else
  415.  tar -cv -T /tmp/alsa_modules -f /lib/modules/`uname -r`/kernel/sound/${DRIVER}.tar
  416.  cd /lib/modules/`uname -r`/kernel/sound/
  417. fi
  418. #Extract new modules, overwriting old ones
  419. tar -xvf ${DRIVER}.tar
  420. rm *.tar
  421.  
  422. depmod -a
  423.  
  424. chmod a+rw /dev/dsp /dev/mixer /dev/sequencer /dev/midi /dev/snd/*
  425.  
  426. ####alsa-utils patch for asound.state to avoid patching alsa-utils, see below debian patch - ####
  427. ##http://svn.debian.org/wsvn/pkg-alsa/trunk/alsa-utils/debian/patches/move_asound_state_to_var.patch?op=file&rev=0&sc=0
  428.  
  429. cd /var/lib/alsa
  430. rm asound.state
  431. ln -s /etc/asound.state asound.state
  432.  
  433. }
  434.  
  435. toolsinstall () {
  436.  
  437. test -d $ALSASRCDIR || die "$ALSASRCDIR not found - nothing to install! Run download -d option first"
  438.  
  439. if [ "${TOOLSLIST[*]}" == "" ] ; then
  440.    echo "Please define your tools-list (edit list inside script) first!"
  441.    exit 2
  442. fi
  443.  
  444. cd $ALSASRCDIR/$TOOLS
  445. for i in "${TOOLSLIST[@]}" ; do
  446. cd  $ALSASRCDIR/$TOOLS/$i
  447.  if [ -x ./configure ]; then
  448.  make clean  
  449.  ./configure --prefix=/usr ||  die "$Tools $i configure failed"
  450.   make ||  die "$Tools $i make failed"
  451.  fi
  452. done
  453.  
  454. cd $ALSASRCDIR/$TOOLS
  455. for j in "${TOOLSLIST[@]}" ; do
  456.  cd  $ALSASRCDIR/$TOOLS/$j
  457.   header "Installing tool $j"
  458.   make install
  459.  done
  460. }
  461.  
  462.  
  463.  
  464. usage() {
  465.     echo "
  466.  
  467. Alsa Upgrade Script $REV
  468.  
  469. Usage: $0 [OPTION-one at a time]
  470.  
  471. Available options:
  472.  
  473.    -d     Download the packages. The required dependencies will also be loaded and installed at this stage
  474.    -c     Configuration and Compilation
  475.           Configure and Compile your Alsa packages (all drivers will be compiled by default)
  476.    -i     Installation of Alsa packages
  477.           Installs compiled Alsa packages
  478.    -t     Compiles and installs the alsa-tools (Optional)
  479.           Define (inside script) your tools, download, compile and install Alsa first
  480.    -x     Cleans up the built environment and source code as much as possible to free up space
  481.    -r     Restore ALSA  (I'd recomend to do a quick restore of your backup at this stage!!)
  482.           The Alsa kernel packages incl. modules and all ALSA relevant Ubuntu packages will be reinstalled
  483.           Note: This won't work on custom kernels!!!
  484.    -h     Help - this page
  485.  
  486.    The normal workfĺow is:                   -d > -c > -i > reboot
  487.    The optional driver snapshot workflow is: -d > -s > -c > -i > reboot
  488.    The cleanup:                              -x
  489.    The restore:                              -r > reboot
  490.    The tools:                                 edit list of tools inside the script first > -t
  491.  
  492.    Before running the script I recommend to update/upgrade and reboot your system.
  493.  
  494. DISCLAIMER: Use this script at your own risk. I do not take any responsability for any problems
  495.             caused by running this script. In any case - make a backup first!
  496.  
  497. "
  498.     exit 1;
  499. }
  500.  
  501.  
  502. #--- main ----------------------------------------------------------------------------------
  503.  
  504. case "$1" in
  505.  
  506.   -d)   greet
  507.         package "prepare the environment and download"
  508.         header "Packages will be downloaded"
  509.         prep
  510.         download    
  511.         header "Alsa packages sucessfully downloaded - run compilation -c next"
  512.         ;;
  513.  
  514.   -s)   greet
  515.         package "download the latest driver snapshot of"
  516.         header "The latest Alsa-driver snapshot will be downloaded,compiled and installed"
  517.         downloadsnapshot
  518.         header "Alsa driver snapshot sucessfully downloaded - run compilation -c next"
  519.         ;;
  520.  
  521.   -c)   greet
  522.         package "configure and compile"
  523.         header "Alsa packages(drivers/lib/util/firmware/oss) will be compiled"
  524.         compile
  525.         header "Alsa packages sucessfully compiled - run installation -i next"
  526.         ;;
  527.  
  528.   -i)   greet
  529.         package "install the compiled sources of"
  530.         header "Alsa packages (drivers/lib/util/firmware/oss) will be installed"
  531.         installation
  532.         header "Alsa packages sucessfully installed - reboot your system now"
  533.         ;;
  534.  
  535.   -t)   greet
  536.         package "compile and install the tools of"
  537.         header "Alsa package tools will be compiled and installed"
  538.         toolsinstall
  539.         header "Alsa tools sucessfully installed - no reboot rquired"
  540.         ;;
  541.  
  542.   -x)   greet
  543.         package "to remove the Alsa built-environment to free up space"
  544.         header "Built-environment and source code of dependencies will be removed"
  545.         cleanup
  546.         header "Built-environment and source code sucessfully removed"
  547.         ;;  
  548.  
  549.   -r)   greet
  550.         package "restore to the package state prior to the upgrade to"
  551.         header "Alsa and related packages will be restored from Ubuntu repositories"
  552.         restorealsa
  553.         header "Alsa packages sucessfully restored - reboot your system now"
  554.         ;;
  555.  
  556.   -h)
  557.         usage
  558.         exit 1
  559.         ;;
  560.   *)
  561.         usage
  562.         exit 1
  563.         ;;
  564. esac
  565.  
  566. exit 0
  567.  
  568.  
  569. ##----script End --------------------------------------------------------------------------------------------------------------------
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top