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>
9 pkgver=${_basekernel}.1
11 _kernelname=${pkgname#linux}
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 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
26 i915-fix-ghost-tv-output.patch
28 change-default-console-loglevel.patch)
29 md5sums=('7ceb61f87c097fc17509844b71268935'
30 '31fc34340f11118873463a1d59d47b7f'
31 'e48827cd9edf7c06e61d5ce5d8bd3e09'
32 '263725f20c0b9eb9c353040792d644e5'
33 '4cd79aa147825837dc8bc9f6b736c0a0'
34 '9d3c56a4b999c8bfbd4018089a62f662')
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"
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
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
70 # Uncomment to configure the kernel!
72 echo making the kernel!
73 make bzImage modules || return 1
77 cd ${srcdir}/linux-${_basekernel}
82 _kernver="$(make kernelrelease)"
84 mkdir -p ${pkgdir}/{lib/{firmware,modules},boot}
86 make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
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/
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/
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
128 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
129 cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
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
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
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
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
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