1 # Maintainer: polslinux <admin@polslinux.it>
5 _kernelversion=2.6.39.3
9 pkgname=kernel26-bfs-eeepc1008
10 _bfspatchname="2.6.39-sched-bfs-${_bfsrel}.patch"
11 arch=('i686' 'x86_64')
12 pkgdesc="Linux kernel and modules with BFS scheduler for Eeepc 1008"
15 url="http://ck-hack.blogspot.com"
16 backup=(etc/mkinitcpio.d/${pkgname}.preset)
17 depends=('coreutils' 'module-init-tools' 'linux-firmware' 'mkinitcpio>=0.5.20')
18 optdepends=('crda: to set the correct wireless channels of your country')
19 # pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
20 # nforce package support was abandoned by nvidia, kernel modules should cover everything now.
21 # kernel24 support is dropped since glibc24
22 replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
23 'alsa-driver' 'ieee80211' 'hostap-driver26'
24 'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
25 'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
26 'gspcav1' 'atl2' 'wlan-ng26' 'aufs' 'rt2500')
27 install='kernel26.install'
28 source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${_kernelversion}.tar.bz2
29 config config.x86_64 # the main kernel config files
30 kernel26.preset # standard config files for mkinitcpio ramdisk
31 http://ck.kolivas.org/patches/bfs/${_basekernel}/${_bfspatchname} )
32 sha256sums=('324bd8bde3929be5d9c33e262d8ca197a45e7e2587b7c5703a7004d78901a8d3' # Linux kernel
33 '07769bf5bf84fedc10b1353a40f6de452aed978dbe2cabe4fe28904a47ceb309' # config
34 '07769bf5bf84fedc10b1353a40f6de452aed978dbe2cabe4fe28904a47ceb309' # config.x86_64
35 '789724a492184cbb2a04939fdf33db7ead5e0ab98bba197cc2a189c4d91d416e' # kernel26.preset
36 '19f05242cc4969c2d1348c88e5cc6948ff7fd5d778f4ca90d34b8b123a7f7a3f') # BFS patch
38 #provides=('kernel26-headers' "kernel26=$pkgver") # for when you have no other kernel
41 # don't think this line is needed anymore
42 #sed -i -e "s/+EXTRAVERSION = -bfs${_bfsrel}/+EXTRAVERSION =/" ${_bfspatchname}
44 cd ${srcdir}/linux-${_kernelversion}
47 patch -Np1 -i ${srcdir}/${_bfspatchname}
49 if [ "$CARCH" = "x86_64" ]; then
50 cat ../config.x86_64 >./.config
52 cat ../config >./.config
55 if [ "${_kernelname}" != "" ]; then
56 sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
62 # Configure the kernel. Replace the line below with one of your choice.
63 #make menuconfig # CLI menu for configuration
64 #make nconfig # new CLI menu for configuration
65 #make xconfig # X-based configuration
66 #make oldconfig # using old config from previous kernel version
67 # ... or manually edit .config
70 # this is useful to configure the kernel
77 make ${MAKEFLAGS} bzImage modules
82 cd ${srcdir}/linux-${_kernelversion}
83 _kernver="$(make kernelrelease)"
87 mkdir -p ${pkgdir}/{lib/modules,boot}
88 make INSTALL_MOD_PATH=${pkgdir} modules_install
90 cp System.map ${pkgdir}/boot/System.map26${_kernelname}
91 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
99 # set correct depmod command for install
101 -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
102 -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
103 -i ${startdir}/kernel26.install
105 -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
106 -e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
107 -e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
108 -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
110 echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
112 ### package_kernel26-headers
114 install -D -m644 Makefile \
115 ${pkgdir}/usr/src/linux-${_kernver}/Makefile
116 install -D -m644 kernel/Makefile \
117 ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
118 install -D -m644 .config \
119 ${pkgdir}/usr/src/linux-${_kernver}/.config
121 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
122 for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
123 cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
126 # copy arch includes for external modules
127 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
128 cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
130 # copy files necessary for later builds, like nvidia and vmware
131 cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
132 cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
134 # fix permissions on scripts dir
135 chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
137 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
138 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
140 cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
141 if [ "$CARCH" = "i686" ]; then
142 cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
144 cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
146 # add headers for lirc package
147 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
148 cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
149 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo; do
150 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
151 cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
154 # add docbook makefile
155 install -D -m644 Documentation/DocBook/Makefile \
156 ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
159 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
160 cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
163 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
164 cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
166 # add wireless headers
167 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
168 cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
170 # add dvb headers for external modules
172 # http://bugs.archlinux.org/task/9912
173 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
174 cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
176 # add dvb headers for external modules
178 # http://bugs.archlinux.org/task/11194
179 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
180 [[ -e include/config/dvb/ ]] && cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
182 # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
184 # http://bugs.archlinux.org/task/13146
185 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
186 cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
187 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/
199 # add xfs and shmem for aufs building
200 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
201 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
202 cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
204 # add headers for virtualbox
206 # http://bugs.archlinux.org/task/14568
207 cp -a include/drm ${pkgdir}/usr/src/linux-${_kernver}/include/
209 # add headers for broadcom wl
211 # http://bugs.archlinux.org/task/14568
212 cp -a include/trace ${pkgdir}/usr/src/linux-${_kernver}/include/
214 # copy in Kconfig files
215 for i in `find . -name "Kconfig*"`; do
216 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
217 cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
220 chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
221 find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
223 cd ${pkgdir}/lib/modules/${_kernver} && \
224 (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
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}
228 # remove the firmware
229 rm -rf ${pkgdir}/lib/firmware