1 # Maintainer: Manuel Gaul <inkaine (at) hotmail (dot) com>
2 # Contributor: Antti "Tera" Oja <antti.bofh@gmail.com>
4 pkgname=kernel26-one-dev
6 pkgver=${_basekernel}.1
8 _kernelname=${pkgname#kernel26}
10 _patchname="patch-${pkgver}-${_basepkgrel}-ARCH"
11 pkgdesc="The Linux Kernel instable development version for the Acer Aspire One A110L"
14 url="http://www.kernel.org"
16 depends=('coreutils' 'linux-firmware' 'module-init-tools')
17 makedepends=('gcc>=4.5')
18 install=kernel26-one-dev.install
19 source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
20 ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2
22 md5sums=('1aab7a741abe08d42e8eccf20de61e05'
23 '195dc2d9a79d497d81c0ae187cb679fb'
24 '12fa297a2d70bf286c5a4fec31492fb1')
27 # if the user hasn't set his makepkg.conf
28 export CFLAGS="-march=atom -Os -pipe -fomit-frame-pointer"
29 export CXXFLAGS="${CFLAGS}"
30 export MAKEFLAGS="-j3"
35 # get into the linux source directory and start some magic
36 cd ${srcdir}/linux-$_basekernel
39 # See http://projects.archlinux.org/git/?p=linux-2.6-ARCH.git;a=summary
40 patch -Np1 -i ${srcdir}/${_patchname} || return 1
42 # remove the extraversion from Makefile
43 sed -i 's|^EXTRAVERSION = .*$|EXTRAVERSION =|g' Makefile
45 echo load configuration
46 cp ../config ./.config
48 # set kernel version libpath to basekernel
50 export _kernver="${_basekernel}${CONFIG_LOCALVERSION}"
52 # Uncomment to configure the kernel!
54 echo making the kernel!
55 make bzImage modules || return 1
59 cd ${srcdir}/linux-${_basekernel}
61 mkdir -p ${pkgdir}/{lib/{firmware,modules},boot}
63 make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
65 install -T System.map ${pkgdir}/boot/System.map${_kernelname}
66 install -T arch/x86/boot/bzImage ${pkgdir}/boot/vmlinuz${_kernelname}
68 # We need a decent /usr/src to build modules, so
70 install -D -m644 Makefile \
71 ${pkgdir}/usr/src/linux-${_kernver}/Makefile
72 install -D -m644 kernel/Makefile \
73 ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
74 install -D -m644 .config \
75 ${pkgdir}/usr/src/linux-${_kernver}/.config
76 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
78 for i in acpi asm-generic config linux math-emu media net pcmcia scsi sound video; do
79 cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
82 # copy files necessary for later builds, like nvidia and vmware
83 cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
84 cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
85 # fix permissions on scripts dir
86 chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
87 #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
89 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
91 cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
92 if [ "$CARCH" = "i686" ]; then
93 cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
95 cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
97 # add headers for lirc package
98 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
99 cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
100 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 uvc; do
101 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
102 cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
105 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
106 cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
108 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
109 cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
110 # add CLUSTERIP file for iptables
111 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/ipv4/netfilter/
112 # add wireless headers
113 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
114 cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
115 # add dvb headers for external modules
117 # http://bugs.archlinux.org/task/9912
118 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
119 cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
120 # add dvb headers for external modules
122 # http://bugs.archlinux.org/task/11194
123 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux/dvb/
124 cp include/linux/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/dvb/
125 # add xfs and shmem for aufs building
126 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
127 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
128 cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
130 cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
131 # copy in Kconfig files
132 for i in `find . -name "Kconfig*"`; do
133 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
134 cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
137 cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
139 chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
140 find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
141 cd ${pkgdir}/lib/modules/${_kernver} && \
142 (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
144 # set correct depmod command for install
145 sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" $startdir/kernel26-one-dev.install
147 # remove unneeded architectures
148 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}
150 # remove build and source links
151 rm -f ${pkgdir}/lib/modules/${_kernver}/build
152 # remove the firmware
153 rm -rf ${pkgdir}/lib/firmware