Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 29th, 2010  |  syntax: Bash  |  size: 7.36 KB  |  views: 52  |  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. #Change to =y if you want get a splitted package
  4. SPLITTED=n
  5. ############
  6.  
  7. if [ $SPLITTED = "y" ] ; then
  8.   pkgbase=kernel-netbook
  9.   pkgname=('kernel-netbook' 'kernel-netbook-headers')
  10. else
  11.   pkgname="kernel-netbook"
  12. fi
  13.  
  14. _basekernel=2.6.36
  15. pkgver=2.6.36
  16. pkgrel=1
  17. _kernver="$_basekernel-netbook"
  18. arch=('i686')
  19. license=('GPL2')
  20. url=('http://code.google.com/p/kernel-netbook')
  21. patchname=patch-${pkgver}-1-ARCH
  22.  
  23. ####################################
  24. md5sums=('61f3739a73afb6914cb007f37fb09b62'
  25.          '3edd4050094e2d3b278de90700aae98e'
  26.          '654a8f089e4cef3eac9d343b112fa7e3'
  27.          '67a46f7f203eaa52101145371975b24a')
  28. ###################################
  29. #  external drivers  and firmware #
  30. ###################################
  31.  
  32. #Stk11xx:
  33. stk11xx_ver=2.1.0
  34. stk11xx=stk11xx-$stk11xx_ver
  35.  
  36. ##### Sources #####
  37. source=("ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${_basekernel}.tar.bz2"
  38.         "ftp://ftp.archlinux.org/other/kernel26/${patchname}.bz2"
  39.         "http://switch.dl.sourceforge.net/sourceforge/syntekdriver/stk11xx-$stk11xx_ver.tar.gz"
  40.         "config")
  41.        
  42. build() {
  43.   cd ${srcdir}/linux-$_basekernel
  44.  
  45.   #patching the kernel with arch patchset
  46.   patch -Np1 -i ${srcdir}/$patchname
  47.  
  48.   # copy config
  49.   cp ../config ./.config
  50.  
  51.   make prepare
  52.  
  53.   # make defconfig
  54.   # configure kernel    
  55.   # use menuconfig, if you want to change the configuration
  56.   make menuconfig
  57.   # make gconfig
  58.   # yes "" | make config
  59.  
  60.   # build kernel
  61.   make
  62. }
  63.  
  64. package_kernel-netbook() {
  65.   pkgdesc="Static kernel with KMS for netbooks with Intel Atom N270/N280/N450 such as eeepc with the add-on of external firmware (stk11xx) - Old kernel26-901 - Only Intel graphic card - Give more power to your netbook!"
  66.   depends=('coreutils' 'module-init-tools')
  67.   provides=('stk11xx' 'stk11xx-svn')
  68.   install=kernel-netbook.install
  69.   optdepends=('crda: for wireless regulatory domain support' 'linux-firmware: firmware for rt2860')
  70.   groups=(eee)
  71.  
  72.   cd ${srcdir}/linux-$_basekernel
  73.   # install our modules
  74.   mkdir -p $pkgdir/{lib/modules,boot}
  75.   make INSTALL_MOD_PATH=$pkgdir modules_install
  76.  
  77.   # remove the junk symlinks
  78.   rm -r $pkgdir/lib/modules/$_kernver/{source,build}
  79.  
  80.   # install the kernel
  81.   install -D -m644 ${srcdir}/linux-$_basekernel/System.map $pkgdir/boot/System.map-netbook
  82.   install -D -m644 ${srcdir}/linux-$_basekernel/arch/x86/boot/bzImage ${pkgdir}/boot/vmlinuz-netbook
  83.   install -D -m644 ${srcdir}/linux-$_basekernel/.config $pkgdir/boot/kconfig-netbook
  84.  
  85.   # set correct depmod command for install
  86.   sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" $startdir/$pkgname.install
  87.  
  88. ##Section: stk11xx
  89.   cd $srcdir/stk11xx-$stk11xx_ver
  90.   make -C $srcdir/linux-${_basekernel}/ SUBDIRS=$srcdir/stk11xx-2.1.0 modules
  91.   install -D -m 644 $srcdir/stk11xx-$stk11xx_ver/stk11xx.ko $pkgdir/lib/modules/$_kernver/kernel/drivers/media/video
  92.   install -D -m 644 $srcdir/stk11xx-$stk11xx_ver/README $pkgdir/usr/share/stk11xx.readme
  93. }
  94.  
  95. package_kernel-netbook-headers() {
  96.   KARCH=x86
  97.   if [ $SPLITTED = "y" ] ; then
  98.     pkgdesc="Header files and scripts for building modules for kernel-netbook"
  99.   fi
  100.   cd ${srcdir}/linux-$_basekernel
  101.   mkdir -p ${pkgdir}/lib/modules/${_kernver}
  102.   cd ${pkgdir}/lib/modules/${_kernver}
  103.   ln -sf ../../../usr/src/linux-${_kernver} build
  104.   cd ${srcdir}/linux-$_basekernel
  105.   install -D -m644 Makefile \
  106.     ${pkgdir}/usr/src/linux-${_kernver}/Makefile
  107.   install -D -m644 kernel/Makefile \
  108.     ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
  109.   install -D -m644 .config \
  110.     ${pkgdir}/usr/src/linux-${_kernver}/.config
  111.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
  112.  
  113.   for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
  114.     cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
  115.   done
  116.  
  117.   # copy arch includes for external modules
  118.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
  119.   cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
  120.  
  121.   # copy files necessary for later builds, like nvidia and vmware
  122.   cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
  123.   cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
  124.   # fix permissions on scripts dir
  125.   chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
  126.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
  127.  
  128.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
  129.  
  130.   cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  131.   cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  132.   # add headers for lirc package
  133.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
  134.   cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
  135.   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo ; do
  136.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  137.   cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  138.   done
  139.  
  140.   # add docbook makefile
  141.   install -D -m644 Documentation/DocBook/Makefile \
  142.     ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
  143.   # add dm headers
  144.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  145.   cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  146.   # add inotify.h
  147.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
  148.   cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
  149.   # add wireless headers
  150.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  151.   cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  152.  
  153.   # add dvb headers for external modules
  154.   mkdir -p $pkgdir/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
  155.   cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
  156.   mkdir -p $pkgdir/usr/src/linux-${_kernver}/include/config/dvb
  157.   cp include/config/dvb/*.h $pkgdir/usr/src/linux-${_kernver}/include/config/dvb
  158.   mkdir -p $pkgdir/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  159.   cp drivers/media/dvb/frontends/lgdt330x.h $pkgdir/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  160.   cp drivers/media/video/msp3400-driver.h $pkgdir/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
  161.  
  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.   chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
  181.   find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
  182.   # remove unneeded architectures
  183.   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}
  184. }
clone this paste RAW Paste Data