Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

nvidia-beta-all-extramodules

By: sausageandeggs on Dec 14th, 2011  |  syntax: Bash  |  size: 3.82 KB  |  views: 59  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer : Ng Oon-Ee <ngoonee.talk@gmail.com>
  2. # Based on nvidia-beta by Dan Vratil <vratil@progdansoft.com>
  3.  
  4. pkgname=nvidia-beta-all
  5. pkgver=290.10
  6. pkgrel=5
  7. pkgdesc="NVIDIA beta drivers for linux."
  8. arch=('i686' 'x86_64')
  9. [ "$CARCH" = x86_64 ] && ARCH=x86_64 &&_srcname=NVIDIA-Linux-x86_64-${pkgver}-no-compat32 && md5sums=('cebfba9a7e91716a06c66bb5b38d9661')
  10. [ "$CARCH" = "i686" ] && ARCH=x86 && _srcname=NVIDIA-Linux-x86-${pkgver} && md5sums=('50319a4b3818c12c9c7243525e0e6316')
  11. provides=("nvidia=${pkgver}")
  12. url="http://www.nvidia.com/"
  13. depends=("nvidia-utils-beta=${pkgver}")
  14. makedepends=('linux-headers')
  15. conflicts=('nvidia-96xx' 'nvidia-71xx' 'nvidia-legacy' 'nvidia')
  16. license=('custom')
  17. install=nvidia.install
  18. source=("http://us.download.nvidia.com/XFree86/Linux-$ARCH/${pkgver}/${_srcname}.run"
  19.         '2.6.33-rt-ice-nvidia-beta.patch')
  20.  
  21. ### Enable using of version numbers from pacman. This should only be used if you have kernels with
  22. ### long version numbers (for example if compiled with git-suffixes). This will not work with kernels
  23. ### compiled outside pacman's management, and takes much longer than the canonical method, due to
  24. ### needing to search the local repository. Set to '1' to enable.
  25. USE_PACMAN_VERSION=0
  26.  
  27. md5sums=(${md5sums[@]}
  28.          'bedb3e2022c9d1780b2a859e4ac21619')
  29.  
  30. build()
  31. {
  32.         # Extract the nvidia drivers
  33.         cd "${srcdir}"
  34.         if [ -d ${_srcname} ]; then
  35.                 rm -rf ${_srcname}
  36.         fi
  37.         sh ${_srcname}.run --extract-only
  38.         cd ${_srcname}/kernel
  39.  
  40.   if [ "$USE_PACMAN_VERSION" = "0" ]; then
  41.     _KERNELS=`file /boot/* | grep 'Linux kernel.*boot executable' | sed 's/.*version \([^ ]\+\).*/\1/'`
  42.   else
  43.     _PACKAGES=`pacman -Qsq linux`
  44.     _KERNELS=`pacman -Ql $PACKAGES | grep /modules.alias.bin | sed 's/.*\/lib\/modules\/\(.*\)\/modules.alias.bin/\1/g'`
  45.   fi
  46.  
  47.   # Loop through all detected kernels
  48.   for _kernver in $_KERNELS;
  49.   do  
  50.     cd ${srcdir}/${_srcname}
  51.     cp -R kernel kernel-${_kernver}
  52.     cd kernel-${_kernver}
  53.     echo Building module for $_kernver
  54.  
  55.     # If this kernel has a specific patch for nvidia-beta, apply it
  56.     # Patches should be named as the example, replacing the correct kernver
  57.     if [[ -f $startdir/$_kernver-nvidia-beta.patch ]]; then
  58.       echo Found patch for nvidia-beta for kernel $_kernver
  59.       patch -p1 < $startdir/$_kernver-nvidia-beta.patch
  60.     fi
  61.  
  62.     make SYSSRC=/usr/src/linux-${_kernver} module  
  63.   done
  64.  
  65.   # Modify .INSTALL (nvidia.install) file if needed
  66.   if [ "$USE_PACMAN_VERSION" = "0" ]; then
  67.     sed 's/USE_PACMAN_VERSION=1/USE_PACMAN_VERSION=0/g' $startdir/nvidia.install > $startdir/nvidia.installtemp
  68.     mv $startdir/nvidia.installtemp $startdir/nvidia.install
  69.   else
  70.     sed 's/USE_PACMAN_VERSION=0/USE_PACMAN_VERSION=1/g' $startdir/nvidia.install > $startdir/nvidia.installtemp
  71.     mv $startdir/nvidia.installtemp $startdir/nvidia.install
  72.   fi
  73. }
  74.  
  75. package() {
  76.   if [ "$USE_PACMAN_VERSION" = "0" ]; then
  77.     _KERNELS=`file /boot/* | grep 'Linux kernel.*boot executable' | sed 's/.*version \([^ ]\+\).*/\1/'`
  78.   else
  79.     _PACKAGES=`pacman -Qsq linux`
  80.     _KERNELS=`pacman -Ql $PACKAGES | grep /modules.alias.bin | sed 's/.*\/lib\/modules\/\(.*\)\/modules.alias.bin/\1/g'`
  81.   fi
  82.  
  83.   # Loop through all detected kernels
  84.   for _kernver in $_KERNELS;
  85.   do  
  86.     cd "${srcdir}/${_srcname}/kernel-${_kernver}"
  87.     # Install kernel module
  88.     mkdir -p "${pkgdir}/lib/modules/extramodules-${_kernver:0:3}${_kernver##[0-9]*-[^a-z]}/"
  89.     install -m644 nvidia.ko "${pkgdir}/lib/modules/extramodules-${_kernver:0:3}${_kernver##[0-9]*-[^a-z]}/"
  90.        gzip "${pkgdir}/lib/modules/${_kernver}/kernel/drivers/video/nvidia.ko"                      
  91.   done
  92.         # Blacklist nouveau since 2.6.34
  93.         mkdir -p "${pkgdir}/etc/modprobe.d/"
  94.         echo "blacklist nouveau" >> "${pkgdir}/etc/modprobe.d/nouveau_blacklist.conf"
  95.                      
  96. }
  97.  
  98.  
  99.  
clone this paste RAW Paste Data