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

kernel-netbook PKGBUILD

By: a guest on May 27th, 2010  |  syntax: Bash  |  size: 7.56 KB  |  views: 181  |  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: Dieghen89 <dieghen89@gmail.com>
  2.  
  3. pkgbase=kernel-netbook
  4. pkgname=('kernel-netbook' 'kernel-netbook-headers')
  5. _basekernel=2.6.34
  6. pkgver=2.6.34
  7. pkgrel=2
  8. _kernver="$_basekernel-netbook"
  9. arch=('i686')
  10. license=('GPL2')
  11. url=('http://code.google.com/p/kernel-netbook')
  12. patchname=patch-${pkgver}-1-ARCH
  13.  
  14. md5sums=('10eebcb0178fb4540e2165bfd7efc7ad'
  15.          '84c3297451b709a0ed97b40b2fca6fc5'
  16.          '0466d863405e1ab99d5e288fe886e852'
  17.          '654a8f089e4cef3eac9d343b112fa7e3'
  18.          '28c0444733547d60aff8e9068c9b13d3')
  19.  
  20. #bfs_patch=$_basekernel-sched-bfs-313
  21.  
  22. ######################
  23. #  external drivers  #
  24. ######################
  25.  
  26. #Broadcom-wl:
  27. broadcom_ver=5.60.48.36
  28. broadcom=hybrid-portsrc-x86_32-v${broadcom_ver}
  29. #stk11xx:
  30. stk11xx_ver=2.1.0
  31. stk11xx=stk11xx-$stk11xx_ver
  32.  
  33. ##### Sources #####
  34. source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${_basekernel}.tar.bz2
  35.         ftp://ftp.archlinux.org/other/kernel26/${patchname}.bz2
  36.         http://www.broadcom.com/docs/linux_sta/${broadcom}.tar.gz
  37.         http://switch.dl.sourceforge.net/sourceforge/syntekdriver/stk11xx-$stk11xx_ver.tar.gz
  38.         config)
  39.         #wl_linux.patch)
  40.         #http://ck.kolivas.org/patches/bfs/$bfs_patch.patch)
  41.  
  42. build() {
  43. #Section: Kernel
  44.   cd ${srcdir}/linux-$_basekernel
  45.   #patching the kernel with bfs scheduler
  46.   #patch -Np1 < ${srcdir}/$bfs_patch.patch
  47.   #patching the kernel with arch patchset
  48.   patch -Np1 -i ${srcdir}/$patchname
  49.  
  50.   # copy config
  51.   cp ../config ./.config
  52.  
  53.   make prepare
  54.  
  55.   # make defconfig
  56.   # configure kernel    
  57.   # use menuconfig, if you want to change the configuration
  58.   make menuconfig
  59.   # make gconfig
  60.   # yes "" | make config
  61.  
  62.   # build kernel
  63.   make || return 1
  64. }
  65.  
  66. package_kernel-netbook() {
  67.   pkgdesc="Static kernel with KMS for netbooks with Intel Atom N270/N280/N450 such as eeepc with the add-on of external firmware (broadcom-wl, stk11xx) - Old kernel26-901 - Only Intel graphic card"
  68.   depends=('coreutils' 'module-init-tools')
  69.   install=kernel-netbook.install
  70.   optdepends=('crda: for wireless regulatory domain support')
  71.   groups=(eee)
  72.  
  73.   cd ${srcdir}/linux-$_basekernel
  74.   # install our modules
  75.   mkdir -p $pkgdir/{lib/modules,boot}
  76.   make INSTALL_MOD_PATH=$pkgdir modules_install || return 1
  77.  
  78.   # remove the junk symlinks
  79.   rm -r $pkgdir/lib/modules/$_kernver/{source,build}
  80.  
  81.   # install the kernel
  82.   install -D -m644 ${srcdir}/linux-$_basekernel/System.map $pkgdir/boot/System.map-netbook
  83.   install -D -m644 ${srcdir}/linux-$_basekernel/arch/x86/boot/bzImage ${pkgdir}/boot/vmlinuz-netbook
  84.   install -D -m644 ${srcdir}/linux-$_basekernel/.config $pkgdir/boot/kconfig-netbook
  85.  
  86.   # set correct depmod command for install
  87.   sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" $startdir/$pkgname.install
  88.  
  89. #Section: Broadcom-wl
  90.   cd ${srcdir}/
  91.   sed -i '190i\MODULE_LICENSE("Mixed/Proprietary"); \n' ${srcdir}/src/wl/sys/wl_linux.c
  92.   #sed -i 's|#include <linux/autoconf.h>|#include <generated/autoconf.h>|' ${srcdir}/src/include/linuxver.h
  93.   #patch ${srcdir}/src/wl/sys/wl_linux.c wl_linux.patch || return 1
  94.   #patch -i ${srcdir}/wl_linux.patch ${srcdir}/src/include/linuxver.h
  95.  
  96.   sed -i '/linux\/autoconf.h/d' "$srcdir/src/include/linuxver.h"
  97.  
  98.   KBUILD_NOPEDANTIC=1 make -C ${srcdir}/linux-$_basekernel M=`pwd` || return 1
  99.   install -D -m 755 wl.ko ${pkgdir}/lib/modules/$_kernver/kernel/drivers/net/wireless/wl.ko || return 1
  100.  
  101. #Section: stk11xx
  102.   cd $srcdir/stk11xx-$stk11xx_ver || return 1
  103.   make -C $srcdir/linux-${_basekernel}/ SUBDIRS=$srcdir/stk11xx-2.1.0 modules || return 1
  104.   install -D -m 644 $srcdir/stk11xx-$stk11xx_ver/stk11xx.ko $pkgdir/lib/modules/$_kernver/kernel/drivers/media/video
  105.   install -D -m 644 $srcdir/stk11xx-$stk11xx_ver/README $pkgdir/usr/share/stk11xx.readme
  106. }
  107.  
  108. package_kernel-netbook-headers() {
  109.   KARCH=x86
  110.   pkgdesc="Header files and scripts for building modules for kernel-netbook"
  111.   cd ${srcdir}/linux-$_basekernel
  112.   mkdir -p ${pkgdir}/lib/modules/${_kernver}
  113.   cd ${pkgdir}/lib/modules/${_kernver}
  114.   ln -sf ../../../usr/src/linux-${_kernver} build
  115.   cd ${srcdir}/linux-$_basekernel
  116.   install -D -m644 Makefile \
  117.     ${pkgdir}/usr/src/linux-${_kernver}/Makefile
  118.   install -D -m644 kernel/Makefile \
  119.     ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
  120.   install -D -m644 .config \
  121.     ${pkgdir}/usr/src/linux-${_kernver}/.config
  122.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
  123.  
  124.   for i in acpi asm-generic config linux math-emu media net pcmcia scsi sound trace video; do
  125.     cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
  126.   done
  127.  
  128.   # copy arch includes for external modules
  129.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
  130.   cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
  131.  
  132.   # copy files necessary for later builds, like nvidia and vmware
  133.   cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
  134.   cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
  135.   # fix permissions on scripts dir
  136.   chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
  137.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
  138.  
  139.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
  140.  
  141.   cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  142.   cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  143.   # add headers for lirc package
  144.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
  145.   cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
  146.   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
  147.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  148.   cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  149.   done
  150.   # add docbook makefile
  151.   install -D -m644 Documentation/DocBook/Makefile \
  152.     ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
  153.   # add dm headers
  154.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  155.   cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  156.   # add inotify.h
  157.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
  158.   cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
  159.   # add wireless headers
  160.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  161.   cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  162.   # add xfs and shmem for aufs building
  163.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
  164.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
  165.   cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
  166.   # add headers vor virtualbox
  167.   # in reference to:
  168.   # http://bugs.archlinux.org/task/14568
  169.   cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
  170.   # add headers for broadcom wl
  171.   # in reference to:
  172.   # http://bugs.archlinux.org/task/14568
  173.   cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
  174.   # copy in Kconfig files
  175.   for i in `find . -name "Kconfig*"`; do
  176.     mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
  177.     cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
  178.   done
  179.  
  180.   # add header for aufs2-util
  181.   cp -a ${srcdir}/linux-$_basekernel/include/asm-generic/bitsperlong.h ${pkgdir}/usr/src/linux-${_kernver}/include/asm/
  182.  
  183.   chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
  184.   find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
  185.   # remove unneeded architectures
  186.   rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
  187. }
clone this paste RAW Paste Data