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}
14 url="http://www.kernel.org/"
18 pkgdesc="The Linux Kernel and modules with PaX patches"
20 depends=('paxctl' '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 ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-$pkgver.tar.bz2
30 http://grsecurity.net/test/pax-linux-$pkgver-$_paxver.patch
31 change-default-console-loglevel.patch
32 i915-fix-ghost-tv-output.patch
37 $pkgname-fix-permissions
40 7ceb61f87c097fc17509844b71268935
41 b9abf5eabb8f502d3b82910798e80bfa
42 9d3c56a4b999c8bfbd4018089a62f662
43 342071f852564e1ad03b79271a90b1a5
44 e9b3a1485b6bd10c9793732066fd9164
45 f26cdeeb12f10b251d20a777203b0afc
46 c792439f6f6c0dcedd1c71af63673d30
47 5d29c2995ffa1ac918dd6b269ec09ecc
48 d50670fac5d343d50e19ceb6e86dcd35
52 cd $srcdir/linux-$pkgver
54 # Some chips detect a ghost TV output
55 # mailing list discussion: http://lists.freedesktop.org/archives/intel-gfx/2011-April/010371.html
56 # Arch Linux bug report: FS#19234
58 # It is unclear why this patch wasn't merged upstream, it was accepted,
59 # then dropped because the reasoning was unclear. However, it is clearly
61 patch -Np1 -i "${srcdir}/i915-fix-ghost-tv-output.patch"
63 # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
64 # remove this when a Kconfig knob is made available by upstream
65 # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
66 patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
69 patch -Np1 -i $srcdir/pax-linux-$pkgver-$_paxver.patch
71 if [ "${CARCH}" = "x86_64" ]; then
72 cat "${srcdir}/config.x86_64" > ./.config
74 cat "${srcdir}/config" > ./.config
77 if [ "${_kernelname}" != "" ]; then
78 sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
81 # remove the sublevel from Makefile
82 # this ensures our kernel version is always 3.X-ARCH
83 # this way, minor kernel updates will not break external modules
84 # we need to change this soon, see FS#16702
85 sed -ri 's|^(SUBLEVEL =).*|\1|' Makefile
91 # Configure the kernel. Replace the line below with one of your choice.
92 # make menuconfig # CLI menu for configuration
93 #make nconfig # new CLI menu for configuration
94 #make xconfig # X-based configuration
95 #make oldconfig # using old config from previous kernel version
96 # ... or manually edit .config
100 # this is useful to configure the kernel
101 # msg "Stopping build"
108 make ${MAKEFLAGS} bzImage modules
112 cd $srcdir/linux-$pkgver
117 _kernver="$(make kernelrelease)"
119 mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
120 make INSTALL_MOD_PATH="${pkgdir}" modules_install
121 cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}"
124 install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux"
126 # install fallback mkinitcpio.conf file and preset file for kernel
127 install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
129 # set correct depmod command for install
131 -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
132 -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
133 -i "${startdir}/${pkgname}.install"
135 -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \
136 -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \
137 -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \
138 -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
140 # remove build and source links
141 rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
142 # remove the firmware
143 rm -rf "${pkgdir}/lib/firmware"
144 # gzip -9 all modules to safe 100MB of space
145 find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
146 # make room for external modules
147 ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
148 # add real version for building modules and running depmod from post_install/upgrade
149 mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
150 echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
152 install -D -m755 $srcdir/$pkgname-fix-permissions \
153 $pkgdir/usr/bin/$pkgname-fix-permissions