updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / linux-one / PKGBUILD
blobeee3930034e215b832a1119c044e572b029d1464
1 # Maintainer: chris_L <chrislcenter dash mamoru at yahoo.com dot mx>
3 # Contributor: Manuel Gaul <inkaine (at) hotmail (dot) com>
4 # Contributor: Joao Rodrigues <gothicknight (at) gmail (dot) com>
5 # Original PKGBUILD: Andreas Radke <andyrtr (at) archlinux (dot) org>
7 pkgname=linux-one
8 _basekernel=3.2
9 pkgver=${_basekernel}.1
10 pkgrel=1
11 _kernelname=${pkgname#linux}
12 pkgdesc="The Linux Kernel for the Acer Aspire One A110L"
13 arch=('i686')
14 license=('GPL2')
15 url="http://www.kernel.org"
16 groups=(one)
17 depends=('coreutils' 'linux-firmware' 'module-init-tools')
18 makedepends=('gcc>=4.5')
19 provides=('kernel26-one')
20 conflicts=('kernel26-one')
21 replaces=('kernel26-one')
22 install=linux-one.install
23 source=(ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-$_basekernel.tar.bz2
24 ftp://ftp.kernel.org/pub/linux/kernel/v3.0/patch-${pkgver}.bz2
25 'config'
26 i915-fix-ghost-tv-output.patch
27 i915-gpu-finish.patch
28 change-default-console-loglevel.patch)
29 md5sums=('7ceb61f87c097fc17509844b71268935'
30          '31fc34340f11118873463a1d59d47b7f'
31          'e48827cd9edf7c06e61d5ce5d8bd3e09'
32          '263725f20c0b9eb9c353040792d644e5'
33          '4cd79aa147825837dc8bc9f6b736c0a0'
34          '9d3c56a4b999c8bfbd4018089a62f662')
36 build() {
37           # if the user hasn't set his makepkg.conf
38           export CFLAGS="-march=atom -Os -pipe -fomit-frame-pointer"
39           export CXXFLAGS="${CFLAGS}"
40           export MAKEFLAGS="-j3"
41           export CARCH="i686"
43           export KARCH="x86"
45           # get into the linux source directory and start some magic
46           cd ${srcdir}/linux-${_basekernel}
48           patch -p1 -i ${srcdir}/patch-${pkgver} || return 1
50           # fix FS#27883
51           # drm/i915: Only clear the GPU domains upon a successful finish
52           patch -Np1 -i "${srcdir}/i915-gpu-finish.patch"
53           # fix #19234 i1915 display size
54           patch -Np1 -i "${srcdir}/i915-fix-ghost-tv-output.patch"
56           # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
57           # remove this when a Kconfig knob is made available by upstream
58           # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
59           patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
61           # remove the extraversion from Makefile
62           sed -i 's|^EXTRAVERSION = .*$|EXTRAVERSION =|g' Makefile
64           echo load configuration
65           cp ../config ./.config
67           # set kernel version libpath to basekernel
68           . ./.config
69           make silentoldconfig
70           # Uncomment to configure the kernel!
71           # return 1
72           echo making the kernel!
73           make bzImage modules || return 1
76 package() {
77           cd ${srcdir}/linux-${_basekernel}
79           KARCH="x86"
81           # get kernel version
82           _kernver="$(make kernelrelease)"
84           mkdir -p ${pkgdir}/{lib/{firmware,modules},boot}
85           # install our modules
86           make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
87           # install the kernel
88           install -T System.map ${pkgdir}/boot/System.map${_kernelname}
89           install -T arch/x86/boot/bzImage ${pkgdir}/boot/vmlinuz${_kernelname}
91           # We need a decent /usr/src to build modules, so
93           install -D -m644 Makefile \
94                     ${pkgdir}/usr/src/linux-${_kernver}/Makefile
95           install -D -m644 kernel/Makefile \
96                     ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
97           install -D -m644 .config \
98                     ${pkgdir}/usr/src/linux-${_kernver}/.config
99           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
101           for i in acpi asm-generic config linux math-emu media net pcmcia scsi sound video; do
102                     cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
103           done
105           # copy files necessary for later builds, like nvidia and vmware
106           cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
107           cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
108           # fix permissions on scripts dir
109           chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
110           #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
112           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
114           cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
115           if [ "$CARCH" = "i686" ]; then
116                     cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
117           fi
118           cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
120           # add headers for lirc package
121           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
122           cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
123           for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 uvc; do
124                     mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
125                     cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
126           done
127           # add dm headers
128           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
129           cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
130           # add inotify.h
131           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
132           cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
133           # add CLUSTERIP file for iptables
134           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/ipv4/netfilter/
135           # add wireless headers
136           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
137           cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
138           # add dvb headers for external modules
139           # in reference to:
140           # http://bugs.archlinux.org/task/9912
141           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
142           cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
143           # add dvb headers for external modules
144           # in reference to:
145           # http://bugs.archlinux.org/task/11194
146           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux/dvb/
147           cp include/linux/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/dvb/
148           # add xfs and shmem for aufs building
149           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
150           mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
151           cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
152           # add vmlinux
153           cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
154           # copy in Kconfig files
155           for i in `find . -name "Kconfig*"`; do 
156                     mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
157                     cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
158           done
160           cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
162           chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
163           find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
164           cd ${pkgdir}/lib/modules/${_kernver} && \
165                     (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
167           # set correct depmod command for install
168           sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" $startdir/linux-one.install
170           # remove unneeded architectures
171           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} 
173           # remove build and source links
174           rm -f ${pkgdir}/lib/modules/${_kernver}/build
175           # remove the firmware
176           rm -rf ${pkgdir}/lib/firmware