Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

2.6.33.9_rt31

By: a guest on Apr 11th, 2011  |  syntax: Bash  |  size: 9.35 KB  |  hits: 79  |  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: Ray Rashif <schiv@archlinux.org>
  2. # Contributor: timbosa <tinny_tim@dodo.com.au>
  3. # Contributor: Tobias Powalowski <tpowa@archlinux.org>
  4. # Contributor: Thomas Baechler <thomas@archlinux.org>
  5.  
  6. pkgname=kernel26rt
  7. _kernelname=${pkgname#kernel26}
  8. _basekernel=2.6.33
  9. _realkernel=2.6.33 # for rc builds, else same as _basekernel
  10. _kernelpatch=.9 # leave blank if no upstream patch
  11. _rtpatch=-rt31
  12. pkgver=2.6.33.9_rt31
  13. pkgrel=1
  14.  
  15. # If sources are rc, old rc, old rt, rc & old rt, old rc & old rt:
  16. # rc, rc-old, rt-old, rc-rt-old, all-old or blank for default
  17. _source=
  18.  
  19. # -- nothing to change below this line -- #
  20.  
  21. pkgdesc="The Linux Kernel and modules - with realtime preemption"
  22. arch=('i686' 'x86_64')
  23. license=('GPL2')
  24. url="http://rt.wiki.kernel.org"
  25. backup=(etc/mkinitcpio.d/$pkgname.preset)
  26. depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio')
  27. optdepends=('crda: to set the correct wireless channels of your country')
  28. provides=('kernel26rt-headers')
  29. install=$pkgname.install
  30. changelog=$pkgname.changelog
  31.  
  32. [ "$_source" = "rc" ] && _rc=testing/
  33. [ "$_source" = "rc-old" ] && _rc=testing/v$_realkernel/
  34. [ "$_source" = "rt-old" ] && _rt=older/
  35. [ "$_source" = "rc-rt-old" ] && _rc=testing/ && _rt=older/
  36. [ "$_source" = "all-old" ] && _rc=testing/v$_realkernel/ && _rt=older/
  37. #[ -n "$_kernelpatch" ] && _kernpatchurl="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/${_rc}patch-$_realkernel$_kernelpatch.bz2"
  38. [ -n "$_kernelpatch" ] && _kernpatchurl="http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v$_basekernel/${_rc}patch-$_realkernel$_kernelpatch.bz2"
  39.  
  40. options=(!strip)
  41. source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_realkernel.tar.bz2
  42.         $_kernpatchurl
  43.         ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/${_rt}patch-$_realkernel$_kernelpatch$_rtpatch.bz2
  44.         config
  45.         config.x86_64
  46.         $pkgname.preset
  47.         logo_linux_clut224.ppm
  48.         aufs2-base.patch
  49.         aufs2-standalone.patch)
  50.  
  51. build() {
  52.   cd "$srcdir/linux-$_realkernel"
  53.  
  54.   # Add upstream patch
  55.   if [ -n "$_kernelpatch" ]; then
  56.     patch -Np1 -i ../patch-$_realkernel$_kernelpatch
  57.   fi
  58.  
  59.   # Add support for AUFS2
  60.   patch -Np1 -i ../aufs2-base.patch
  61.   patch -Np1 -i ../aufs2-standalone.patch
  62.  
  63.   # Add realtime patch
  64.   patch -Np1 -i ../patch-$_realkernel$_kernelpatch$_rtpatch
  65.  
  66.   # Add our custom logo
  67.   cp ../logo_linux_clut224.ppm drivers/video/logo/
  68.  
  69.   # Set up configuration
  70.   if [ "$CARCH" = "x86_64" ]; then
  71.     cat ../config.x86_64 > ./.config
  72.   else
  73.     cat ../config > ./.config
  74.   fi
  75.  
  76.   if [ -f "$startdir/config.save" ]; then
  77.     msg "Using previously autosaved config"
  78.     cat "$startdir/config.save" > ./.config
  79.   fi
  80.  
  81.   sed -i "s|EXTRAVERSION =.*|EXTRAVERSION =|g" Makefile
  82.   sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-$_kernelname\"|g" ./.config
  83.  
  84.   # load configuration
  85.   _kernver=$_basekernel-$_kernelname
  86.   yes "" | make config
  87.   make menuconfig && cat ./.config > "$startdir/config.save"
  88.   #make xconfig
  89.   #make gconfig
  90.   #make oldconfig
  91.  
  92.   # build!
  93.   make bzImage modules
  94. }
  95.  
  96. package() {
  97.   cd "$srcdir/linux-$_realkernel"
  98.  
  99.   KARCH=x86
  100.   _kernver=$_basekernel-$_kernelname
  101.  
  102.   mkdir -p "$pkgdir"/{lib/modules,boot}
  103.   make INSTALL_MOD_PATH="$pkgdir" modules_install
  104.   cp System.map "$pkgdir/boot/System.map26$_kernelname"
  105.   cp arch/$KARCH/boot/bzImage "$pkgdir/boot/vmlinuz26$_kernelname"
  106.  
  107.   # add vmlinux
  108.   install -m644 -D vmlinux "$pkgdir/usr/src/linux-$_kernver/vmlinux"
  109.  
  110.   # install fallback mkinitcpio.conf file and preset file for kernel
  111.   install -m644 -D "$srcdir/$pkgname.preset" "$pkgdir/etc/mkinitcpio.d/$pkgname.preset"
  112.  
  113.   # set correct depmod command for install
  114.   sed \
  115.     -e  "s/KERNEL_NAME=.*/KERNEL_NAME=$_kernelname/g" \
  116.     -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=$_kernver/g" \
  117.     -i "$startdir/$install"
  118.   sed \
  119.     -e "s|source .*|source /etc/mkinitcpio.d/kernel26$_kernelname.kver|g" \
  120.     -e "s|default_image=.*|default_image=\"/boot/$pkgname.img\"|g" \
  121.     -e "s|fallback_image=.*|fallback_image=\"/boot/$pkgname-fallback.img\"|g" \
  122.     -i "$pkgdir/etc/mkinitcpio.d/$pkgname.preset"
  123.  
  124.   echo -e "# DO NOT EDIT THIS FILE\nALL_kver='$_kernver'" > "$pkgdir/etc/mkinitcpio.d/$pkgname.kver"
  125.  
  126.   # remove build and source links
  127.   rm -f "$pkgdir"/lib/modules/$_kernver/{source,build}
  128.  
  129.   # remove the firmware
  130.   rm -rf "$pkgdir/lib/firmware"
  131.  
  132.   # -- package the headers --#
  133.  
  134.   mkdir -p "$pkgdir/lib/modules/$_kernver"
  135.   cd "$pkgdir/lib/modules/$_kernver"
  136.   ln -sf ../../../usr/src/linux-$_kernver build
  137.   cd "$srcdir/linux-$_realkernel"
  138.   install -D -m644 Makefile \
  139.     "$pkgdir/usr/src/linux-$_kernver/Makefile"
  140.   install -D -m644 kernel/Makefile \
  141.     "$pkgdir/usr/src/linux-$_kernver/kernel/Makefile"
  142.   install -D -m644 .config \
  143.     "$pkgdir/usr/src/linux-$_kernver/.config"
  144.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/include"
  145.  
  146.   for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
  147.     cp -a include/$i "$pkgdir/usr/src/linux-$_kernver/include/"
  148.   done
  149.  
  150.   # copy arch includes for external modules
  151.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/x86"
  152.   cp -a arch/x86/include "$pkgdir/usr/src/linux-$_kernver/arch/x86/"
  153.  
  154.   # copy files necessary for later builds, like nvidia and vmware
  155.   cp Module.symvers "$pkgdir/usr/src/linux-$_kernver"
  156.   cp -a scripts "$pkgdir/usr/src/linux-$_kernver"
  157.  
  158.   # fix permissions on scripts dir
  159.   chmod og-w -R "$pkgdir/usr/src/linux-$_kernver/scripts"
  160.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/.tmp_versions"
  161.  
  162.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/kernel"
  163.  
  164.   cp arch/$KARCH/Makefile "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/"
  165.  
  166.   if [ "$CARCH" = "i686" ]; then
  167.     cp arch/$KARCH/Makefile_32.cpu "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/"
  168.   fi
  169.  
  170.   cp arch/$KARCH/kernel/asm-offsets.s "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/kernel/"
  171.  
  172.   # add headers for lirc package
  173.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/video"
  174.   cp drivers/media/video/*.h  "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/"
  175.  
  176.   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
  177.     mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/$i"
  178.     cp -a drivers/media/video/$i/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/$i"
  179.   done
  180.  
  181.   # add docbook makefile
  182.   install -D -m644 Documentation/DocBook/Makefile \
  183.     "$pkgdir/usr/src/linux-$_kernver/Documentation/DocBook/Makefile"
  184.  
  185.   # add dm headers
  186.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/md"
  187.   cp drivers/md/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/md"
  188.  
  189.   # add inotify.h
  190.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/include/linux"
  191.   cp include/linux/inotify.h "$pkgdir/usr/src/linux-$_kernver/include/linux/"
  192.  
  193.   # add wireless headers
  194.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/net/mac80211/"
  195.   cp net/mac80211/*.h "$pkgdir/usr/src/linux-$_kernver/net/mac80211/"
  196.  
  197.   # add dvb headers for external modules
  198.   # in reference to:
  199.   # http://bugs.archlinux.org/task/9912
  200.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/dvb-core"
  201.   cp drivers/media/dvb/dvb-core/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/dvb-core/"
  202.  
  203.   # add dvb headers for external modules
  204.   # in reference to:
  205.   # http://bugs.archlinux.org/task/11194
  206.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/include/config/dvb/"
  207.   cp include/config/dvb/*.h "$pkgdir/usr/src/linux-$_kernver/include/config/dvb/"
  208.  
  209.   # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  210.   # in reference to:
  211.   # http://bugs.archlinux.org/task/13146
  212.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/frontends/"
  213.   cp drivers/media/dvb/frontends/lgdt330x.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/frontends/"
  214.   cp drivers/media/video/msp3400-driver.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/frontends/"
  215.  
  216.   # add xfs and shmem for aufs building
  217.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/fs/xfs"
  218.   mkdir -p "$pkgdir/usr/src/linux-$_kernver/mm"
  219.   cp fs/xfs/xfs_sb.h "$pkgdir/usr/src/linux-$_kernver/fs/xfs/xfs_sb.h"
  220.  
  221.   # add headers vor virtualbox
  222.   # in reference to:
  223.   # http://bugs.archlinux.org/task/14568
  224.   cp -a include/drm "$pkgdir/usr/src/linux-$_kernver/include/"
  225.  
  226.   # add headers for broadcom wl
  227.   # in reference to:
  228.   # http://bugs.archlinux.org/task/14568
  229.   cp -a include/trace "$pkgdir/usr/src/linux-$_kernver/include/"
  230.  
  231.   # copy in Kconfig files
  232.   for i in `find . -name "Kconfig*"`; do
  233.     mkdir -p "$pkgdir"/usr/src/linux-$_kernver/`echo $i | sed 's|/Kconfig.*||'`
  234.     cp $i "$pkgdir/usr/src/linux-$_kernver/$i"
  235.   done
  236.  
  237.   chown -R root.root "$pkgdir/usr/src/linux-$_kernver"
  238.   find "$pkgdir/usr/src/linux-$_kernver" -type d -exec chmod 755 {} \;
  239.  
  240.   # remove unneeded architectures
  241.   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}"
  242. }
  243.  
  244. # vim:set ts=2 sw=2 et:
  245. md5sums=('c3883760b18d50e8d78819c54d579b00'
  246.          'f6801744832f9cc7c7993fa2265e86c3'
  247.          '110380e5eeb2fbc019c7232037dc522c'
  248.          '18da80ac1d41cba0f74cace471862bba'
  249.          'bcfba8783fd7d0db1261de2f002ad717'
  250.          'a0921a7e563e7ae2d14c3a0603fa16ad'
  251.          '6a5a1925501fe20fafd04fdb3cb4f6ed'
  252.          'edb62063ec2a61fc82cc00b89920f729'
  253.          'e924c5a340f2731c245e6bff8002be13')