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}
7 pkgver=${_basekernel}.3
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"
18 url="http://www.kernel.org"
20 source=("ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2"
21 "ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2"
24 "kernel26-server.preset"
26 "${_bfqpath}/${_bfqpatch1}"
27 "${_bfqpath}/${_bfqpatch2}"
28 "${_bfqpath}/${_bfqpatch3}"
32 cd ${srcdir}/linux-$_basekernel
34 # See http://projects.archlinux.org/linux-2.6-ARCH.git/
35 patch -Np1 -i ${srcdir}/${_patchname}
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
45 cat ../config >./.config
47 if [ "${_kernelname}" != "" ]; then
48 sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
55 make ${MAKEFLAGS} bzImage modules
58 package_kernel26-server() {
59 pkgdesc="The Linux Kernel and modules"
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')
75 cd ${srcdir}/linux-$_basekernel
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}
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
90 -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
91 -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
92 -i $startdir/kernel26-server.install
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'