1 # Original kernel maintainers:
2 # Tobias Powalowski <tpowa@archlinux.org>
3 # Thomas Baechler <thomas@archlinux.org>
5 # henning mueller <henning@orgizm.net>
8 _kernelname=${pkgname#linux}
11 pkgver=${_basekernel}.1
14 url="http://www.kernel.org/"
18 pkgdesc="The Linux Kernel and modules with PaX patches"
20 depends=('linux-pax-flags' 'coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0.7')
21 optdepends=('crda: to set the correct wireless channels of your country')
22 provides=('kernel26-pax')
23 conflicts=('kernel26-pax')
24 replaces=('kernel26-pax')
25 backup=("etc/mkinitcpio.d/${pkgname}.preset")
26 install=$pkgname.install
29 [ ! -z $MENUCONFIG ] && _menuconfig=1
32 ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-$pkgver.tar.bz2
33 http://grsecurity.net/test/pax-linux-$pkgver-$_paxver.patch
34 change-default-console-loglevel.patch
35 i915-fix-ghost-tv-output.patch
43 090eb3dae0f520f7770f85193e931ad3
44 5af10730e2a535948b6a293db499ed71
45 9d3c56a4b999c8bfbd4018089a62f662
46 342071f852564e1ad03b79271a90b1a5
47 e787ef4bc66e2d9a7883eaece7a915b9
48 327e5eb7b07b474e0433cc0cca6f96a6
49 f1397e95d7f6e9f4180b8b16bbc49d52
50 42a358c6b1b83c391bde6babcaec8555
51 5d29c2995ffa1ac918dd6b269ec09ecc
55 cd $srcdir/linux-$pkgver
58 # drm/i915: Only clear the GPU domains upon a successful finish
59 patch -Np1 -i "${srcdir}/i915-gpu-finish.patch"
61 # Some chips detect a ghost TV output
62 # mailing list discussion: http://lists.freedesktop.org/archives/intel-gfx/2011-April/010371.html
63 # Arch Linux bug report: FS#19234
65 # It is unclear why this patch wasn't merged upstream, it was accepted,
66 # then dropped because the reasoning was unclear. However, it is clearly
68 patch -Np1 -i "${srcdir}/i915-fix-ghost-tv-output.patch"
70 # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
71 # remove this when a Kconfig knob is made available by upstream
72 # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
73 patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
76 patch -Np1 -i $srcdir/pax-linux-$pkgver-$_paxver.patch
78 if [ "${CARCH}" = "x86_64" ]; then
79 cat "${srcdir}/config.x86_64" > ./.config
81 cat "${srcdir}/config" > ./.config
84 if [ "${_kernelname}" != "" ]; then
85 sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
88 # remove the sublevel from Makefile
89 # this ensures our kernel version is always 3.X-ARCH
90 # this way, minor kernel updates will not break external modules
91 # we need to change this soon, see FS#16702
92 sed -ri 's|^(SUBLEVEL =).*|\1|' Makefile
95 [ "$_menuconfig" = "0" ] && {
100 # Configure the kernel. Replace the line below with one of your choice.
101 [ "$_menuconfig" = "1" ] && {
102 make menuconfig # CLI menu for configuration
103 #make nconfig # new CLI menu for configuration
104 #make xconfig # X-based configuration
105 #make oldconfig # using old config from previous kernel version
106 # ... or manually edit .config
111 # this is useful to configure the kernel
112 [ "$_menuconfig" = "1" ] && {
121 make ${MAKEFLAGS} bzImage modules
125 cd $srcdir/linux-$pkgver
130 _kernver="$(make kernelrelease)"
132 mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
133 make INSTALL_MOD_PATH="${pkgdir}" modules_install
134 cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}"
137 install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux"
139 # install fallback mkinitcpio.conf file and preset file for kernel
140 install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
142 # set correct depmod command for install
144 -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
145 -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
146 -i "${startdir}/${pkgname}.install"
148 -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \
149 -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \
150 -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \
151 -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
153 # remove build and source links
154 rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
155 # remove the firmware
156 rm -rf "${pkgdir}/lib/firmware"
157 # gzip -9 all modules to safe 100MB of space
158 find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
159 # make room for external modules
160 ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
161 # add real version for building modules and running depmod from post_install/upgrade
162 mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
163 echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"