updated on Wed Jan 18 08:00:29 UTC 2012
[aur-mirror.git] / linux-pf / PKGBUILD
blob7c1245be9c864b8857b1673d0a1f183c0dd37dbb
1 # Maintainer: Christos Nouskas <nous at archlinux dot us>
2 # PKGBUILD assembled from kernel26
3 # Some lines from  kernel26-bfs and kernel26-ck
4 # Credits to respective maintainers
6 _major=3
7 _minor=2
8 #_patchlevel=0
9 _subversion=1
10 _basekernel=$_major.$_minor
11 _pkgname=linux-pf
12 _pfrel=1
13 _kernelname=-pf
14 _pfpatchhome="http://pf.natalenko.name/sources/${_basekernel}/"
15 _pfpatchname="patch-${_basekernel}.${_pfrel}${_kernelname}.bz2"
17 pkgname=('linux-pf')
18 true && pkgname=('linux-pf' 'linux-pf-headers')
19 pkgver=${_basekernel}.${_pfrel}
20 pkgrel=1
21 arch=('i686' 'x86_64')
22 url="http://pf.natalenko.name/"
23 license=('GPL2')
24 options=(!strip)
25 makedepends=('git' 'xmlto' 'docbook-xsl' 'xz')
26 source=(ftp://www.kernel.org/pub/linux/kernel/v${_major}.x/linux-${_basekernel}.tar.xz
27         config config.x86_64            # the main kernel config files
28         linux-pf.preset                 # standard config files for mkinitcpio ramdisk
29         logo_linux_clut224.ppm.bz2      #
30         logo_linux_mono.pbm.bz2         ## the Arch Linux boot logos
31         logo_linux_vga16.ppm.bz2        #
32         channel-negative-one-maxim.patch        # hopefully fix "channel -1" aireplay-ng error
33         interactive-governor.tar.gz::https://gist.github.com/gists/1172524/download
34         change-default-console-loglevel.patch
35         i915-fix-ghost-tv-output.patch
36 #       i915-fix-incorrect-error-message.patch
37         usb-add-reset-resume-quirk-for-several-webcams.patch
38         ${_pfpatchhome}${_pfpatchname}) # the -pf patchset
40 _aufs3git="git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git"
41 _aufs3name=aufs3
43 # '
45 build() {
46   cd ${srcdir}/linux-${_basekernel}
47   # This is for me, to test the PKGBUILD
48 if [[ $NOEXTRACT = "0" ]]; then
49      # Arch linux logo
50      msg "Replacing penguins with arches"
51      bzip2 -dk ${startdir}/logo_linux_*.bz2
52      mv -f ${startdir}/logo_linux_*.p?m drivers/video/logo/
53      msg "Applying pf-kernel patch"
54      bzip2 -dc ${srcdir}/${_pfpatchname} | patch -Np1
55      msg "Fetching and applying aufs3 patches"
56      git clone ${_aufs3git} ${_aufs3name}
57      cd ${_aufs3name}
58      git checkout origin/aufs${_basekernel} || _aufs3checkout=KRAKRA
59      if [[ ${_aufs3checkout} = "KRAKRA" ]]; then
60         echo
61         msg "AUFS3 not yet ported to version ${_basekernel}!"
62         msg "Skipping related patches."
63         echo
64         cd ..
65      else
66         rm -f include/linux/Kbuild
67         cd ..
68         cp -a ${_aufs3name}/{Documentation,fs,include} ${srcdir}/linux-${_basekernel}/
69         for _patch in ${_aufs3name}/*.patch; do
70             patch -Np1 < ${_patch} || _aufs3fail=KRAKRA
71         done
72         if [[ ${_aufs3fail} = "KRAKRA" ]]; then
73             echo
74             msg "Not all aufs3 patches applied correctly. Ignore this if you won't use AUFS."
75             msg "Otherwise, press CTRL-C now and fix manually"
76             echo
77         fi
78     fi
80   # add latest fixes from stable queue, if needed
81   # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
83   # Some chips detect a ghost TV output
84   # mailing list discussion: http://lists.freedesktop.org/archives/intel-gfx/2011-April/010371.html
85   # Arch Linux bug report: FS#19234
86   #
87   # It is unclear why this patch wasn't merged upstream, it was accepted,
88   # then dropped because the reasoning was unclear. However, it is clearly
89   # needed.
90   patch -Np1 -i "${srcdir}/i915-fix-ghost-tv-output.patch"
92   # In 3.1.1, a DRM_DEBUG message is falsely declared as DRM_ERROR. This
93   # worries users, as this message is displayed even at loglevel 4. Fix
94   # this.
95 #  patch -Np1 -i "${srcdir}/i915-fix-incorrect-error-message.patch"
97   # Add the USB_QUIRK_RESET_RESUME for several webcams
98   # FS#26528
99   patch -Np1 -i "${srcdir}/usb-add-reset-resume-quirk-for-several-webcams.patch"
101   # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
102   # remove this when a Kconfig knob is made available by upstream
103   # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
104   patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
106    msg "Patching for restless souls"
107    patch -Np1 < ${srcdir}/channel-negative-one-maxim.patch
109    # Interactive governor patch
110    # broken for now
111    #   msg "Interactice CPU governor patch"
112    #   mv ${srcdir}/gist*/gistfile1.diff ${srcdir}
113    #   patch -Np1 < ${srcdir}/gistfile1.diff
115    if [ "$CARCH" = "x86_64" ]; then
116         cat ${startdir}/config.x86_64 >| .config
117    else
118         cat ${startdir}/config >| .config
119    fi
121   sed -i "s/EXTRAVERSION = -${_pfrel}/EXTRAVERSION = ${_kernelname}/" Makefile
122   _arch=$CARCH
125 #----------------------------------------
126 if [[ "$_BATCH" != "y" ]]; then         # for batch building
127   echo
128   echo "======================================================="
129   msg "You might be prompted below for some config options"
130   echo "======================================================="
131   echo
132   msg "Hit <Y> to use your running kernel's config"
133   echo "    (needs IKCONFIG and IKCONFIG_PROC)"
134   msg "Hit <L> to run 'make localmodconfig'"
135   msg "Hit <N> (or just <ENTER>) to build an all-inclusive kernel like stock -ARCH"
136   echo "    (warning: it can take a looong time)"
137   echo
138   read answer
139   shopt -s nocasematch
140   if [[ "$answer" = "y" ]]; then
141      msg "running 'sudo modprobe configs'"
142      sudo modprobe configs
143      if [[ -s /proc/config.gz ]]; then
144         msg "Extracting config from /proc/config.gz..."
145         zcat /proc/config.gz >| ./.config
146      else
147         msg "You kernel was not compiled with IKCONFIG_PROC."
148         # Copied from kernel26-ck's PKGBUILD
149         msg "Attempting to run /usr/bin/reload_database from modprobe_db..."
150         if [ -e /usr/bin/reload_database ]; then
151            /usr/bin/reload_database
152         fi
153         msg "Running make localmodconfig instead..."
154 #       chmod +x ./scripts/kconfig/streamline_config.pl
155 #       ./scripts/kconfig/streamline_config.pl >| config_strip
156 #       mv config_strip .config
157         make localmodconfig
158      fi
159   elif [[ "$answer" = "l" ]]; then
160      # Copied from kernel26-ck's PKGBUILD
161      msg "Attempting to run /usr/bin/reload_database from modprobe_db..."
162      if [ -e /usr/bin/reload_database ]; then
163         /usr/bin/reload_database
164      fi
165      msg "Running 'make localmodconfig'..."
166 #     chmod +x ./scripts/kconfig/streamline_config.pl
167 #     ./scripts/kconfig/streamline_config.pl >| config_strip
168 #     mv config_strip .config
169 #     msg "An error about ksource in line 118 blah blah is NORMAL as is one about nvidia config too!"
170      make localmodconfig
171   else
172      msg "Using stock ARCH kernel .config (with BFS, BFQ and TuxOnIce enabled)."
173   fi
175   # Make some good use of MAKEFLAGS
176   # MAKEFLAGS=`grep -v '#' /etc/makepkg.conf | grep MAKEFLAGS= | sed s/MAKEFLAGS=// | sed s/\"//g`
177   # make prepare
179   # Option for make menuconfig
180   echo
181   msg "Kernel configuration options before build:"
182   echo "    <M> make menuconfig (console menu)"
183   echo "    <N> make nconfig (newer alternative to menuconfig)"
184   echo "    <G> make gconfig (needs gtk)"
185   echo "    <X> make xconfig (needs qt)"
186   echo "    <O> make oldconfig"
187   echo "    <ENTER> to skip configuration and start compiling"
188   read answer
189   case "$answer" in
190    m) make menuconfig
191       ;;
192    g) make gconfig
193       ;;
194    x) make xconfig
195       ;;
196    n) make nconfig
197       ;;
198    o) make oldconfig
199       ;;
200    default)
201       ;;
202   esac
203   cp -v .config ${startdir}/config.local
204   CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|M686=y" ./.config`
205   CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
206   CPU=`sed -e "s/CONFIG_GENERIC_CPU=y/GENERIC/" <<<$CPU`
207   CPU=`sed -e "s/^686$/GENERIC/" <<<$CPU`
208   cp -v .config ${startdir}/config.$CPU-$CARCH
210   # Give option to rename package according to CPU
211   echo
212   if [[ "$CPU" != "GENERIC" ]]; then
213     echo "=============================================================="
214     msg "Hit <ENTER>: to create a package named linux-pf"
215     echo "             regardless of the CPU selected in config (recommended)"
216     msg "Hit <P>    : to create a package named after the selected CPU"
217     echo "             (e.g. linux-pf-core2 - for advanced users)"
218     echo
219     msg "This option affects ONLY the package name. Whether or not the"
220     msg "kernel is optimized was determined at the previous config step."
221     echo "=============================================================="
222     read answer
223     shopt -s nocasematch
224     if [[ "$answer" = "p" ]]; then
225        export _PKGOPT=y
226     fi
227   fi
228 fi      # batch check ends here
229 export CPU
230 #----------------------------------------
232   # Strip config of uneeded localversion
233   if [ "${_kernelname}" != "" ]; then
234      sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|g" ./.config
235   fi
236   # remove the sublevel from Makefile
237   # this ensures our kernel version is always 3.X-pf
238   # this way, minor kernel updates will not break external modules
239   sed -ri 's|^(SUBLEVEL =).*|\1|' Makefile
241   # Build
242   # Want extreme and non-sensical optimization? Uncomment the following line!
243   # export KCFLAGS="-march=native -Ofast"
244   make bzImage modules
247 package_linux-pf() {
248  _pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
249  pkgdesc=${_pkgdesc}
250  groups=('base')
251  backup=(etc/mkinitcpio.d/${_pkgname}.preset)
252  depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0.7')
253  optdepends=('linux-docs: Kernel hackers manual - HTML documentation that comes with the Linux kernel.'
254             'crda: to set the correct wireless channels of your country'
255             'pm-utils: utilities and scripts for suspend and hibernate power management'
256             'tuxonice-userui: TuxOnIce userspace user interface'
257             'hibernate-script: set of scripts for managing TuxOnIce, hibernation and suspend to RAM'
258             'nvidia-pf: NVIDIA drivers for linux-pf'
259             'nvidia-beta-all: NVIDIA drivers for all installed kernels'
260             'modprobed_db: Keeps track of EVERY kernel module that has ever been probed. Useful for make localmodconfig.')
261  #provides=(${_pkgname}=${_basekernel} 'aufs3') # for $pkgname-optimized
262  provides=(${_pkgname}=${_basekernel} 'aufs3' 'kernel26-pf')
263  # below 'provides' is for when you have no other kernel (which is a bad idea anyway)
264  # provides=(${_pkgname}=${_basekernel} 'linux=${pkgver}' 'aufs3')
265  #conflicts=(linux-pf-core2 linux-pf-k8 linux-pf-psc linux-pf-atom linux-pf-k7 linux-pf-p3 linux-pf-pm linux-pf-p4)
266  #conflicts=('kernel26-pf')
267  # If generic build, then conflict with all optimized ones
268  conflicts=('linux-pf-core2' 'linux-pf-k8' 'linux-pf-psc' 'linux-pf-atom' 'linux-pf-k7'
269             'linux-pf-p3' 'linux-pf-pm' 'linux-pf-p4' 'kernel26-pf-core2' 'kernel26-pf-k8'
270             'kernel26-pf-psc' 'kernel26-pf-atom' 'kernel26-pf-k7' 'kernel26-pf-p3'
271             'kernel26-pf-pm' 'kernel26-pf-p4')
272  replaces=('kernel26-pf' 'aufs3')
273  install='linux-pf.install'
275  #'
276   cd ${srcdir}/linux-${_basekernel}
278   # Remove undeeded aufs3 git tree
279   rm -fr aufs3 2>/dev/null
281   # work around the AUR parser
282   # This allows building cpu-optimized packages with according package names.
283   # Useful for repo maintainers.
284   pkgnameopt="${_pkgname}"      # this MUST outside the following 'if'
285   if [[ "$_PKGOPT" = "y" ]]; then       # package naming according to optimization
286     case $CPU in
287      CORE2)
288          pkgname="${_pkgname}-core2"
289          pkgdesc="${_pkgdesc} Intel Core2 optimized."
290          ;;
291      K8)
292          pkgname="${_pkgname}-k8"
293          pkgdesc="${_pkgdesc} AMD K8 optimized."
294          ;;
295      PSC)
296          pkgname="${_pkgname}-psc"
297          pkgdesc="${_pkgdesc} Intel Pentium4/D/Xeon optimized."
298          ;;
299      ATOM)
300          pkgname="${_pkgname}-atom"
301          pkgdesc="${_pkgdesc} Intel Atom optimized."
302          ;;
303      K7)
304          pkgname="${_pkgname}-k7"
305          pkgdesc="${_pkgdesc} AMD K7 optimized."
306          ;;
307      PENTIUMII)
308          pkgname="${_pkgname}-p2"
309          pkgdesc="${_pkgdesc} Intel Pentium2 optimized."
310          ;;
311      PENTIUMIII)
312          pkgname="${_pkgname}-p3"
313          pkgdesc="${_pkgdesc} Intel Pentium3 optimized."
314          ;;
315      PENTIUMM)
316          pkgname="${_pkgname}-pm"
317          pkgdesc="${_pkgdesc} Intel Pentium-M optimized."
318          ;;
319      PENTIUM4)
320          pkgname="${_pkgname}-p4"
321          pkgdesc="${_pkgdesc} Intel Pentium4 optimized."
322          ;;
323      default)
324   # Note to me: DO NOT EVER REMOVE THIS. It's for the AUR PKGBUILD parser.
325          pkgname="${_pkgname}"
326          pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
327          ;;
328     esac
330   # If optimized build, conflict with generic and other optimized ones
332   if [[ "$pkgname" != "$_pkgname" ]]; then
333         pkgnameopt="${pkgname}" # this MUST outside the following 'if'
334         pkgname="${_pkgname}"
335         suffix=`sed -e "s/linux-pf-//" <<<$pkgname`             # get suffix
336         conflicts=('linux-pf' 'kernel26-pf' ${conflicts[@]})    # add generic packages
337         conflicts=({conflicts[@]/linux-pf-$suffix/})            # remove current
338   fi
340     echo
341     echo "======================================="
342     msg  "The package will be named ${pkgnameopt}"
343     msg  "${pkgdesc}"
344     echo "======================================="
345     echo
347   # second batch check ends here
348  fi
350  ### package_linux-pf
351  ###
352   KARCH=x86
354   # get kernel version
355   _kernver="$(make kernelrelease)"
357   mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
358   make INSTALL_MOD_PATH="${pkgdir}" modules_install
359   cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}"
361   # add vmlinux
362   install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux"
364   # install fallback mkinitcpio.conf file and preset file for kernel
365   install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
367   # set correct depmod command for install
368   sed \
369     -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
370     -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
371     -i "${startdir}/${pkgname}.install"
372   sed \
373     -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \
374     -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \
375     -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \
376     -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
378   # remove build and source links
379   rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
380   # remove the firmware
381   rm -rf "${pkgdir}/lib/firmware"
382   # gzip -9 all modules to save 100MB of space
383   find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
384   # make room for external modules
385   ln -s "../extramodules-${_basekernel}${_kernelname:--pf}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
386   # add real version for building modules and running depmod from post_install/upgrade
387   mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--pf}"
388   echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--pf}/version"
390   ###
391   # Our own line
392   true && pkgname="${pkgnameopt}"
395 ### package_linux-pf-headers
396 package_linux-pf-headers() {
397   pkgdesc="Header files and scripts for building modules for linux-f kernel"
398   provides=('linux-pf-headers')
400   mkdir -p "${pkgdir}/lib/modules/${_kernver}"
402   cd "${pkgdir}/lib/modules/${_kernver}"
403   ln -sf ../../../usr/src/linux-${_kernver} build
405   cd "${srcdir}/linux-${_basekernel}"
406   install -D -m644 Makefile \
407     "${pkgdir}/usr/src/linux-${_kernver}/Makefile"
408   install -D -m644 kernel/Makefile \
409     "${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile"
410   install -D -m644 .config \
411     "${pkgdir}/usr/src/linux-${_kernver}/.config"
413   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include"
415   for i in acpi asm-generic config crypto drm generated linux math-emu \
416     media net pcmcia scsi sound trace video xen; do
417     cp -a include/${i} "${pkgdir}/usr/src/linux-${_kernver}/include/"
418   done
420   # copy arch includes for external modules
421   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/x86"
422   cp -a arch/x86/include "${pkgdir}/usr/src/linux-${_kernver}/arch/x86/"
424   # copy files necessary for later builds, like nvidia and vmware
425   cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}"
426   cp -a scripts "${pkgdir}/usr/src/linux-${_kernver}"
428   # fix permissions on scripts dir
429   chmod og-w -R "${pkgdir}/usr/src/linux-${_kernver}/scripts"
430   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions"
432   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel"
434   cp arch/${KARCH}/Makefile "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
436   if [ "${CARCH}" = "i686" ]; then
437     cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
438   fi
440   cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel/"
442   # add headers for lirc package
443   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video"
445   cp drivers/media/video/*.h  "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/"
447   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
448     mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
449     cp -a drivers/media/video/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
450   done
452   # add docbook makefile
453   install -D -m644 Documentation/DocBook/Makefile \
454     "${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
456   # add dm headers
457   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
458   cp drivers/md/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
460   # add inotify.h
461   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/linux"
462   cp include/linux/inotify.h "${pkgdir}/usr/src/linux-${_kernver}/include/linux/"
464   # add wireless headers
465   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
466   cp net/mac80211/*.h "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
468   # add dvb headers for external modules
469   # in reference to:
470   # http://bugs.archlinux.org/task/9912
471   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core"
472   cp drivers/media/dvb/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/"
473   # and...
474   # http://bugs.archlinux.org/task/11194
475   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
476   cp include/config/dvb/*.h "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
478   # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
479   # in reference to:
480   # http://bugs.archlinux.org/task/13146
481   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
482   cp drivers/media/dvb/frontends/lgdt330x.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
483   cp drivers/media/video/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
485   # add dvb headers
486   # in reference to:
487   # http://bugs.archlinux.org/task/20402
488   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb"
489   cp drivers/media/dvb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/"
490   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends"
491   cp drivers/media/dvb/frontends/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
492   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners"
493   cp drivers/media/common/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/"
495   # add xfs and shmem for aufs building
496   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs"
497   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/mm"
498   cp fs/xfs/xfs_sb.h "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h"
500   # copy in Kconfig files
501   for i in `find . -name "Kconfig*"`; do
502     mkdir -p "${pkgdir}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
503     cp ${i} "${pkgdir}/usr/src/linux-${_kernver}/${i}"
504   done
506   chown -R root.root "${pkgdir}/usr/src/linux-${_kernver}"
507   find "${pkgdir}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
509   # strip scripts directory
510   find "${pkgdir}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
511     case "$(file -bi "${binary}")" in
512       *application/x-sharedlib*) # Libraries (.so)
513         /usr/bin/strip ${STRIP_SHARED} "${binary}";;
514       *application/x-archive*) # Libraries (.a)
515         /usr/bin/strip ${STRIP_STATIC} "${binary}";;
516       *application/x-executable*) # Binaries
517         /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
518     esac
519   done
521   # remove unneeded architectures
522   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}
525 # Work around the AUR parser
526 pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
528 # makepkg -g >>PKGBUILD
529 sha256sums=('dd96ed02b53fb5d57762e4b1f573460909de472ca588f81ec6660e4a172e7ba7'
530             '0acec6193282ddaeb28838db3ef4dc93d724314cd27c3e0edd23973ae2be326e'
531             '1400697849b8c10953d7e9fed3efdb150f9f5f590447e3bb64ef7b6688aa27d6'
532             '82d660caa11db0cd34fd550a049d7296b4a9dcd28f2a50c81418066d6e598864'
533             '03ed4eb4a35d42ae6beaaa5e6fdbada4244ed6c343944bba6462defaa6fed0bf'
534             '51ea665cfec42d9f9c7796af2b060b7edbdeb367e42811f8c02667ad729f6b19'
535             '9e1e81d80afac6f316e53947e1b081017090081cd30e6c4c473420b77af4b52b'
536             '19f7fc0753636c32026e444e23bd101bd21cfeb59661284678bf157dc35212f2'
537             'd537a358c9f8b9cbcad34ba99f88af070f54d99c66d3e5d3d4734576ed2fb6e1'
538             '2fc60ad91d7afe5b1e7c7a0cac7555a2dddf2b9fc1f7a044e211904991e10e83'
539             '4bc5a3fc40bf60bd4b362b519219cae56141a9f209bd2cf6bed25c1bd434e2cc'
540             '549a33278c17af6aa9ca5d3cf2abe3a0b1010d7c66e53d2a357a38ace25f8ea1'
541             '847981649407470de69dc989e8a1a5b44eae75c5403d46e863ce6bacd47c25fb')