1 pkgname=kernel26-web100
3 pkgver=${_basekernel}.4
5 _web100rel=200906151113
7 _patchname="patch-${pkgver}-${pkgrel}-ARCH"
8 pkgdesc="The Linux Kernel and modules with Web100 patches"
12 url="http://www.web100.org"
13 backup=(etc/mkinitcpio.d/kernel26.preset)
14 depends=('coreutils' 'kernel26-firmware>=2.6.30' 'module-init-tools' 'mkinitcpio>=0.5.20')
15 # pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
16 # nforce package support was abandoned by nvidia, kernel modules should cover everything now.
17 # kernel24 support is dropped since glibc24
18 replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
19 'alsa-driver' 'ieee80211' 'hostap-driver26'
20 'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
21 'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
22 'gspcav1' 'atl2' 'wlan-ng26' 'aufs' 'rt2500')
24 install=kernel26.install
25 source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
26 ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2
27 # the main kernel config files
29 # standard config files for mkinitcpio ramdisk
31 http://www.web100.org/download/kernel/${_web100ver}/web100-${_web100ver}-${_web100rel}.tar.gz)
32 optdepends=('crda: to set the correct wireless channels of your country'
33 'web100-utils: for userland utilities')
34 md5sums=('7a80058a6382e5108cdb5554d1609615'
35 'c819d48ba2d3940ee921c799fcb9253c'
36 '625a0021bcb21f9f29c94ca3559a459b'
37 '5a442c8c1101a4028c3377a03a3a2b26'
38 '25584700a0a679542929c4bed31433b6'
39 'f44b9179698e37806e907d93fd1ae682')
44 cd ${srcdir}/linux-$_basekernel
46 # See http://projects.archlinux.org/git/?p=linux-2.6-ARCH.git;a=summary
47 patch -Np1 -i ${srcdir}/${_patchname} || return 1
49 # Weird change of Arch's patch...
50 sed -i 's/EXTRAVERSION = /EXTRAVERSION =/' Makefile
53 patch -Np1 -i $srcdir/web100/web100-${_basekernel}-${_web100ver}-${_web100rel}.patch || return 1
55 # Use empty extravesrion, so "normal" module packages would match.
56 # Web100 shouldn't make them incompatible, but I'm not sure ;)
57 # Lets make it this way for now
58 sed -i 's/EXTRAVERSION = -web100/EXTRAVERSION =/' Makefile
60 if [ "$CARCH" = "x86_64" ]; then
61 cat ../config.x86_64 >./.config
63 cat ../config >./.config
66 if [ "${_kernelname}" != "" ]; then
67 sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
71 _kernver="$(make kernelrelease)"
73 # Configure the kernel. Replace the line below with one of your choice.
74 #make menuconfig # CLI menu for configuration
75 #make xconfig # X-based configuration
76 #make oldconfig # using old config from previous kernel version
77 # ... or manually edit .config
80 # this is useful to configure the kernel
86 make bzImage modules || return 1
87 mkdir -p ${pkgdir}/{lib/modules,boot}
88 make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
89 cp System.map ${pkgdir}/boot/System.map26${_kernelname}
90 cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
91 install -D -m644 Makefile \
92 ${pkgdir}/usr/src/linux-${_kernver}/Makefile
93 install -D -m644 kernel/Makefile \
94 ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
95 install -D -m644 .config \
96 ${pkgdir}/usr/src/linux-${_kernver}/.config
97 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
99 for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound trace video; do
100 cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
103 # copy arch includes for external modules
104 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
105 cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
107 # copy files necessary for later builds, like nvidia and vmware
108 cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
109 cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
110 # fix permissions on scripts dir
111 chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
112 #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
114 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
116 cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
117 if [ "$CARCH" = "i686" ]; then
118 cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
120 cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
122 # add headers for lirc package
123 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
124 cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
125 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
126 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
127 cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
129 # add docbook makefile
130 install -D -m644 Documentation/DocBook/Makefile \
131 ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
133 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
134 cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
136 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
137 cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
138 # add wireless headers
139 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
140 cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
141 # add dvb headers for external modules
143 # http://bugs.archlinux.org/task/9912
144 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
145 cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
146 # add dvb headers for external modules
148 # http://bugs.archlinux.org/task/11194
149 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
150 cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
151 # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
153 # http://bugs.archlinux.org/task/13146
154 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
155 cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
156 cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
157 # add xfs and shmem for aufs building
158 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
159 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
160 cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
161 # add headers vor virtualbox
163 # http://bugs.archlinux.org/task/14568
164 cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
165 # add headers for broadcom wl
167 # http://bugs.archlinux.org/task/14568
168 cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
170 cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
171 # copy in Kconfig files
172 for i in `find . -name "Kconfig*"`; do
173 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
174 cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
177 cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
179 chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
180 find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
181 cd ${pkgdir}/lib/modules/${_kernver} && \
182 (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
183 # install fallback mkinitcpio.conf file and preset file for kernel
184 install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/kernel26.preset || return 1
185 # set correct depmod command for install
187 -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
188 -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
189 -i $startdir/kernel26.install
191 -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
192 -e "s|default_image=.*|default_image=\"/boot/kernel26.img\"|g" \
193 -e "s|fallback_image=.*|fallback_image=\"/boot/kernel26-fallback.img\"|g" \
194 -i ${pkgdir}/etc/mkinitcpio.d/kernel26.preset
196 echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${startdir}/pkg/etc/mkinitcpio.d/kernel26.kver
197 # remove unneeded architectures
198 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}
199 # remove the firmware
200 rm -rf ${pkgdir}/lib/firmware