Commit c1d6d549 authored by Phil Miller's avatar Phil Miller
Browse files

linux-lts: bump to 3.0.21

parent 840a3b8f
# Source env-settings
source ../_buildscripts/`pwd | cut -d/ -f3`-${_arch}-makepkg.conf
# Pre-Patch settings
_patch="3.0.21"
_prepatch="3.0.22-rc1"
_queue="3.0"
# Aufs
_aufs="3.0-20120109"
# Kernel source file
#SRC="ftp://ftp.kernel.org/pub/linux/kernel/v3.x/linux-3.0.tar.bz2"
SRC="http://ftp.uni-erlangen.de/pub/mirrors/kernel.org/v3.x/linux-3.0.tar.bz2"
# Original source directory
SRCORIG="linux-3.0"
# Our source directory
SRCNAME="linux-3.0-CHAKRA-LTS"
# Patches:
# URL%patchlevel
# or
# filename%patchlevel (file must be in patches subdirectory)
PATCHES=(
# add upstream patch from 3.0 series
ftp://ftp.kernel.org/pub/linux/kernel/v3.x/patch-$_patch.gz%1
#http://ftp.uni-erlangen.de/pub/mirrors/kernel.org/v3.x/patch-$_patch.gz%1
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
#http://chakra.sourceforge.net/sources/linux/patches/3.0/candidate/$_prepatch.patch%1
ftp://ftp.kernel.org/pub/linux/kernel/v3.x/stable-review/patch-$_prepatch.gz%1
# Archlinux patches
### Some chips detect a ghost TV output
### mailing list discussion: http://lists.freedesktop.org/archives/intel-gfx/2011-April/010371.html
### Arch Linux bug report: FS#19234
http://chakra.sourceforge.net/sources/linux/patches/3.0/arch/i915-fix-ghost-tv-output.patch%1
### set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
### remove this when a Kconfig knob is made available by upstream
### (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
http://chakra.sourceforge.net/sources/linux/patches/3.0/arch/change-default-console-loglevel.patch%1
# Custom Chakra Patches
### features
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/all/Kbuild-kconfig-Verbose-version-of-listnewconfig.patch.bz2%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/ath_override-eeprom-countrycode.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/cgroups-perm-wgrp.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/defaults-fat-utf8.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/drm_add-a-driver-for-kvm-emulated-Cirrus.patch.bz2%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/sched-cgroups-policy-priority.patch%1
### add aufs3 support, in reference to:
### http://aufs.sourceforge.net
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/aufs3.0/aufs$_aufs.patch.bz2%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/aufs3.0/aufs$_aufs-base.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/aufs3.0/aufs$_aufs-kbuild.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/aufs3.0/aufs$_aufs-loopback.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/aufs3.0/aufs$_aufs-proc_map.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/aufs3.0/aufs$_aufs-standalone.patch%1
### add overlayfs v11
### http://git.kernel.org/?p=linux/kernel/git/mszeredi/vfs.git;a=shortlog;h=refs/heads/overlayfs.v11
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/01-vfs_add-i_op-_open.patch.bz2%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/02-vfs_export-do_splice_direct-to-modules.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/03-vfs_introduce-clone_private_mount.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/04-overlay-filesystem.patch.bz2%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/05-overlayfs_add-statfs-support.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/06-overlayfs_implement-show_options.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/07-overlay_overlay-filesystem-documentation.diff%1
# unwanted feature
#http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/08-fs_limit-filesystem-stacking-depth.diff%1
#http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/12-overlayfs-v10-ovl_permission.diff-original%1
#http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/13-overlayfs-v10-ovl_dir_fsync.diff-original%1
#
# Jordi Pujol's overlayfs patches
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/50-copy-up-performance.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/51-improve-ovl_copy_up_xattr.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/52-vfs_getxattr-performance.patch%1
# suppress unreliable code, it confuses /proc/mounts
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/59-read-only.patch%1
# revert Linux 3.1 functions to 3.0
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/60-overlayfs-v10-ovl_permission.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/overlayfs-v11/61-overlayfs-v10-ovl_dir_fsync.patch%1
### add tuxonice
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/tuxonice/current-tuxonice-for-3.0.patch.bz2%1
### add acerhk
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/01_acerhk-0.5.35.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/02_64bits_support_for_aspire5100.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/03_Add_Medion_MD97600_support.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/04_3rd-acerhk-proc_dir_entry-owner.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/05_kbuild.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/06_lindent.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/07_remove-ifdefs-for-ancient-kernels.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/08_remove-ifdefs-for-ACERDEBUG.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/09_kcompat-2.6.36.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/10_kcompat-2.6.38.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/11_bg-flag.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/features/acerhk/12_Get-rid-off-bios-error.patch%1
### chakra specific patches.
http://chakra.sourceforge.net/sources/linux/patches/3.0/chakra/af_802154-Disable-auto-loading-as-mitigation-against.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/chakra/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/chakra/cgroups-Document-the-Chakra-memory-resource-controll.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/chakra/decnet-Disable-auto-loading-as-mitigation-against-lo.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/chakra/doc-build-parallel.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/chakra/module-bug-Add-TAINT_OOT_MODULE-flag.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/chakra/rds-Disable-auto-loading-as-mitigation-against-local.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/chakra/sched-autogroup-disabled.patch%1
http://chakra.sourceforge.net/sources/linux/patches/3.0/chakra/sysrq-mask.patch%1
)
# Name of the resulting patch (will be bzipped afterwards)
PATCHNAME="patch-3.0.21-1-CHAKRA-LTS"
# Run this before applying patches
pre_apply() {
:
}
# Run this after applying patches
post_apply() {
# remove the sublevel and extraversion from Makefile
# this ensures our kernel version is always 3.X-CHAKRA-LTS
# this way, minor kernel updates will not break external modules
sed -i 's|^SUBLEVEL = .*$|SUBLEVEL = |g' Makefile
sed -i 's|^EXTRAVERSION = .*$|EXTRAVERSION = |g' Makefile
# Kill some files
find . -name '*~' -exec rm -f {} \; 2>/dev/null
}
README - 2010-08-12
To generate a kernel-patch change in your chakra-buildsys.
Enter the linux-X-CHAKRA folder.
Create the kernel patch with:
./gen_kernel_patch
Create the kernel pre-patch with:
./gen_kernel_patch
Create the aufs-patch with:
./create-aufs.sh
You find the needed aufs-patch in _chroot/<name-of-chroot>/_tmp
Also you need the 3 patches from the aufs-folder.
\ No newline at end of file
aufs3-standalone @ 61dd84a8
Subproject commit 61dd84a83e1c343db443ee99fe8c4b5c16ad6f6a
#!/bin/bash
rm -Rf aufs3-standalone
# clone the aufs repository to the local disk
git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git
cd aufs3-standalone
git branch -r
git checkout origin/aufs3.0
# modify what you want
# and after
# create the patch with the directories: fs, include and Documentation
rm -v $(find . -type f -name '*.orig')
grep -qse 'EXPORT_SYMBOL(' aufs3-standalone.patch && \
sed -i-old -e 's|EXPORT_SYMBOL(|EXPORT_SYMBOL_GPL(|' aufs3-standalone.patch
rm -rf /tmp/linux-3.0
mkdir /tmp/linux-3.0
cp -a fs /tmp/linux-3.0
cp -a include /tmp/linux-3.0
cp -a Documentation /tmp/linux-3.0
rm /tmp/linux-3.0/include/linux/Kbuild
cd /tmp
diff -Naur null linux-3.0 | filterdiff | \
sed -e 's|null\(/include/linux/Kbuild\)|linux-3.0-old\1|;s|^--- null.*|--- /dev/null|;\|linux-3.0/include/linux/Kbuild|,${\|@@ -0,0 +1 @@|,$d}' \
| bzip2 > aufs$(sed -ne 's|#define.*AUFS_VERSION.*"\(.*\)"|\1|p' linux-3.0/include/linux/aufs_type.h).patch.bz2
cd $OLDPWD
# the patch is created in /tmp
# the other patches needed to compile are in the base directory
\ No newline at end of file
#!/bin/bash
cat_patch() {
file=${startdir}/src/$(basename ${1})
ftype=$(file -bizL "${file}")
case "$ftype" in
*application/x-gzip*)
zcat ${file} ;;
*application/x-bzip*)
bzcat ${file} ;;
*application/x-xz*)
xzcat ${file} ;;
*)
cat ${file} ;;
esac
}
get_file() {
file=$(basename ${1})
OPWD=${PWD}
if [ "${file}" != "${1}" ]; then
cd ${SRCDEST}
[ ! -f ${file} ] && wget -c ${1}
cd ${startdir}/src
ln -s ../../_sources/${file} .
else
cd ${startdir}/src
ln -s ../patches/${file} .
fi
cd ${OPWD}
}
source PATCHCFG
export SRCNAME
export startdir=${PWD}
mkdir ${startdir}/src
cd ${startdir}/src
get_file ${SRC}
bsdtar -xf $(basename ${SRC})
cp -a ${SRCORIG} ${SRCNAME}
cd ${SRCNAME}
pre_apply
for p in ${PATCHES[@]}; do
patchname=$(echo ${p} | cut -d% -f1)
patchstrip=$(echo ${p} | cut -d% -f2)
get_file ${patchname}
cat_patch ${patchname} | patch -Np${patchstrip} || exit 1
done
post_apply
rm -v $(find . -type f -name '*.orig')
cd ${startdir}/src
diff -Nur ${SRCORIG} ${SRCNAME} > $startdir/${PATCHNAME}
bzip2 --best $startdir/${PATCHNAME}
md5sum $startdir/${PATCHNAME}.bz2
#!/bin/bash
source PATCHCFG
if [ -d stable-queue ] ;
then
cd stable-queue
git pull
cd ..
else
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git
fi
if [ -d stable-queue/queue-$_queue ] ;
then
cd stable-queue/queue-$_queue
for i in $(cat ./series);
do
cat $i >> ../../$_prepatch.patch;
done
else
echo "There is no patch-set this time"
fi
\ No newline at end of file
#
# Chakra Packages for Chakra, part of chakra-project.org
# Core Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgbase="linux-lts"
pkgname=('linux-lts' 'linux-lts-headers') # Build stock -CHAKRA-LTS kernel
_kernelname=${pkgname#linux}
_basekernel=2.6.35
pkgver=${_basekernel}.14
pkgrel=3
_patchname="patch-${pkgver}-3-CHAKRA-LTS"
pkgname=('linux-lts' 'linux-lts-headers' 'linux-lts-docs') # Build stock -CHAKRA-LTS kernel
# pkgname=linux-custom # Build kernel with a different name
_kernelname=${pkgname#linux-lts}
_basekernel=3.0
pkgver=${_basekernel}.21
pkgrel=1
_aufs="3.0-20120109"
makedepends=('xmlto' 'docbook-xsl')
_patchname="patch-${pkgver}-1-CHAKRA-LTS"
arch=(i686 x86_64)
license=('GPL2')
url="http://www.kernel.org"
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
options=(!strip)
source=(ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-$_basekernel.tar.bz2
http://chakra.sourceforge.net/sources/linux/${_patchname}.bz2
# the main kernel config files
config config.x86_64
config.i686 config.x86_64
# standard config files for mkinitcpio ramdisk
${pkgname}.preset)
md5sums=('091abeb4684ce03d1d936851618687b6'
'2f1f6f4ab6c5cce3515a9e69d51d2e63'
'22882396c6a950d5f25ef1a1eb46c5e2'
'925ddf37962a4942fae3fbb6d1ab2e70'
linux-lts.preset)
md5sums=('398e95866794def22b12dfbc15ce89c0'
'a178943c5f58449acf965290f4b08b31'
'4dc4ffb13e001900b332a30ccadabc04'
'75d34f858b999c6659be93c1998e694f'
'56cdd0978dd4a539a25813fd4273c834')
build() {
cd ${srcdir}/linux-$_basekernel
# fix setlocalversion
sed -i 's|echo "+"|# echo "+"|g' ./scripts/setlocalversion
# Add -CHAKRA patches
patch -Np1 -i ${srcdir}/${_patchname} || return 1
# Fix drivers/staging/hv/netvsc_drv.c:22:26: fatal error: linux/atomic.h: No such file or directory
sed -ie 's~linux/atomic.h~asm/atomic.h~g' drivers/staging/hv/netvsc_drv.c
# Add -CHAKRA-LTS patches
patch -Np1 -i ${srcdir}/${_patchname}
if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 >./.config
else
cat ../config >./.config
fi
# create .config
cat "${srcdir}/config.${CARCH}" > ./.config
# hack to prevent output kernel from being marked as dirty or git
echo "" > ${srcdir}/linux-${_basekernel}/.scmversion
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
fi
# get kernel version
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
#make menuconfig # CLI menu for configuration
#make nconfig # new CLI menu for configuration
#make xconfig # X-based configuration
#make oldconfig # using old config from previous kernel version
# ... or manually edit .config
####################
# stop here
# this is useful to configure the kernel
#msg "Stopping build"
#return 1
####################
yes "" | make config
# build!
make bzImage modules || return 1
make ${MAKEFLAGS} bzImage modules
}
package_linux-lts() {
pkgdesc="The Linux Longterm Support Kernel and modules"
backup=(etc/mkinitcpio.d/linux-lts.preset)
depends=('coreutils' "linux-firmware>=${pkgver}" 'module-init-tools' 'mkinitcpio>=0.7')
# pwc, ieee80211 and hostap-driver26 modules are included in linux-lts now
# nforce package support was abandoned by nvidia, kernel modules should cover everything now.
# kernel24 support is dropped since glibc24
replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
pkgdesc="The Linux LTS-Kernel and modules"
groups=('base')
depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0.7.5')
optdepends=('crda: to set the correct wireless channels of your country')
replaces=('kernel24' 'kernel24-scsi' 'kernel26-lts' 'linux-scsi'
'alsa-driver' 'ieee80211' 'hostap-driver26'
'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
'gspcav1' 'atl2' 'wlan-ng26' 'rt2500'
'aufs2' 'nouveau-drm-lts' 'kernel26-lts')
provides=('aufs2' 'nouveau-drm-lts' "kernel26-lts=${pkgver}"
"linux=${pkgver}" 'acerhk-lts=0.5.35')
'aufs3' 'nouveau-drm')
provides=("aufs3=$_aufs" 'nouveau-drm-lts' 'kernel26-lts' 'acerhk-lts=0.5.35')
conflicts=('kernel26-lts' 'acerhk-lts')
install=linux-lts.install
optdepends=('crda: to set the correct wireless channels of your country')
backup=("etc/mkinitcpio.d/${pkgname}.preset")
install=${pkgname}.install
cd "${srcdir}/linux-${_basekernel}"
......@@ -110,6 +109,7 @@ package_linux-lts() {
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i "${startdir}/${pkgname}.install"
sed \
-e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \
-e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \
-i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
......@@ -118,114 +118,159 @@ package_linux-lts() {
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf "${pkgdir}/lib/firmware"
# gzip -9 all modules to safe 100MB of space
# gzip -9 all modules to save 100MB of space
find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
# make room for external modules
ln -s "../extramodules-${_basekernel}${_kernelname:--CHAKRA-LTS}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from post_install/upgrade
mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--CHAKRA-LTS}"
echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--CHAKRA-LTS}/version"
}
package_linux-lts-headers() {
pkgdesc="Header files and scripts for building modules for linux-lts"
provides=("kernel26-lts-headers=${pkgver}" "linux-headers=${pkgver}")
replaces=("kernel26-lts-headers")
conflicts=("kernel26-lts-headers")
cd ${srcdir}/linux-${_basekernel}/
make oldconfig && make prepare || return 1
mkdir -p ${pkgdir}/lib/modules/${_kernver}
cd ${pkgdir}/lib/modules/${_kernver}
pkgdesc="Header files and scripts for building modules for linux lts-kernel"
provides=('kernel26-lts-headers')
conflicts=('kernel26-lts-headers')
replaces=('kernel26-lts-headers')
mkdir -p "${pkgdir}/lib/modules/${_kernver}"
cd "${pkgdir}/lib/modules/${_kernver}"
ln -sf ../../../usr/src/linux-${_kernver} build
cd ${srcdir}/linux-$_basekernel
cd "${srcdir}/linux-${_basekernel}"
install -D -m644 Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Makefile
"${pkgdir}/usr/src/linux-${_kernver}/Makefile"
install -D -m644 kernel/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
"${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile"
install -D -m644 .config \
${pkgdir}/usr/src/linux-${_kernver}/.config
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
"${pkgdir}/usr/src/linux-${_kernver}/.config"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include"
for i in acpi asm-generic config crypto drm generated linux math-emu \
media net pcmcia scsi sound trace video xen; do
cp -a include/${i} "${pkgdir}/usr/src/linux-${_kernver}/include/"
done
# copy arch includes for external modules
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/x86"
cp -a arch/x86/include "${pkgdir}/usr/src/linux-${_kernver}/arch/x86/"
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}"
cp -a scripts "${pkgdir}/usr/src/linux-${_kernver}"
# fix permissions on scripts dir
chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
chmod og-w -R "${pkgdir}/usr/src/linux-${_kernver}/scripts"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel"
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
cp arch/${KARCH}/Makefile "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
if [ "$CARCH" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
if [ "${CARCH}" = "i686" ]; then
cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
fi
cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel/"
# add headers for lirc package
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo; do # zc0301 - damaged
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video"
cp drivers/media/video/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/"
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
cp -a drivers/media/video/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
done
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
"${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
cp drivers/md/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
# add inotify.h
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/linux"
cp include/linux/inotify.h "${pkgdir}/usr/src/linux-${_kernver}/include/linux/"
# add wireless headers
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
cp net/mac80211/*.h "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
# add dvb headers for external modules
# in reference to:
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core"
cp drivers/media/dvb/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/"
# and...
# http://bugs.archlinux.org/task/11194
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
cp include/config/dvb/*.h "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
# add xfs and shmem for aufs building
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
# add headers for virtualbox
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
# add headers for broadcom wl
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
cp drivers/media/dvb/frontends/lgdt330x.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
cp drivers/media/video/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
# http://bugs.archlinux.org/task/20402
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb"
cp drivers/media/dvb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends"
cp drivers/media/dvb/frontends/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners"
cp drivers/media/common/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/"
# add xfs and shmem for aufs building
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/mm"
cp fs/xfs/xfs_sb.h "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h"
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
for i in `find . -name "Kconfig*"`; do
mkdir -p "${pkgdir}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
cp ${i} "${pkgdir}/usr/src/linux-${_kernver}/${i}"
done