updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / kernel26-server / PKGBUILD
blob5f2812b26d7fe5f8d793642685416ef2a4be6d04
1 # $Id: PKGBUILD 123802 2011-05-26 07:58:16Z scandic $
2 # Maintainer: Patrick Ernst <scandic@rootblog.org>
3 pkgbase="kernel26-server"
4 pkgname=('kernel26-server')
5 _kernelname=${pkgname#kernel26}
6 _basekernel=2.6.39
7 pkgver=${_basekernel}.3
8 pkgrel=1
9 makedepends=('xmlto' 'docbook-xsl')
10 #_patchname="patch-${pkgver}-${pkgrel}-ARCH"
11 _patchname="patch-${pkgver}-${pkgrel}-ARCH"
12 _bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/${_basekernel}"
13 _bfqpatch1="0001-block-prepare-I-O-context-code-for-BFQ-v2-for-${_basekernel}.patch"
14 _bfqpatch2="0002-block-cgroups-kconfig-build-bits-for-BFQ-v2-${_basekernel}.patch"
15 _bfqpatch3="0003-block-introduce-the-BFQ-v2-I-O-sched-for-${_basekernel}.patch"
16 arch=(i686 x86_64)
17 license=('GPL2')
18 url="http://www.kernel.org"
19 options=(!strip)
20 source=("ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2"
21         "ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2"
22         "config"
23         "config.x86_64"
24         "kernel26-server.preset"
25         "98-ib.rules"
26         "${_bfqpath}/${_bfqpatch1}"
27         "${_bfqpath}/${_bfqpatch2}"
28         "${_bfqpath}/${_bfqpatch3}"
29         )
31 build() {
32   cd ${srcdir}/linux-$_basekernel
33   # Add -ARCH patches
34   # See http://projects.archlinux.org/linux-2.6-ARCH.git/
35   patch -Np1 -i ${srcdir}/${_patchname}
37   # Add BFQ patches
38   patch -Np1 -i "${srcdir}/${_bfqpatch1}"
39   patch -Np1 -i "${srcdir}/${_bfqpatch2}"
40   patch -Np1 -i "${srcdir}/${_bfqpatch3}"
42   if [ "$CARCH" = "x86_64" ]; then
43     cat ../config.x86_64 >./.config
44   else
45     cat ../config >./.config
46   fi
47   if [ "${_kernelname}" != "" ]; then
48     sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
49   fi
50   # get kernel version  
51   make prepare
52   # load configuration
53   yes "" | make config
54   # build!
55   make ${MAKEFLAGS} bzImage modules
58 package_kernel26-server() {
59   pkgdesc="The Linux Kernel and modules"
60   groups=('base')
61   backup=(etc/mkinitcpio.d/${pkgname}.preset)
62   depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.12-2' 'mkinitcpio>=0.6.8-2')
63   # pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
64   # nforce package support was abandoned by nvidia, kernel modules should cover everything now.
65   # kernel24 support is dropped since glibc24
66   replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
67             'alsa-driver' 'ieee80211' 'hostap-driver26'
68             'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
69             'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
70             'gspcav1' 'atl2' 'wlan-ng26' 'rt2500' 'nouveau-drm')
71   install=kernel26-server.install
72   optdepends=('crda: to set the correct wireless channels of your country')
74   KARCH=x86
75   cd ${srcdir}/linux-$_basekernel
76   # get kernel version
77   _kernver="$(make kernelrelease)"
78   mkdir -p ${pkgdir}/{lib/modules,lib/udev/rules.d,lib/firmware,boot}
79   cp ${srcdir}/../98-ib.rules ${pkgdir}/lib/udev/rules.d/
80   make INSTALL_MOD_PATH=${pkgdir} modules_install
81   cp System.map ${pkgdir}/boot/System.map26${_kernelname}
82   cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
83   #  # add vmlinux
84   install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
86   # install fallback mkinitcpio.conf file and preset file for kernel
87   install -m644 -D ${srcdir}/kernel26-server.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
88   # set correct depmod command for install
89   sed \
90     -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
91     -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
92     -i $startdir/kernel26-server.install
93   sed \
94     -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
95     -e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
96     -e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
97     -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
99   echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
100   # remove build and source links
101   rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
102   # remove the firmware
103   rm -rf ${pkgdir}/lib/firmware
104   # gzip -9 all modules to safe 100MB of space
105   find "$pkgdir" -name '*.ko' -exec gzip -9 {} \;
108 md5sums=('1aab7a741abe08d42e8eccf20de61e05'
109          'b23d7def30e57242cfe088f4d8ca8baa'
110          'df118d229a1904c435bcb762863d66a2'
111          '5632b41580ed21afb8ff66e8967e46f8'
112          '3b309d7cc2afb2658ad0905026351afe'
113          '4e0898c18062dd9f4d4cae9dd23212e7'
114          '199921265a39fbe7e8370c6432548ec3'
115          'f71db44b8aabf407c7ea9591b6ba2488'
116          'cbae3fd91c29e692fb19488dedc4f9db'
117         )