2 # Maintainer: Thomas Dziedzic < gostrc at gmail >
3 # Contributor: Schnouki <thomas.jost@gmail.com>
4 # Contributor: Emmanuel GRAS <gras.emmanuel@gmail.com>
7 # pkgname=linux-custom # Build kernel with a different name
9 pkgver=${_basekernel}.1
11 pkgdesc="The Linux Kernel and modules source code."
12 arch=('i686' 'x86_64')
13 url="http://www.kernel.org/"
17 source=("http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.1.tar.xz"
18 "http://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
19 # the main kernel config files
20 'config' 'config.x86_64'
21 # standard config files for mkinitcpio ramdisk
23 'change-default-console-loglevel.patch'
24 'i915-fix-ghost-tv-output.patch'
25 'i915-fix-incorrect-error-message.patch'
26 'usb-add-reset-resume-quirk-for-several-webcams.patch')
27 md5sums=('edbdc798f23ae0f8045c82f6fa22c536'
28 '2bf7eb28a58238e1a062fa7393bf7824'
29 'cbaaa923f00c1935055273ccc1630144'
30 '93687a4b7e1e6bcd4e7417d6e5079bc4'
31 'eb14dcfd80c00852ef81ded6e826826a'
32 '9d3c56a4b999c8bfbd4018089a62f662'
33 '263725f20c0b9eb9c353040792d644e5'
34 'a50c9076012cb2dda49952dc6ec3e9c1'
35 '52d41fa61e80277ace2b994412a0c856')
38 cd "${srcdir}/linux-${_basekernel}"
41 patch -p1 -i "${srcdir}/patch-${pkgver}"
43 # add latest fixes from stable queue, if needed
44 # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
46 # Some chips detect a ghost TV output
47 # mailing list discussion: http://lists.freedesktop.org/archives/intel-gfx/2011-April/010371.html
48 # Arch Linux bug report: FS#19234
50 # It is unclear why this patch wasn't merged upstream, it was accepted,
51 # then dropped because the reasoning was unclear. However, it is clearly
53 patch -Np1 -i "${srcdir}/i915-fix-ghost-tv-output.patch"
55 # In 3.1.1, a DRM_DEBUG message is falsely declared as DRM_ERROR. This
56 # worries users, as this message is displayed even at loglevel 4. Fix
58 patch -Np1 -i "${srcdir}/i915-fix-incorrect-error-message.patch"
60 # Add the USB_QUIRK_RESET_RESUME for several webcams
62 patch -Np1 -i "${srcdir}/usb-add-reset-resume-quirk-for-several-webcams.patch"
64 # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
65 # remove this when a Kconfig knob is made available by upstream
66 # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
67 patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
69 if [ "${CARCH}" = "x86_64" ]; then
70 cat "${srcdir}/config.x86_64" > ./.config
72 cat "${srcdir}/config" > ./.config
75 if [ "${_kernelname}" != "" ]; then
76 sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
79 # set extraversion to pkgrel
80 sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
86 # Configure the kernel. Replace the line below with one of your choice.
87 #make menuconfig # CLI menu for configuration
88 #make nconfig # new CLI menu for configuration
89 #make xconfig # X-based configuration
90 #make oldconfig # using old config from previous kernel version
91 # ... or manually edit .config
95 # this is useful to configure the kernel
102 # Keep the source code
103 mkdir -p $pkgdir/usr/src
104 mv $srcdir/linux-$_basekernel $pkgdir/usr/src/linux-$_basekernel
106 # Add link from the modules directory
107 mkdir -p $pkgdir/lib/modules/$_kernver
108 cd $pkgdir/lib/modules/$_kernver
109 ln -s ../../../usr/src/linux-$_basekernel source