1 # Maintainer: Manuel Gaul <inkaine (at) hotmail (dot) com>
3 # Former Maintainer: Joao Rodrigues <gothicknight (at) gmail (dot) com>
4 # Original PKGBUILD: Andreas Radke <andyrtr (at) archlinux (dot) org>
8 pkgver=${_basekernel}.3
11 _patchname="patch-${pkgver}-${_basepkgrel}-ARCH"
12 pkgdesc="The Linux Kernel for the Acer Aspire One A110L"
15 url="http://www.kernel.org"
17 depends=('coreutils' 'linux-firmware' 'module-init-tools')
18 makedepends=('gcc>=4.5')
19 install=kernel26-one.install
20 source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
21 ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2
23 md5sums=('1aab7a741abe08d42e8eccf20de61e05'
24 'b23d7def30e57242cfe088f4d8ca8baa'
25 '0fde25ee758c30f4bca9eb0115d419c0')
28 # if the user hasn't set his makepkg.conf
29 export CFLAGS="-march=atom -Os -pipe -fomit-frame-pointer"
30 export CXXFLAGS="${CFLAGS}"
31 export MAKEFLAGS="-j3"
36 # get into the linux source directory and start some magic
37 cd ${srcdir}/linux-$_basekernel
40 # See http://projects.archlinux.org/git/?p=linux-2.6-ARCH.git;a=summary
41 patch -Np1 -i ${srcdir}/${_patchname} || return 1
43 # remove the extraversion from Makefile
44 sed -i 's|^EXTRAVERSION = .*$|EXTRAVERSION =|g' Makefile
46 echo load configuration
47 cp ../config ./.config
49 # set kernel version libpath to basekernel
51 export _kernver="${_basekernel}${CONFIG_LOCALVERSION}"
53 echo making the kernel!
54 make bzImage modules || return 1
58 cd ${srcdir}/linux-$_basekernel
60 mkdir -p ${pkgdir}/{lib/{firmware,modules},boot}
62 make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
64 install -T System.map ${pkgdir}/boot/System.map${_kernelname}
65 install -T arch/x86/boot/bzImage ${pkgdir}/boot/vmlinuz${_kernelname}
67 # We need a decent /usr/src to build modules, so
69 install -D -m644 Makefile \
70 ${pkgdir}/usr/src/linux-${_kernver}/Makefile
71 install -D -m644 kernel/Makefile \
72 ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
73 install -D -m644 .config \
74 ${pkgdir}/usr/src/linux-${_kernver}/.config
75 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
77 for i in acpi asm-generic config linux math-emu media net pcmcia scsi sound video; do
78 cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
81 # copy files necessary for later builds, like nvidia and vmware
82 cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
83 cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
84 # fix permissions on scripts dir
85 chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
86 #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
88 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
90 cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
91 if [ "$CARCH" = "i686" ]; then
92 cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
94 cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
96 # add headers for lirc package
97 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
98 cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
99 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 uvc; do
100 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
101 cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
104 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
105 cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
107 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
108 cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
109 # add CLUSTERIP file for iptables
110 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/ipv4/netfilter/
111 # add wireless headers
112 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
113 cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
114 # add dvb headers for external modules
116 # http://bugs.archlinux.org/task/9912
117 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
118 cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
119 # add dvb headers for external modules
121 # http://bugs.archlinux.org/task/11194
122 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux/dvb/
123 cp include/linux/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/dvb/
124 # add xfs and shmem for aufs building
125 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
126 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
127 cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
129 cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
130 # copy in Kconfig files
131 for i in `find . -name "Kconfig*"`; do
132 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
133 cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
136 cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
138 chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
139 find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
140 cd ${pkgdir}/lib/modules/${_kernver} && \
141 (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
143 # set correct depmod command for install
144 sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" $startdir/kernel26-one.install
146 # remove unneeded architectures
147 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}
149 # remove build and source links
150 rm -f ${pkgdir}/lib/modules/${_kernver}/build
151 # remove the firmware
152 rm -rf ${pkgdir}/lib/firmware