Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Feb 22nd, 2011  |  syntax: None  |  size: 11.82 KB  |  hits: 212  |  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. pkgname=kernel-netbook
  4. true && pkgname=('kernel-netbook' 'kernel-netbook-headers')
  5.  
  6. _basekernel=2.6.37
  7. pkgver=2.6.37.1
  8. pkgrel=1
  9. _kernver="$_basekernel-netbook"
  10. arch=('i686')
  11. license=('GPL2')
  12. url=('http://code.google.com/p/kernel-netbook')
  13.  
  14. ####################################
  15. md5sums=('c8ee37b4fdccdb651e0603d35350b434'
  16.          '39bb8ff13c9a6f7c99b32287c2993cbe'
  17.          'c0074a1622c75916442e26763ddf47d0'
  18.          '1728f86fb9af46a2222a9280a87f6488'
  19.          'ddacb0fd57d053bdfb0ea579cf999720'
  20.          '2c94597844230d6095fde8a4ecf3c132'
  21.          '99e6e0a3e328336192fa3cc7d1e70e01'
  22.          'f23fe16ae73702292969baaa4b798d0f'
  23.          '2bb172117ede96c14289f9f9bc34f58f'
  24.          'aee89fe7f034aea2f2ca95322774c1b5'
  25.          '21ce3f7967d7305064bf7eb60030ffea'
  26.          '2d321460daf2d6ffab28c51664dd164e'
  27.          '2b13a513b7fe267d15a7f6088c8db8d7')
  28. ###################################
  29. #  external drivers  and firmware #
  30. ###################################
  31.  
  32. #Arch patchset
  33. patchname=patch-${pkgver}-${pkgrel}-ARCH
  34. #Broadcom-wl:
  35. broadcom_ver=5.100.82.38
  36. broadcom="hybrid-portsrc_x86_32-v${broadcom_ver//./_}"
  37. #Stk11xx:
  38. stk11xx_ver="2.1.0"
  39. stk11xx="stk11xx-$stk11xx_ver"
  40. #BFS: - http://users.on.net/~ckolivas/kernel/ -
  41. _ckpatchversion=2
  42. _ckpatchname="patch-${_basekernel}-ck${_ckpatchversion}"
  43. #BFQ: - http://algo.ing.unimo.it/people/paolo/disk_sched/ -
  44. _bfpatchversion="1"
  45. _bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/2.6.37"
  46.  
  47. ##### Sources #####
  48. source=( #kernel sources and arch patchset
  49.         "ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${_basekernel}.tar.bz2"
  50.         "ftp://ftp.archlinux.org/other/kernel26/${patchname}.bz2"
  51.         #external drivers:
  52.         "http://www.broadcom.com/docs/linux_sta/${broadcom}.tar.gz"
  53.         #"http://switch.dl.sourceforge.net/sourceforge/syntekdriver/stk11xx-$stk11xx_ver.tar.gz"
  54.         #BFS patch:
  55.         "http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/${_basekernel}/${_basekernel}-ck${_ckpatchversion}/${_ckpatchname}.bz2"
  56.         #"http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/${_basekernel}/${_basekernel}-ck${_ckpatchversion}/${_ckpatchname}.bz2"
  57.         #"http://ck.kolivas.org/patches/bfs/2.6.36/${_basekernel}-ck${_ckpatchversion}-bfs-360.patch" # update to bfs360
  58.         #BFQ patch:
  59.         "${_bfqpath}/0001-bfq_iosched-block-prepare_IO_context_code-v${_bfpatchversion}-${_basekernel}.patch"
  60.         "${_bfqpath}/0002-bfq_iosched-block-add-cgroups-kconfig-and-build-bits-for-BFQ-v${_bfpatchversion}-${_basekernel}.patch"
  61.         "${_bfqpath}/0003-bfq_iosched-block-introduce_BFQ-v${_bfpatchversion}-${_basekernel}.patch"
  62.         #Others:
  63.         "config"
  64.         "license.patch"
  65.         "semaphore.patch"
  66.         "mutex-sema.patch"
  67.         "kernel-netbook.preset"
  68.         "http://aur.archlinux.org/packages/kernel26-ck/kernel26-ck/ck2_2.6.37.1.patch" # fix for BFS 2.6.37-ck2)
  69.        
  70. build() {
  71.   ### koeleck's patch for 2.6.37-ck2 http://aur.pastebin.com/ajz5yyUC
  72.   cd $srcdir
  73.   patch -Np1 -i ${srcdir}/ck2_2.6.37.1.patch
  74.  
  75.   cd ${srcdir}/linux-$_basekernel
  76.  
  77.   # patching the kernel with:
  78.   # --> arch patchset
  79.   msg "Patching source with Arch Official Patchset:"
  80.   patch -Np1 -i ${srcdir}/$patchname
  81.  
  82.   # --> BFS
  83.   msg "Patching source with BFS patch:"
  84.   #Adjust localversion
  85.   sed -i -e "s/-ck${_ckpatchversion}//g" ${srcdir}/${_ckpatchname}
  86.   #sed -i -e "s/-ck${_ckpatchversion}//g" ${srcdir}/${_basekernel}-ck${_ckpatchversion}-bfs-360.patch
  87.   #patching time
  88.   patch -Np1 -i ${srcdir}/${_ckpatchname}
  89.   #msg "Updating bfs357 to bfs360"
  90.   #patch -Np1 -i ${srcdir}/2.6.36-ck2-bfs-360.patch
  91.  
  92.   # --> BFQ
  93.   msg "Patching source with BFQ patches"
  94.   for i in $(ls ${srcdir}/*-bfq_*); do
  95.     patch -Np1 -i $i
  96.   done
  97.  
  98.   # copy config
  99.   cp ../config ./.config
  100.  
  101.   make prepare
  102.  
  103.   # make defconfig
  104.   # configure kernel    
  105.   # use menuconfig, if you want to change the configuration
  106.   make menuconfig
  107.   # make gconfig
  108.   # yes "" | make config
  109.   # build kernel
  110.   msg "Now starts something magic:"
  111.   make
  112. }
  113.  
  114. package_kernel-netbook() {
  115.   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 - Give more power to your netbook!"
  116.   depends=('coreutils' 'module-init-tools')
  117.   provides=('stk11xx' 'stk11xx-svn')
  118.   install=kernel-netbook.install
  119.   optdepends=('crda: for wireless regulatory domain support' 'linux-firmware: firmware for rt2860 and tigon3')
  120.   groups=(eee)
  121.  
  122.   cd ${srcdir}/linux-$_basekernel
  123.   # install our modules
  124.   mkdir -p $pkgdir/{lib/modules,boot}
  125.   make INSTALL_MOD_PATH=$pkgdir modules_install
  126.  
  127.   # remove the junk symlinks
  128.   rm -r $pkgdir/lib/modules/$_kernver/{source,build}
  129.  
  130.   # remove the firmware directory
  131.   rm -rf ${pkgdir}/lib/firmware
  132.  
  133.   # install the kernel
  134.   install -D -m644 ${srcdir}/linux-$_basekernel/System.map $pkgdir/boot/System.map-netbook
  135.   install -D -m644 ${srcdir}/linux-$_basekernel/arch/x86/boot/bzImage ${pkgdir}/boot/vmlinuz-netbook
  136.   install -D -m644 ${srcdir}/linux-$_basekernel/.config $pkgdir/boot/kconfig-netbook
  137.  
  138.   # install preset file for mkinitcpio
  139.   sed -i -e "s/ALL_kver=.*/ALL_kver=\'${_kernver}\'/g" $startdir/$pkgname.preset
  140.   install -m644 -D ${srcdir}/kernel-netbook.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
  141.  
  142.   # set correct depmod command for install
  143.   sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" $startdir/$pkgname.install
  144.  
  145. ##Section: Broadcom-wl
  146.   msg "Compiling broadcom-wl module:"
  147.   cd ${srcdir}/
  148.   #patching broadcom as broadcom-wl package on AUR
  149.   patch -p1 < license.patch
  150.   patch -p1 < semaphore.patch
  151.   patch -p1 < mutex-sema.patch
  152.   #KBUILD_NOPEDANTIC=1 make -C ${srcdir}/linux-$_basekernel M=`pwd`
  153.   make -C ${srcdir}/linux-$_basekernel M=`pwd`
  154.   install -D -m 755 wl.ko ${pkgdir}/lib/modules/$_kernver/kernel/drivers/net/wireless/wl.ko
  155.  
  156. ##Section: stk11xx
  157.   #msg "Compiling stk11xx module:"
  158.   #cd $srcdir/stk11xx-$stk11xx_ver
  159.   #make -C $srcdir/linux-${_basekernel}/ SUBDIRS=$srcdir/stk11xx-2.1.0 modules
  160.   #install -D -m 644 $srcdir/stk11xx-$stk11xx_ver/stk11xx.ko $pkgdir/lib/modules/$_kernver/kernel/drivers/media/video
  161.   #install -D -m 644 $srcdir/stk11xx-$stk11xx_ver/README $pkgdir/usr/share/stk11xx.readme
  162. }
  163.  
  164. package_kernel-netbook-headers() {
  165.   KARCH=x86
  166.   pkgdesc="Header files and scripts for building modules for kernel-netbook"
  167.   mkdir -p ${pkgdir}/lib/modules/${_kernver}
  168.   cd ${pkgdir}/lib/modules/${_kernver}
  169.   ln -sf ../../../usr/src/linux-${_kernver} build
  170.   cd ${srcdir}/linux-$_basekernel
  171.   install -D -m644 Makefile \
  172.     ${pkgdir}/usr/src/linux-${_kernver}/Makefile
  173.   install -D -m644 kernel/Makefile \
  174.     ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
  175.   install -D -m644 .config \
  176.     ${pkgdir}/usr/src/linux-${_kernver}/.config
  177.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
  178.  
  179.   for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
  180.     cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
  181.   done
  182.  
  183.   # copy arch includes for external modules
  184.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
  185.   cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
  186.  
  187.   # copy files necessary for later builds, like nvidia and vmware
  188.   cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
  189.   cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
  190.   # fix permissions on scripts dir
  191.   chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
  192.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
  193.  
  194.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
  195.  
  196.   cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  197.   cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  198.   cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
  199.  
  200.   # add headers for lirc package
  201.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
  202.   cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
  203.   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo; do
  204.    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  205.    cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  206.   done
  207.   # add docbook makefile
  208.   install -D -m644 Documentation/DocBook/Makefile \
  209.     ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
  210.   # add dm headers
  211.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  212.   cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  213.   # add inotify.h
  214.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
  215.   cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
  216.   # add wireless headers
  217.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  218.   cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  219.   # add dvb headers for external modules
  220.   # in reference to:
  221.   # http://bugs.archlinux.org/task/9912
  222.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
  223.   cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
  224.   # add dvb headers for external modules
  225.   # in reference to:
  226.   # http://bugs.archlinux.org/task/11194
  227.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
  228.   cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
  229.   # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  230.   # in reference to:
  231.   # http://bugs.archlinux.org/task/13146
  232.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  233.   cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  234.   cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  235.   # add dvb headers  
  236.   # in reference to:
  237.   # http://bugs.archlinux.org/task/20402
  238.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb
  239.   cp drivers/media/dvb/dvb-usb/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/
  240.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
  241.   cp drivers/media/dvb/frontends/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  242.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners
  243.   cp drivers/media/common/tuners/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/
  244.   # add xfs and shmem for aufs building
  245.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
  246.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
  247.   cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
  248.   # add headers vor virtualbox
  249.   # in reference to:
  250.   # http://bugs.archlinux.org/task/14568
  251.   cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
  252.   # add headers for broadcom wl
  253.   # in reference to:
  254.   # http://bugs.archlinux.org/task/14568
  255.   cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
  256.   # copy in Kconfig files
  257.   for i in `find . -name "Kconfig*"`; do
  258.     mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
  259.     cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
  260.   done
  261.  
  262.   chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
  263.   find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
  264.   # remove unneeded architectures
  265.   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}
  266. }
  267.  
  268. # Global pkgdesc and depends are here so that they will be picked up by AUR
  269. 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 - Give more power to your netbook!"
  270. depends=('coreutils' 'module-init-tools')