3 #pkgname=(linux-ac100 linux-ac100-headers)
4 _kernelname=${pkgname#linux}
9 url="http://www.kernel.org/"
11 makedepends=(xmlto docbook-xsl git lzop)
13 source=(linux-ac100.install
18 change-default-console-loglevel.patch)
20 _gitroot=https://gitorious.org/~marvin24/ac100/marvin24s-kernel/commits/chromeos-ac100-3.0-exp
21 _gitname=chromeos-ac100-3.0-exp
23 MAKEFLAGS="${MAKEFLAGS} ARCH=arm"
27 if [[ -d "$_gitname" ]]; then
33 git clone "$_gitroot" "$_gitname"
39 patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
40 patch -Np1 -i "${srcdir}/armdma.patch"
42 cat "${srcdir}/config" > ./.config
43 #cat "${srcdir}/$_gitname/arch/arm/configs/paz00_defconfig" > ./.config
45 sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
48 #make menuconfig # nconfig / xconfig / oldconfig
49 #cp ./.config ../config
51 make ${MAKEFLAGS} zImage modules
54 package_linux-ac100() {
55 pkgdesc="The Linux Kernel and modules - toshiba ac100 (tegra/paz00)"
56 depends=(coreutils linux-firmware 'module-init-tools>=3.16' 'mkinitcpio>=0.7' abootimg-git)
57 optdepends=('crda: to set the correct wireless channels of your country')
59 backup=("etc/mkinitcpio.d/${pkgname}.preset")
60 install=${pkgname}.install
62 cd "$srcdir/$_gitname"
65 _kernver="$(make ${MAKEFLAGS} kernelrelease)"
67 mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot/ac100}
68 make INSTALL_MOD_PATH="${pkgdir}" modules_install
69 cp arch/arm/boot/zImage $pkgdir/boot/ac100/
70 cp $srcdir/bootimg.cfg $pkgdir/boot/ac100/
72 # set correct depmod command for install
73 sed -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
74 -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
75 -i "${startdir}/${pkgname}.install"
77 # remove build and source links
78 rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
80 rm -rf "${pkgdir}/lib/firmware"
81 # gzip -9 all modules to safe 100MB of space
82 find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
83 # make room for external modules
84 #ln -s "../extramodules-${_basekernel}-${_kernelname:-ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
85 # add real version for building modules and running depmod from post_install/upgrade
86 #mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}-${_kernelname:-ARCH}"
87 #echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}-${_kernelname:-ARCH}/version"
88 install -D -m644 "$srcdir/$pkgname.preset" "$pkgdir/etc/mkinitcpio.d/$pkgname.preset"
89 sed -i "s/^ALL_kver=.*$/ALL_kver=$_kernver/" "$pkgdir/etc/mkinitcpio.d/$pkgname.preset"
92 package_linux-ac100-headers() {
93 pkgdesc="Header files and scripts for building modules for linux kernel - toshiba ac100 (tegra/paz00)"
94 provides=('linux-headers')
96 mkdir -p "${pkgdir}/lib/modules/${_kernver}"
98 cd "${pkgdir}/lib/modules/${_kernver}"
99 ln -sf ../../../usr/src/linux-${_kernver} build
101 cd "$srcdir/$_gitname"
102 install -D -m644 Makefile "${pkgdir}/usr/src/linux-${_kernver}/Makefile"
103 install -D -m644 kernel/Makefile "${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile"
104 install -D -m644 .config "${pkgdir}/usr/src/linux-${_kernver}/.config"
106 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include"
108 for i in acpi asm-generic config crypto drm generated linux math-emu \
109 media net pcmcia scsi sound trace video xen; do
110 cp -a include/${i} "${pkgdir}/usr/src/linux-${_kernver}/include/"
113 # copy arch includes for external modules
114 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/arm
115 cp -a arch/arm/include ${pkgdir}/usr/src/linux-${_kernver}/arch/arm/
116 mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/arm/mach-tegra
117 cp -a arch/arm/mach-tegra/include ${pkgdir}/usr/src/linux-${_kernver}/arch/arm/mach-tegra/
119 # copy files necessary for later builds, like nvidia and vmware
120 cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}"
121 cp -a scripts "${pkgdir}/usr/src/linux-${_kernver}"
123 # fix permissions on scripts dir
124 chmod og-w -R "${pkgdir}/usr/src/linux-${_kernver}/scripts"
125 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions"
127 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/arm/kernel"
129 cp arch/arm/Makefile "${pkgdir}/usr/src/linux-${_kernver}/arch/arm/"
131 cp arch/arm/kernel/asm-offsets.s "${pkgdir}/usr/src/linux-${_kernver}/arch/arm/kernel/"
133 # add headers for lirc package
134 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video"
136 cp drivers/media/video/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/"
138 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
139 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
140 cp -a drivers/media/video/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
143 # add docbook makefile
144 install -D -m644 Documentation/DocBook/Makefile \
145 "${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
148 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
149 cp drivers/md/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
152 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/linux"
153 cp include/linux/inotify.h "${pkgdir}/usr/src/linux-${_kernver}/include/linux/"
155 # add wireless headers
156 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
157 cp net/mac80211/*.h "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
159 # add dvb headers for external modules
161 # http://bugs.archlinux.org/task/9912
162 #mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core"
163 #cp drivers/media/dvb/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/"
165 # http://bugs.archlinux.org/task/11194
166 #mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
167 #cp include/config/dvb/*.h "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
169 # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
171 # http://bugs.archlinux.org/task/13146
172 #mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
173 #cp drivers/media/dvb/frontends/lgdt330x.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
174 #cp drivers/media/video/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
178 # http://bugs.archlinux.org/task/20402
179 #mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb"
180 #cp drivers/media/dvb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/"
181 #mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends"
182 #cp drivers/media/dvb/frontends/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
183 #mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners"
184 #cp drivers/media/common/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/"
186 # add xfs and shmem for aufs building
187 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs"
188 mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/mm"
189 cp fs/xfs/xfs_sb.h "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h"
191 # copy in Kconfig files
192 for i in `find . -name "Kconfig*"`; do
193 mkdir -p "${pkgdir}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
194 cp ${i} "${pkgdir}/usr/src/linux-${_kernver}/${i}"
197 chown -R root.root "${pkgdir}/usr/src/linux-${_kernver}"
198 find "${pkgdir}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
200 # strip scripts directory
201 find "${pkgdir}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
202 case "$(file -bi "${binary}")" in
203 *application/x-sharedlib*) # Libraries (.so)
204 /usr/bin/strip ${STRIP_SHARED} "${binary}";;
205 *application/x-archive*) # Libraries (.a)
206 /usr/bin/strip ${STRIP_STATIC} "${binary}";;
207 *application/x-executable*) # Binaries
208 /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
212 # remove unneeded architectures
213 rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,x86,xtensa}
216 md5sums=('a410d4de0f3a0fba164a9046ddfdb0eb'
217 '8ab9596a6c1f08548a1580a3511437dc'
218 '21a2561abad495d7dde05b0bb9cf231c'
219 '6e7667c6c6348bfeca22eaaa05462d62'
220 '1c757e5c4457b6cfea52eba09a19721a'
221 '9d3c56a4b999c8bfbd4018089a62f662')