1 # Maintainer: Mikael Eriksson <mikael_eriksson@miffe.org>
2 # Original maintainers:
3 # Maintainer: Tobias Powalowski <tpowa@archlinux.org>
4 # Maintainer: Thomas Baechler <thomas@archlinux.org>
6 #pkgname=('kernel26' 'kernel26-headers' 'kernel26-docs') # Build stock -ARCH kernel
7 pkgname=kernel26-helium0 # Build kernel with a different name
8 _kernelname=${pkgname#kernel26}
12 makedepends=('xmlto' 'docbook-xsl')
13 #_patchname="patch-${pkgver}-${pkgrel}-ARCH"
14 _patchname="${pkgver}-helium0"
17 url="http://www.kernel.org"
19 source=(http://www.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
20 # the main kernel config files
22 # standard config files for mkinitcpio ramdisk
24 http://hirakendu.mooo.com/helium-sources/${_patchname}/${_patchname}.patch.bz2)
25 install=kernel26.install
29 cd ${srcdir}/linux-$_basekernel
31 # See http://projects.archlinux.org/linux-2.6-ARCH.git/
32 #patch -Np1 -i ${srcdir}/${_patchname}
33 bzip2 -dc ${_patchname}.patch.bz2 | patch -Np1 -i ${srcdir}/${_patchname}.patch
34 if [ "$CARCH" = "x86_64" ]; then
35 cat ../config.x86_64 >./.config
37 cat ../config >./.config
40 sed -i 's|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|' .config
41 if [ "${_kernelname}" != "" ]; then
42 sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
44 sed -i "s|/sbin/lsmod|/bin/lsmod|" scripts/kconfig/streamline_config.pl # Fix localmodconfig
46 # Configure the kernel. Replace the line below with one of your choice.
47 #make localmodconfig # Configure automaticly for the local machine
48 #make menuconfig # CLI menu for configuration
49 #make nconfig # new CLI menu for configuration
50 make xconfig # X-based configuration, needs qt3 to be installed
51 #make gconfig # GTK based configuration, needs gtk2 to be installed
52 #make oldconfig # using old config from previous kernel version
53 #yes ""|make oldconfig # lazy version of the above
54 # ... or manually edit .config
57 # this is useful to configure the kernel
63 make ${MAKEFLAGS} bzImage modules
65 package_kernel26-headers
69 pkgdesc="The Linux Kernel and modules (mainline)"
71 backup=(etc/mkinitcpio.d/${pkgname}.preset)
72 depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.12-2' 'mkinitcpio>=0.6.8-2')
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
88 _kernver="$(make kernelrelease)"
89 mkdir -p ${pkgdir}/{lib/modules,lib/firmware,boot}
90 make INSTALL_MOD_PATH=${pkgdir} modules_install
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
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
114 # gzip -9 all modules to safe 100MB of space
115 find "$pkgdir" -name '*.ko' -exec gzip -9 {} \;
118 package_kernel26-headers() {
119 #pkgdesc="Header files and scripts for building modules for kernel26"
121 mkdir -p ${pkgdir}/lib/modules/${_kernver}
122 cd ${pkgdir}/lib/modules/${_kernver}
123 ln -sf ../../../usr/src/linux-${_kernver} build
124 cd ${srcdir}/linux-$_basekernel
125 install -D -m644 Makefile \
126 ${pkgdir}/usr/src/linux-${_kernver}/Makefile
127 install -D -m644 kernel/Makefile \
128 ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
129 install -D -m644 .config \
130 ${pkgdir}/usr/src/linux-${_kernver}/.config
131 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
133 for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video xen; do
134 cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
137 # copy arch includes for external modules
138 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
139 cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
141 # copy files necessary for later builds, like nvidia and vmware
142 cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
143 cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
144 # fix permissions on scripts dir
145 chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
146 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
148 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
150 cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
151 if [ "$CARCH" = "i686" ]; then
152 cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
154 cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
156 # add headers for lirc package
157 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
158 cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
159 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
160 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
161 cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
163 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/staging/usbvideo/
164 cp -a drivers/staging/usbvideo/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/staging/usbvideo/
165 # add docbook makefile
166 install -D -m644 Documentation/DocBook/Makefile \
167 ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
169 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
170 cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
172 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
173 cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
174 # add wireless headers
175 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
176 cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
177 # add dvb headers for external modules
179 # http://bugs.archlinux.org/task/9912
180 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
181 cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
182 # add dvb headers for external modules
184 # http://bugs.archlinux.org/task/11194
185 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
186 cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
187 # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
189 # http://bugs.archlinux.org/task/13146
190 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
191 cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
192 cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
195 # http://bugs.archlinux.org/task/20402
196 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb
197 cp drivers/media/dvb/dvb-usb/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/
198 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
199 cp drivers/media/dvb/frontends/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
200 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners
201 cp drivers/media/common/tuners/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/
202 # add xfs and shmem for aufs building
203 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
204 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
205 cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
206 # add headers vor virtualbox
208 # http://bugs.archlinux.org/task/14568
209 cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
210 # add headers for broadcom wl
212 # http://bugs.archlinux.org/task/14568
213 cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
214 # add headers for crypto modules
216 # http://bugs.archlinux.org/task/22081
217 cp -a include/crypto $pkgdir/usr/src/linux-${_kernver}/include/
218 # copy in Kconfig files
219 for i in `find . -name "Kconfig*"`; do
220 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
221 cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
224 chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
225 find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
226 # remove unneeded architectures
227 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}
230 package_kernel26-docs() {
231 #pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel."
233 cd ${srcdir}/linux-$_basekernel
234 mkdir -p $pkgdir/usr/src/linux-$_kernver
235 mv Documentation $pkgdir/usr/src/linux-$_kernver
236 find $pkgdir -type f -exec chmod 444 {} \;
237 find $pkgdir -type d -exec chmod 755 {} \;
238 # remove a file already in kernel26 package
239 rm -f $pkgdir/usr/src/linux-$_kernver/Documentation/DocBook/Makefile
242 # vim:set ts=2 sw=2 et:
244 md5sums=('1aab7a741abe08d42e8eccf20de61e05'
245 'c8652799d6ce2c68576710eed4abe7df'
246 'a3414ad0ca13675d1ea3875e38b60ed6'
247 '464e3111b386a10c6cd7e7be0a655832'
248 '37bdb82ae308b9f31815c1df5eeee764')