1 # Maintainer: Robert McCathie <archstatic at rmcc dot com dot au>
2 # Contributor: Tobias Powalowski <tpowa@archlinux.org>
3 # Contributor: Thomas Baechler <thomas@archlinux.org>
4 pkgbase="kernel26-35-lts-arch"
5 pkgname=('kernel26-35-lts-arch' 'kernel26-35-lts-arch-headers')
6 _kernelname=${pkgname#kernel26}
8 pkgver=${_basekernel}.12
10 makedepends=('xmlto' 'docbook-xsl')
11 #_patchname="patch-${pkgver}-${pkgrel}-ARCH"
12 #_patchname="patch-${pkgver}-1-ARCH"
13 _patchname="patch-${_basekernel}-1-ARCH"
16 url="http://www.kernel.org"
17 source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/longterm/v$_basekernel/linux-$pkgver.tar.bz2
18 ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2
19 # the main kernel config files
21 # standard config files for mkinitcpio ramdisk
24 libata-alignment.patch)
25 md5sums=('cc9165deeb48ceeaab14ff5eb2f55cb6'
26 '0c6ce6d166a90bedd6aff7fb4b7f1103'
27 'f65a5e65af3a10dd245baacdc0c97f05'
28 '948598aa6b69854e96ba86180b357f43'
29 'ceb38003807a5aa1a00c8d4b9f028893'
30 '39c3d6445e907ae57a494bc4496bb44d')
32 cd ${srcdir}/linux-$pkgver
34 # See http://projects.archlinux.org/linux-2.6-ARCH.git/
35 patch -p1 -i ${srcdir}/${_patchname} || return 1
36 # Add udev issue patch
37 patch -p0 -i ${srcdir}/libata-alignment.patch || return 1
39 if [ "$CARCH" = "x86_64" ]; then
40 cat ../config.x86_64 >./.config
42 cat ../config >./.config
44 if [ "${_kernelname}" != "" ]; then
45 #sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
46 sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-LTS-ARCH\"|g" ./.config
51 # Configure the kernel. Replace the line below with one of your choice.
52 #make menuconfig # CLI menu for configuration
53 #make nconfig # new CLI menu for configuration
54 #make xconfig # X-based configuration
55 #make oldconfig # using old config from previous kernel version
56 # ... or manually edit .config
59 # this is useful to configure the kernel
65 make bzImage modules || return 1
68 package_kernel26-35-lts-arch() {
69 pkgdesc="The Linux Kernel and modules - 2.6.35 longterm support series"
71 backup=(etc/mkinitcpio.d/${pkgname}.preset)
72 depends=('coreutils' 'linux-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
73 # pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
74 # nforce package support was abandoned by nvidia, kernel modules should cover everything now.
75 # kernel24 support is dropped since glibc24
76 replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
77 'alsa-driver' 'ieee80211' 'hostap-driver26'
78 'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
79 'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
80 'gspcav1' 'atl2' 'wlan-ng26' 'rt2500' 'nouveau-drm')
81 install=kernel26.install
82 optdepends=('crda: to set the correct wireless channels of your country')
85 #cd ${srcdir}/linux-$_basekernel
86 cd ${srcdir}/linux-$pkgver
88 _kernver="$(make kernelrelease)"
89 mkdir -p ${pkgdir}/{lib/modules,boot}
90 make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
91 cp System.map ${pkgdir}/boot/System.map26${_kernelname}
92 cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
94 install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
96 # install fallback mkinitcpio.conf file and preset file for kernel
97 install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset || return 1
98 # set correct depmod command for install
100 -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
101 -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
102 -i $startdir/kernel26.install
104 -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
105 -e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
106 -e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
107 -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
109 echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
110 # remove build and source links
111 rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
112 # remove the firmware
113 rm -rf ${pkgdir}/lib/firmware
116 package_kernel26-35-lts-arch-headers() {
117 pkgdesc="Header files and scripts for building modules for kernel26-35-lts-arch"
118 mkdir -p ${pkgdir}/lib/modules/${_kernver}
119 cd ${pkgdir}/lib/modules/${_kernver}
120 ln -sf ../../../usr/src/linux-${_kernver} build
121 #cd ${srcdir}/linux-$_basekernel
122 cd ${srcdir}/linux-$pkgver
123 install -D -m644 Makefile \
124 ${pkgdir}/usr/src/linux-${_kernver}/Makefile
125 install -D -m644 kernel/Makefile \
126 ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
127 install -D -m644 .config \
128 ${pkgdir}/usr/src/linux-${_kernver}/.config
129 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
131 for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
132 cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
135 # copy arch includes for external modules
136 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
137 cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
139 # copy files necessary for later builds, like nvidia and vmware
140 cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
141 cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
142 # fix permissions on scripts dir
143 chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
144 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
146 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
148 cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
149 if [ "$CARCH" = "i686" ]; then
150 cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
152 cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
154 # add headers for lirc package
155 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
156 cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
157 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
158 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
159 cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
161 # add docbook makefile
162 install -D -m644 Documentation/DocBook/Makefile \
163 ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
165 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
166 cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
168 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
169 cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
170 # add wireless headers
171 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
172 cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
173 # add dvb headers for external modules
175 # http://bugs.archlinux.org/task/9912
176 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
177 cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
178 # add dvb headers for external modules
180 # http://bugs.archlinux.org/task/11194
181 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
182 cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
183 # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
185 # http://bugs.archlinux.org/task/13146
186 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
187 cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
188 cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
191 # http://bugs.archlinux.org/task/20402
192 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb
193 cp drivers/media/dvb/dvb-usb/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/
194 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
195 cp drivers/media/dvb/frontends/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
196 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners
197 cp drivers/media/common/tuners/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/
198 # add xfs and shmem for aufs building
199 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
200 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
201 cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
202 # add headers vor virtualbox
204 # http://bugs.archlinux.org/task/14568
205 cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
206 # add headers for broadcom wl
208 # http://bugs.archlinux.org/task/14568
209 cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
210 # copy in Kconfig files
211 for i in `find . -name "Kconfig*"`; do
212 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
213 cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
216 chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
217 find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
218 # remove unneeded architectures
219 rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
222 # workaround for AUR split package upload
223 pkgname=kernel26-35-lts-arch
224 pkgdesc="The Linux Kernel and modules - 2.6.35 longterm support series"