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}.8
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
27 i915-fix-incorrect-error-message.patch
28 change-default-console-loglevel.patch)
29 md5sums=('8d43453f8159b2332ad410b19d86a931'
30 '54fac8e4b0b55201e012ef0337a6cc87'
31 '1ec40fb4fe7a74d5c49bd5924d8d8144'
32 '263725f20c0b9eb9c353040792d644e5'
33 'a50c9076012cb2dda49952dc6ec3e9c1'
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
50 # fix #19234 i1915 display size
51 patch -Np1 -i "${srcdir}/i915-fix-ghost-tv-output.patch"
53 # In 3.1.1, a DRM_DEBUG message is falsely declared as DRM_ERROR. This
54 # worries users, as this message is displayed even at loglevel 4. Fix
56 patch -Np1 -i "${srcdir}/i915-fix-incorrect-error-message.patch"
59 # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
60 # remove this when a Kconfig knob is made available by upstream
61 # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
62 patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
64 # remove the extraversion from Makefile
65 sed -i 's|^EXTRAVERSION = .*$|EXTRAVERSION =|g' Makefile
67 echo load configuration
68 cp ../config ./.config
70 # set kernel version libpath to basekernel
73 # Uncomment to configure the kernel!
75 echo making the kernel!
76 make bzImage modules || return 1
80 cd ${srcdir}/linux-${_basekernel}
85 _kernver="$(make kernelrelease)"
87 mkdir -p ${pkgdir}/{lib/{firmware,modules},boot}
89 make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
91 install -T System.map ${pkgdir}/boot/System.map${_kernelname}
92 install -T arch/x86/boot/bzImage ${pkgdir}/boot/vmlinuz${_kernelname}
94 # We need a decent /usr/src to build modules, so
96 install -D -m644 Makefile \
97 ${pkgdir}/usr/src/linux-${_kernver}/Makefile
98 install -D -m644 kernel/Makefile \
99 ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
100 install -D -m644 .config \
101 ${pkgdir}/usr/src/linux-${_kernver}/.config
102 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
104 for i in acpi asm-generic config linux math-emu media net pcmcia scsi sound video; do
105 cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
108 # copy files necessary for later builds, like nvidia and vmware
109 cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
110 cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
111 # fix permissions on scripts dir
112 chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
113 #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
115 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
117 cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
118 if [ "$CARCH" = "i686" ]; then
119 cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
121 cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
123 # add headers for lirc package
124 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
125 cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
126 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 uvc; do
127 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
128 cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
131 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
132 cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
134 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
135 cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
136 # add CLUSTERIP file for iptables
137 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/ipv4/netfilter/
138 # add wireless headers
139 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
140 cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
141 # add dvb headers for external modules
143 # http://bugs.archlinux.org/task/9912
144 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
145 cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
146 # add dvb headers for external modules
148 # http://bugs.archlinux.org/task/11194
149 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux/dvb/
150 cp include/linux/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/dvb/
151 # add xfs and shmem for aufs building
152 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
153 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
154 cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
156 cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
157 # copy in Kconfig files
158 for i in `find . -name "Kconfig*"`; do
159 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
160 cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
163 cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
165 chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
166 find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
167 cd ${pkgdir}/lib/modules/${_kernver} && \
168 (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
170 # set correct depmod command for install
171 sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" $startdir/linux-one.install
173 # remove unneeded architectures
174 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}
176 # remove build and source links
177 rm -f ${pkgdir}/lib/modules/${_kernver}/build
178 # remove the firmware
179 rm -rf ${pkgdir}/lib/firmware