2 # Maintainer: Blind <x15@gmx.net>
3 pkgname=kernel26-eee901
4 _kernelname=${pkgname#kernel26}
9 _patchname="patch-${pkgver}${_level}"
10 pkgdesc="The Linux Kernel and modules"
14 url="http://www.kernel.org"
15 backup=(etc/mkinitcpio.d/${pkgname}.preset)
16 depends=('coreutils' 'module-init-tools' 'mkinitcpio>=0.5.20')
17 # Firmwares are provided by stock package
18 if [ "${_kernelname}" != "" ]; then
19 depends=(${depends[*]} 'kernel26-firmware')
21 # pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
22 # nforce package support was abandoned by nvidia, kernel modules should cover everything now.
23 # kernel24 support is dropped since glibc24
24 replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
25 'alsa-driver' 'ieee80211' 'hostap-driver26'
26 'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
27 'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
28 'gspcav1' 'atl2' 'wlan-ng26')
29 install=${pkgname}.install
30 source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${_basekernel}.tar.bz2
31 ftp://ftp.kernel.org/pub/linux/kernel/v2.6/testing/${_patchname}.bz2
32 http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-05-staging-${pkgver}${_level}.patch
33 # the main kernel config files
35 # standard config files for mkinitcpio ramdisk
37 optdepends=('crda: to set the correct wireless channels of your country')
43 cd ${srcdir}/linux-${_basekernel}
46 patch -Np1 -i ${srcdir}/${_patchname} || return 1
48 # Add latest staging driver patches
49 patch -u -p1 -i ${srcdir}/gregkh-05-staging-${pkgver}${_level}.patch || return 1
52 cat ../config >./.config
54 if [ "${_kernelname}" != "" ]; then
55 sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
59 _kernver="$(make kernelrelease)"
65 # this is useful to configure the kernel
69 make bzImage modules || return 1
70 mkdir -p ${pkgdir}/{lib/modules,boot}
71 make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
72 cp System.map ${pkgdir}/boot/System.map26${_kernelname}
73 cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
74 cp .config ${pkgdir}/boot/config${_kernelname}
75 install -D -m644 Makefile \
76 ${pkgdir}/usr/src/linux-${_kernver}/Makefile
77 install -D -m644 kernel/Makefile \
78 ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
79 install -D -m644 .config \
80 ${pkgdir}/usr/src/linux-${_kernver}/.config
81 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
83 for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound video; do
84 cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
87 # copy arch includes for external modules
88 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
89 cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
91 # copy files necessary for later builds, like nvidia and vmware
92 cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
93 cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
94 # fix permissions on scripts dir
95 chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
96 #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
98 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
100 cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
101 if [ "$CARCH" = "i686" ]; then
102 cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
104 cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
106 # add headers for lirc package
107 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
108 cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
109 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
110 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
111 cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
114 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
115 cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
117 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
118 cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
119 # add CLUSTERIP file for iptables
120 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/ipv4/netfilter/
121 # add wireless headers
122 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
123 cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
124 # add dvb headers for external modules
126 # http://bugs.archlinux.org/task/9912
127 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
128 cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
129 # add dvb headers for external modules
131 # http://bugs.archlinux.org/task/11194
132 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
133 cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
134 # add xfs and shmem for aufs building
135 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
136 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
137 cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
139 cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
140 # copy in Kconfig files
141 for i in `find . -name "Kconfig*"`; do
142 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
143 cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
146 cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
148 chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
149 find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
150 cd ${pkgdir}/lib/modules/${_kernver} && \
151 (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
152 # install fallback mkinitcpio.conf file and preset file for kernel
153 install -m644 -D ${srcdir}/${pkgname}.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset || return 1
154 # set correct depmod command for install
156 -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
157 -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
158 -i $startdir/${pkgname}.install
160 -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
161 -e "s/ALL_kver=.*/ALL_kver=${_kernver}/g" \
162 -e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
163 -e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
164 -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
166 echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${startdir}/pkg/etc/mkinitcpio.d/${pkgname}.kver
167 # remove unneeded architectures
168 rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
170 # Firmawares are provided by stock package
171 if [ "${_kernelname}" != "" ]; then
172 rm -fr ${pkgdir}/lib/firmware