2012-07-14 19:11:41 +00:00
|
|
|
# Contributor: Kiril Zyapkov <kiril.zyapkov@gmail.com>
|
|
|
|
|
|
|
|
# iMX233-OLinuXino-Maxi kernel for archlinuxarm
|
|
|
|
# basically replicates the oe-recipe
|
|
|
|
# see https://github.com/OSSystems/meta-fsl-arm-extra.git
|
|
|
|
# vim:set ts=2 sw=2 et:
|
|
|
|
|
2012-07-14 21:54:20 +00:00
|
|
|
buildarch=2
|
2012-07-14 19:11:41 +00:00
|
|
|
|
2012-07-17 00:31:00 +00:00
|
|
|
pkgbase="kernel26-olinuxino"
|
2012-09-21 15:39:48 +00:00
|
|
|
pkgname=('kernel26-olinuxino' 'kernel26-headers-olinuxino')
|
2012-07-14 19:11:41 +00:00
|
|
|
_kernelname=${pkgname#kernel26}
|
|
|
|
_basekernel=2.6
|
|
|
|
pkgver=${_basekernel}.35.3
|
2012-09-21 16:06:15 +00:00
|
|
|
pkgrel=8
|
2012-09-21 14:09:40 +00:00
|
|
|
makedepends=('xmlto' 'docbook-xsl' 'make' 'git' 'elftosb' 'imx-bootlets-olinuxino' 'imx-bootlets-olinuxino-ntsc')
|
2012-07-14 20:54:53 +00:00
|
|
|
optdepends=()
|
2012-07-14 19:11:41 +00:00
|
|
|
options=('!strip' '!buildflags' '!makeflags')
|
|
|
|
arch=('arm')
|
|
|
|
CARCH=arm
|
|
|
|
KARCH=arm
|
|
|
|
LDFLAGS=""
|
|
|
|
license=('GPL2')
|
|
|
|
url="https://github.com/Freescale/meta-fsl-arm/"
|
|
|
|
source=(config
|
|
|
|
NFS-Fix-nfsroot-support.patch
|
|
|
|
NFS-allow-nfs-root-mount-to-use-alternate-rpc-ports.patch
|
2012-09-18 19:11:16 +00:00
|
|
|
mx28-removecpufreq.patch
|
2012-08-21 07:48:06 +00:00
|
|
|
mxs-duart-use-ttyAMA-for-device-name.patch
|
2012-07-14 19:11:41 +00:00
|
|
|
imx233-olinuxino.patch)
|
2012-09-18 19:11:16 +00:00
|
|
|
md5sums=('953ddea92634bb713853f2c1b14ed130'
|
2012-07-14 19:11:41 +00:00
|
|
|
'e086ab0b162d292549f9bf453e07ad2e'
|
|
|
|
'ff1281a87da6f8093992ad70d23e71d2'
|
2012-09-18 19:11:16 +00:00
|
|
|
'c2d9dba73587fd00d990a2521428d67b'
|
2012-08-21 07:48:06 +00:00
|
|
|
'302ad0fe4e990c789793e25ced58f712'
|
|
|
|
'ba72c5e3ea407e6214e237323d6b467b')
|
|
|
|
|
2012-07-14 19:11:41 +00:00
|
|
|
__gitname="linux-2.6-imx"
|
|
|
|
__gitroot="git://git.freescale.com/imx/${__gitname}.git"
|
2012-08-21 07:48:06 +00:00
|
|
|
__gitbranch="imx_2.6.35_10.12.01"
|
2012-09-18 19:11:16 +00:00
|
|
|
__gitcommit="38bf41cc376e24c384934fbeb10770d6712e9143"
|
2012-08-21 07:48:06 +00:00
|
|
|
|
2012-07-14 19:11:41 +00:00
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "$srcdir"
|
|
|
|
if [ -d $__gitname ] ; then
|
|
|
|
msg "Using existing GIT repo clone."
|
|
|
|
cd ${__gitname} && git checkout ${__gitcommit} -- .
|
|
|
|
msg "The local files are updated."
|
|
|
|
else
|
2012-09-19 12:47:05 +00:00
|
|
|
msg "GIT Checkout of ${__gitroot}"
|
2012-08-21 07:48:06 +00:00
|
|
|
git clone --depth=1 --branch=${__gitbranch} ${__gitroot} ${__gitname}
|
2012-09-19 12:47:05 +00:00
|
|
|
cd ${__gitname}
|
2012-08-21 07:48:06 +00:00
|
|
|
git checkout ${__gitcommit} -- .
|
2012-07-14 19:11:41 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
msg "Cleaning up the working copy..."
|
|
|
|
git clean -df
|
|
|
|
make mrproper
|
|
|
|
|
|
|
|
msg "Patching ..."
|
2012-09-18 19:11:16 +00:00
|
|
|
|
2012-07-14 19:11:41 +00:00
|
|
|
patch -Np1 -i ../NFS-Fix-nfsroot-support.patch
|
|
|
|
patch -Np1 -i ../NFS-allow-nfs-root-mount-to-use-alternate-rpc-ports.patch
|
2012-09-18 19:11:16 +00:00
|
|
|
patch -Np1 -i ../mx28-removecpufreq.patch
|
2012-08-21 07:48:06 +00:00
|
|
|
patch -Np1 -i ../mxs-duart-use-ttyAMA-for-device-name.patch
|
2012-07-14 19:11:41 +00:00
|
|
|
patch -Np1 -i ../imx233-olinuxino.patch
|
2012-08-21 07:48:06 +00:00
|
|
|
|
2012-07-17 22:44:38 +00:00
|
|
|
sed -i 's|/sbin/depmod|/bin/true|' Makefile
|
2012-07-14 19:11:41 +00:00
|
|
|
|
|
|
|
msg "Patching done, building the kernel."
|
|
|
|
|
|
|
|
cp ${srcdir}/config .config
|
2012-09-19 12:47:05 +00:00
|
|
|
make prepare
|
2012-07-14 19:11:41 +00:00
|
|
|
|
|
|
|
# set extraversion to pkgrel
|
|
|
|
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
|
|
|
|
|
|
|
|
# Configure the kernel. Replace the line below with one of your choice.
|
2012-09-19 12:47:05 +00:00
|
|
|
#make menuconfig # CLI menu for configuration
|
2012-07-14 19:11:41 +00:00
|
|
|
#make nconfig # new CLI menu for configuration
|
|
|
|
#make oldconfig # using old config from previous kernel version
|
|
|
|
|
|
|
|
# Build!
|
|
|
|
|
|
|
|
make ${MAKEFLAGS} zImage modules
|
|
|
|
}
|
|
|
|
|
|
|
|
package_kernel26-olinuxino() {
|
2012-09-21 14:09:40 +00:00
|
|
|
pkgdesc="The Linux Kernel and modules for iMX233-OLinuXino-Maxi with PAL video output"
|
2012-07-14 19:11:41 +00:00
|
|
|
groups=('base')
|
|
|
|
depends=('coreutils' 'module-init-tools')
|
|
|
|
replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
|
|
|
|
'alsa-driver' 'ieee80211' 'hostap-driver26'
|
|
|
|
'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
|
|
|
|
'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
|
2012-09-21 15:39:48 +00:00
|
|
|
'gspcav1' 'atl2' 'wlan-ng26' 'rt2500' 'nouveau-drm')
|
2012-07-14 19:11:41 +00:00
|
|
|
provides=("kernel26=${pkgver}" "linux=${pkgver}")
|
|
|
|
install=kernel26.install
|
|
|
|
KARCH=arm
|
|
|
|
|
|
|
|
cd ${srcdir}/${__gitname}
|
|
|
|
|
|
|
|
# get kernel version
|
|
|
|
_kernver="$(make kernelrelease)"
|
2012-07-16 21:59:39 +00:00
|
|
|
|
|
|
|
# Install zImage, System.map and the config for reference
|
2012-07-17 22:44:38 +00:00
|
|
|
mkdir -p ${pkgdir}/{lib/modules,lib/firmware,boot}
|
|
|
|
make INSTALL_MOD_PATH="${pkgdir}" modules_install
|
2012-07-14 19:11:41 +00:00
|
|
|
#cp arch/$KARCH/boot/uImage ${pkgdir}/boot/uImage
|
|
|
|
cp arch/$KARCH/boot/zImage ${pkgdir}/boot/zImage
|
2013-01-16 00:31:07 +00:00
|
|
|
ln -sf "${pkgdir}/boot/zImage" .
|
2012-07-14 19:11:41 +00:00
|
|
|
cp .config ${pkgdir}/boot/config-${_kernver}
|
|
|
|
cp System.map System.map-${_kernver}
|
|
|
|
|
|
|
|
# set correct depmod command for install
|
|
|
|
sed \
|
|
|
|
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
|
|
|
|
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
|
|
|
|
-i $startdir/kernel26.install
|
|
|
|
|
2012-07-14 20:54:53 +00:00
|
|
|
# Generate an imx233 boot image
|
2012-09-21 15:39:48 +00:00
|
|
|
msg "Generating PAL sdcard image ..."
|
2012-07-14 20:54:53 +00:00
|
|
|
ln -sf /opt/imx-bootlets-olinuxino
|
2012-09-21 15:39:48 +00:00
|
|
|
elftosb -z -c ./imx-bootlets-olinuxino/linux.bd -o ${pkgdir}/boot/oli-${_kernver}-pal.sb
|
|
|
|
|
|
|
|
msg "Generating NTSC sdcard image ..."
|
|
|
|
ln -sf /opt/imx-bootlets-olinuxino-ntsc
|
|
|
|
elftosb -z -c ./imx-bootlets-olinuxino-ntsc/linux.bd -o ${pkgdir}/boot/oli-${_kernver}-ntsc.sb
|
2012-07-14 20:54:53 +00:00
|
|
|
|
2012-07-14 19:11:41 +00:00
|
|
|
# remove build and source links
|
2012-09-21 12:40:35 +00:00
|
|
|
rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
|
2012-07-17 00:31:00 +00:00
|
|
|
|
2012-09-14 16:03:05 +00:00
|
|
|
# Now we call depmod...
|
|
|
|
depmod -b "$pkgdir" -F System.map "$_kernver"
|
|
|
|
|
2012-07-17 00:31:00 +00:00
|
|
|
# move module tree /lib -> /usr/lib
|
2012-07-17 01:39:40 +00:00
|
|
|
mkdir -p "${pkgdir}/usr"
|
2012-07-17 00:31:00 +00:00
|
|
|
mv "$pkgdir/lib" "$pkgdir/usr"
|
2012-07-14 19:11:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_kernel26-headers-olinuxino() {
|
|
|
|
pkgdesc="Header files and scripts for building modules for kernel26 for iMX233-OLinuXino-Maxi"
|
|
|
|
provides=("kernel26-headers=${pkgver}" "linux-headers=${pkgver}")
|
|
|
|
KARCH=arm
|
|
|
|
|
|
|
|
cd ${srcdir}/${__gitname}
|
|
|
|
|
|
|
|
# get kernel version
|
|
|
|
_kernver="$(make kernelrelease)"
|
|
|
|
|
2012-07-17 00:31:00 +00:00
|
|
|
install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
|
|
|
|
|
|
|
|
cd "${pkgdir}/usr/lib/modules/${_kernver}"
|
|
|
|
ln -sf ../../../src/linux-${_kernver} build
|
2012-07-14 19:11:41 +00:00
|
|
|
|
|
|
|
cd ${srcdir}/${__gitname}
|
|
|
|
install -D -m644 Makefile \
|
|
|
|
${pkgdir}/usr/src/linux-${_kernver}/Makefile
|
|
|
|
install -D -m644 kernel/Makefile \
|
|
|
|
${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
|
|
|
|
install -D -m644 .config \
|
|
|
|
${pkgdir}/usr/src/linux-${_kernver}/.config
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
|
|
|
|
|
|
|
|
for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
|
|
|
|
cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
|
|
|
|
done
|
|
|
|
|
|
|
|
# copy arch includes for external modules
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH
|
|
|
|
cp -a arch/$KARCH/include ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
|
|
|
|
|
|
|
|
# install platform- and machine-specific headers
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/mach-mx23
|
|
|
|
cp -a arch/$KARCH/mach-mx23/include ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/mach-mx23/
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/plat-mxs
|
|
|
|
cp -a arch/$KARCH/plat-mxs/include ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/plat-mxs/
|
|
|
|
|
|
|
|
# copy files necessary for later builds, like nvidia and vmware
|
|
|
|
cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
|
|
|
|
cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
|
|
|
|
|
|
|
|
# fix permissions on scripts dir
|
|
|
|
chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
|
|
|
|
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
|
|
|
|
|
|
|
|
cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
|
|
|
|
cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
|
|
|
|
|
|
|
|
# add headers for lirc package
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
|
|
|
|
cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
|
|
|
|
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo; do
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
|
|
|
|
cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
|
|
|
|
done
|
|
|
|
|
|
|
|
# add docbook makefile
|
|
|
|
install -D -m644 Documentation/DocBook/Makefile \
|
|
|
|
${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
|
|
|
|
|
|
|
|
# add dm headers
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
|
|
|
|
cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
|
|
|
|
|
|
|
|
# add inotify.h
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
|
|
|
|
cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
|
|
|
|
|
|
|
|
# add wireless headers
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
|
|
|
|
cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
|
|
|
|
|
|
|
|
# add dvb headers for external modules
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
|
|
|
|
cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
|
|
|
|
|
|
|
|
# add dvb headers for external modules
|
|
|
|
#mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
|
|
|
|
#cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
|
|
|
|
|
|
|
|
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
|
|
|
|
cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
|
|
|
|
cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
|
|
|
|
|
|
|
|
# add dvb headers
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb
|
|
|
|
cp drivers/media/dvb/dvb-usb/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends
|
|
|
|
cp drivers/media/dvb/frontends/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners
|
|
|
|
cp drivers/media/common/tuners/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/
|
|
|
|
|
|
|
|
# add xfs and shmem for aufs building
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
|
|
|
|
cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
|
|
|
|
|
|
|
|
# add headers vor virtualbox
|
|
|
|
cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
|
|
|
|
|
|
|
|
# add headers for broadcom wl
|
|
|
|
cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
|
|
|
|
|
|
|
|
# copy in Kconfig files
|
|
|
|
for i in `find . -name "Kconfig*"`; do
|
|
|
|
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
|
|
|
|
cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
|
|
|
|
done
|
|
|
|
|
|
|
|
chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
|
|
|
|
find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
|
|
|
|
|
|
|
|
# remove unneeded architectures
|
|
|
|
rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa,x86}
|
|
|
|
}
|
2012-09-19 12:47:05 +00:00
|
|
|
md5sums=('477fe18ac96828b5b7238cc1ee1547e8'
|
|
|
|
'e086ab0b162d292549f9bf453e07ad2e'
|
|
|
|
'ff1281a87da6f8093992ad70d23e71d2'
|
|
|
|
'c2d9dba73587fd00d990a2521428d67b'
|
|
|
|
'302ad0fe4e990c789793e25ced58f712'
|
|
|
|
'ba72c5e3ea407e6214e237323d6b467b')
|