updated on Tue Jan 17 20:03:13 UTC 2012
[aur-mirror.git] / linux-pf / PKGBUILD
blobaf5262a71616b5b232b08dafbcec96431468f870
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=1
8 #_patchlevel=0
9 #_subversion=1
10 _basekernel=$_major.$_minor
11 _pkgname=linux-pf
12 _pfrel=6
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      if [[ -s /proc/config.gz ]]; then
142         msg "Extracting config from /proc/config.gz..."
143         zcat /proc/config.gz >| ./.config
144      else
145         msg "running 'sudo modprobe configs'"
146         sudo modprobe configs
147         # Copied from kernel26-ck's PKGBUILD
148         if [[ -s /proc/config.gz ]]; then
149             msg "Extracting config from /proc/config.gz..."
150             zcat /proc/config.gz >| ./.config
151         else
152             msg "You kernel was not compiled with IKCONFIG_PROC."
153             msg "Attempting to run /usr/bin/modprobed_db recall from modprobe_db..."
154             if [ -e /usr/bin/modprobed_db ]; then
155                 sudo /usr/bin/modprobed_db recall
156             fi
157         fi
158         msg "Running make localmodconfig instead..."
159 #       chmod +x ./scripts/kconfig/streamline_config.pl
160 #       ./scripts/kconfig/streamline_config.pl >| config_strip
161 #       mv config_strip .config
162         make localmodconfig
163      fi
164   elif [[ "$answer" = "l" ]]; then
165      # Copied from kernel26-ck's PKGBUILD
166      msg "Attempting to run /usr/bin/reload_database from modprobe_db..."
167      if [ -e /usr/bin/reload_database ]; then
168         /usr/bin/reload_database
169      fi
170      msg "Running 'make localmodconfig'..."
171 #     chmod +x ./scripts/kconfig/streamline_config.pl
172 #     ./scripts/kconfig/streamline_config.pl >| config_strip
173 #     mv config_strip .config
174 #     msg "An error about ksource in line 118 blah blah is NORMAL as is one about nvidia config too!"
175      make localmodconfig
176   else
177      msg "Using stock ARCH kernel .config (with BFS, BFQ and TuxOnIce enabled)."
178   fi
180   # Make some good use of MAKEFLAGS
181   # MAKEFLAGS=`grep -v '#' /etc/makepkg.conf | grep MAKEFLAGS= | sed s/MAKEFLAGS=// | sed s/\"//g`
182   # make prepare
184   # Option for make menuconfig
185   echo
186   msg "Kernel configuration options before build:"
187   echo "    <M> make menuconfig (console menu)"
188   echo "    <N> make nconfig (newer alternative to menuconfig)"
189   echo "    <G> make gconfig (needs gtk)"
190   echo "    <X> make xconfig (needs qt)"
191   echo "    <O> make oldconfig"
192   echo "    <ENTER> to skip configuration and start compiling"
193   read answer
194   case "$answer" in
195    m) make menuconfig
196       ;;
197    g) make gconfig
198       ;;
199    x) make xconfig
200       ;;
201    n) make nconfig
202       ;;
203    o) make oldconfig
204       ;;
205    default)
206       ;;
207   esac
208   cp -v .config ${startdir}/config.local
209   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`
210   CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
211   CPU=`sed -e "s/CONFIG_GENERIC_CPU=y/GENERIC/" <<<$CPU`
212   CPU=`sed -e "s/^686$/GENERIC/" <<<$CPU`
213   cp -v .config ${startdir}/config.$CPU-$CARCH
215   # Give option to rename package according to CPU
216   echo
217   if [[ "$CPU" != "GENERIC" ]]; then
218     echo "=============================================================="
219     msg "Hit <ENTER>: to create a package named linux-pf"
220     echo "             regardless of the CPU selected in config (recommended)"
221     msg "Hit <P>    : to create a package named after the selected CPU"
222     echo "             (e.g. linux-pf-core2 - for advanced users)"
223     echo
224     msg "This option affects ONLY the package name. Whether or not the"
225     msg "kernel is optimized was determined at the previous config step."
226     echo "=============================================================="
227     read answer
228     shopt -s nocasematch
229     if [[ "$answer" = "p" ]]; then
230        export _PKGOPT=y
231     fi
232   fi
233 fi      # batch check ends here
234 export CPU
235 #----------------------------------------
237   # Strip config of uneeded localversion
238   if [ "${_kernelname}" != "" ]; then
239      sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|g" ./.config
240   fi
241   # remove the sublevel from Makefile
242   # this ensures our kernel version is always 3.X-pf
243   # this way, minor kernel updates will not break external modules
244   sed -ri 's|^(SUBLEVEL =).*|\1|' Makefile
246   # Build
247   # Want extreme and non-sensical optimization? Uncomment the following line!
248   # export KCFLAGS="-march=native -Ofast"
249   make bzImage modules
252 package_linux-pf() {
253  _pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
254  pkgdesc=${_pkgdesc}
255  groups=('base')
256  backup=(etc/mkinitcpio.d/${_pkgname}.preset)
257  depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0.7')
258  optdepends=('linux-docs: Kernel hackers manual - HTML documentation that comes with the Linux kernel.'
259             'crda: to set the correct wireless channels of your country'
260             'pm-utils: utilities and scripts for suspend and hibernate power management'
261             'tuxonice-userui: TuxOnIce userspace user interface'
262             'hibernate-script: set of scripts for managing TuxOnIce, hibernation and suspend to RAM'
263             'nvidia-pf: NVIDIA drivers for linux-pf'
264             'nvidia-beta-all: NVIDIA drivers for all installed kernels'
265             'modprobed_db: Keeps track of EVERY kernel module that has ever been probed. Useful for make localmodconfig.')
266  #provides=(${_pkgname}=${_basekernel} 'aufs3') # for $pkgname-optimized
267  provides=(${_pkgname}=${_basekernel} 'aufs3' 'kernel26-pf')
268  # below 'provides' is for when you have no other kernel (which is a bad idea anyway)
269  # provides=(${_pkgname}=${_basekernel} 'linux=${pkgver}' 'aufs3')
270  #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)
271  #conflicts=('kernel26-pf')
272  # If generic build, then conflict with all optimized ones
273  conflicts=('linux-pf-core2' 'linux-pf-k8' 'linux-pf-psc' 'linux-pf-atom' 'linux-pf-k7'
274             'linux-pf-p3' 'linux-pf-pm' 'linux-pf-p4' 'kernel26-pf-core2' 'kernel26-pf-k8'
275             'kernel26-pf-psc' 'kernel26-pf-atom' 'kernel26-pf-k7' 'kernel26-pf-p3'
276             'kernel26-pf-pm' 'kernel26-pf-p4')
277  replaces=('kernel26-pf' 'aufs3')
278  install='linux-pf.install'
280  #'
281   cd ${srcdir}/linux-${_basekernel}
283   # Remove undeeded aufs3 git tree
284   rm -fr aufs3 2>/dev/null
286   # work around the AUR parser
287   # This allows building cpu-optimized packages with according package names.
288   # Useful for repo maintainers.
289   pkgnameopt="${_pkgname}"      # this MUST outside the following 'if'
290   if [[ "$_PKGOPT" = "y" ]]; then       # package naming according to optimization
291     case $CPU in
292      CORE2)
293          pkgname="${_pkgname}-core2"
294          pkgdesc="${_pkgdesc} Intel Core2 optimized."
295          ;;
296      K8)
297          pkgname="${_pkgname}-k8"
298          pkgdesc="${_pkgdesc} AMD K8 optimized."
299          ;;
300      PSC)
301          pkgname="${_pkgname}-psc"
302          pkgdesc="${_pkgdesc} Intel Pentium4/D/Xeon optimized."
303          ;;
304      ATOM)
305          pkgname="${_pkgname}-atom"
306          pkgdesc="${_pkgdesc} Intel Atom optimized."
307          ;;
308      K7)
309          pkgname="${_pkgname}-k7"
310          pkgdesc="${_pkgdesc} AMD K7 optimized."
311          ;;
312      PENTIUMII)
313          pkgname="${_pkgname}-p2"
314          pkgdesc="${_pkgdesc} Intel Pentium2 optimized."
315          ;;
316      PENTIUMIII)
317          pkgname="${_pkgname}-p3"
318          pkgdesc="${_pkgdesc} Intel Pentium3 optimized."
319          ;;
320      PENTIUMM)
321          pkgname="${_pkgname}-pm"
322          pkgdesc="${_pkgdesc} Intel Pentium-M optimized."
323          ;;
324      PENTIUM4)
325          pkgname="${_pkgname}-p4"
326          pkgdesc="${_pkgdesc} Intel Pentium4 optimized."
327          ;;
328      default)
329   # Note to me: DO NOT EVER REMOVE THIS. It's for the AUR PKGBUILD parser.
330          pkgname="${_pkgname}"
331          pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
332          ;;
333     esac
335   # If optimized build, conflict with generic and other optimized ones
337   if [[ "$pkgname" != "$_pkgname" ]]; then
338         pkgnameopt="${pkgname}" # this MUST outside the following 'if'
339         pkgname="${_pkgname}"
340         suffix=`sed -e "s/linux-pf-//" <<<$pkgname`             # get suffix
341         conflicts=('linux-pf' 'kernel26-pf' ${conflicts[@]})    # add generic packages
342         conflicts=({conflicts[@]/linux-pf-$suffix/})            # remove current
343   fi
345     echo
346     echo "======================================="
347     msg  "The package will be named ${pkgnameopt}"
348     msg  "${pkgdesc}"
349     echo "======================================="
350     echo
352   # second batch check ends here
353  fi
355  ### package_linux-pf
356  ###
357   KARCH=x86
359   # get kernel version
360   _kernver="$(make kernelrelease)"
362   mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
363   make INSTALL_MOD_PATH="${pkgdir}" modules_install
364   cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}"
366   # add vmlinux
367   install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux"
369   # install fallback mkinitcpio.conf file and preset file for kernel
370   install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
372   # set correct depmod command for install
373   sed \
374     -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
375     -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
376     -i "${startdir}/${pkgname}.install"
377   sed \
378     -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \
379     -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \
380     -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \
381     -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
383   # remove build and source links
384   rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
385   # remove the firmware
386   rm -rf "${pkgdir}/lib/firmware"
387   # gzip -9 all modules to save 100MB of space
388   find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
389   # make room for external modules
390   ln -s "../extramodules-${_basekernel}${_kernelname:--pf}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
391   # add real version for building modules and running depmod from post_install/upgrade
392   mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--pf}"
393   echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--pf}/version"
395   ###
396   # Our own line
397   true && pkgname="${pkgnameopt}"
400 ### package_linux-pf-headers
401 package_linux-pf-headers() {
402   pkgdesc="Header files and scripts for building modules for linux-pf kernel"
403   provides=('linux-pf-headers')
405   mkdir -p "${pkgdir}/lib/modules/${_kernver}"
407   cd "${pkgdir}/lib/modules/${_kernver}"
408   ln -sf ../../../usr/src/linux-${_kernver} build
410   cd "${srcdir}/linux-${_basekernel}"
411   install -D -m644 Makefile \
412     "${pkgdir}/usr/src/linux-${_kernver}/Makefile"
413   install -D -m644 kernel/Makefile \
414     "${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile"
415   install -D -m644 .config \
416     "${pkgdir}/usr/src/linux-${_kernver}/.config"
418   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include"
420   for i in acpi asm-generic config crypto drm generated linux math-emu \
421     media net pcmcia scsi sound trace video xen; do
422     cp -a include/${i} "${pkgdir}/usr/src/linux-${_kernver}/include/"
423   done
425   # copy arch includes for external modules
426   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/x86"
427   cp -a arch/x86/include "${pkgdir}/usr/src/linux-${_kernver}/arch/x86/"
429   # copy files necessary for later builds, like nvidia and vmware
430   cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}"
431   cp -a scripts "${pkgdir}/usr/src/linux-${_kernver}"
433   # fix permissions on scripts dir
434   chmod og-w -R "${pkgdir}/usr/src/linux-${_kernver}/scripts"
435   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions"
437   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel"
439   cp arch/${KARCH}/Makefile "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
441   if [ "${CARCH}" = "i686" ]; then
442     cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
443   fi
445   cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel/"
447   # add headers for lirc package
448   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video"
450   cp drivers/media/video/*.h  "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/"
452   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
453     mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
454     cp -a drivers/media/video/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
455   done
457   # add docbook makefile
458   install -D -m644 Documentation/DocBook/Makefile \
459     "${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
461   # add dm headers
462   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
463   cp drivers/md/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
465   # add inotify.h
466   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/linux"
467   cp include/linux/inotify.h "${pkgdir}/usr/src/linux-${_kernver}/include/linux/"
469   # add wireless headers
470   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
471   cp net/mac80211/*.h "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
473   # add dvb headers for external modules
474   # in reference to:
475   # http://bugs.archlinux.org/task/9912
476   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core"
477   cp drivers/media/dvb/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/"
478   # and...
479   # http://bugs.archlinux.org/task/11194
480   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
481   cp include/config/dvb/*.h "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
483   # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
484   # in reference to:
485   # http://bugs.archlinux.org/task/13146
486   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
487   cp drivers/media/dvb/frontends/lgdt330x.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
488   cp drivers/media/video/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
490   # add dvb headers
491   # in reference to:
492   # http://bugs.archlinux.org/task/20402
493   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb"
494   cp drivers/media/dvb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/"
495   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends"
496   cp drivers/media/dvb/frontends/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
497   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners"
498   cp drivers/media/common/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/"
500   # add xfs and shmem for aufs building
501   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs"
502   mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/mm"
503   cp fs/xfs/xfs_sb.h "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h"
505   # copy in Kconfig files
506   for i in `find . -name "Kconfig*"`; do
507     mkdir -p "${pkgdir}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
508     cp ${i} "${pkgdir}/usr/src/linux-${_kernver}/${i}"
509   done
511   chown -R root.root "${pkgdir}/usr/src/linux-${_kernver}"
512   find "${pkgdir}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
514   # strip scripts directory
515   find "${pkgdir}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
516     case "$(file -bi "${binary}")" in
517       *application/x-sharedlib*) # Libraries (.so)
518         /usr/bin/strip ${STRIP_SHARED} "${binary}";;
519       *application/x-archive*) # Libraries (.a)
520         /usr/bin/strip ${STRIP_STATIC} "${binary}";;
521       *application/x-executable*) # Binaries
522         /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
523     esac
524   done
526   # remove unneeded architectures
527   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}
530 # Work around the AUR parser
531 pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
533 # makepkg -g >>PKGBUILD
534 sha256sums=('6f220258f3ce9f11d0e53860ccc2d9fe746117056212099876dbe5ee1de80af3'
535             '613467305477052ccd4033c9d882cde52f2c5c2c755d1e971065be91a6c97ada'
536             '29a6d5c8e696fe6868cc201f74bd232418d6e894a31e0144992c1d17c0191e7b'
537             '82d660caa11db0cd34fd550a049d7296b4a9dcd28f2a50c81418066d6e598864'
538             '03ed4eb4a35d42ae6beaaa5e6fdbada4244ed6c343944bba6462defaa6fed0bf'
539             '51ea665cfec42d9f9c7796af2b060b7edbdeb367e42811f8c02667ad729f6b19'
540             '9e1e81d80afac6f316e53947e1b081017090081cd30e6c4c473420b77af4b52b'
541             '19f7fc0753636c32026e444e23bd101bd21cfeb59661284678bf157dc35212f2'
542             'd537a358c9f8b9cbcad34ba99f88af070f54d99c66d3e5d3d4734576ed2fb6e1'
543             '2fc60ad91d7afe5b1e7c7a0cac7555a2dddf2b9fc1f7a044e211904991e10e83'
544             '4bc5a3fc40bf60bd4b362b519219cae56141a9f209bd2cf6bed25c1bd434e2cc'
545             '7985cb06e73d0c6a14aae45711958694ee206e504c3702aaeb24b7d32edb3db4'
546             '549a33278c17af6aa9ca5d3cf2abe3a0b1010d7c66e53d2a357a38ace25f8ea1'
547             'bc7d0bcfa1a2fc6951dea5fa20f654e4f707cde0748e2d48a0b7b347e71e9faf')