]> code.ossystems Code Review - meta-freescale.git/commitdiff
linux-imx.inc: add to avoid duplicating code among linux-imx' recipes
authorOtavio Salvador <otavio@ossystems.com.br>
Thu, 9 Aug 2012 21:58:30 +0000 (18:58 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Wed, 15 Aug 2012 17:05:58 +0000 (14:05 -0300)
The linux-imx.inc hosts the common code of linux-imx recipes making it
easy to maintain and work.

To easily identify that the kernel running is built from Yocto and
give an indication of versioning, until we have a proper GIT revision
to point to, we use a local version with '+yocto-<date>' for it.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
meta-fsl-arm/recipes-kernel/linux/linux-imx.inc [new file with mode: 0644]

diff --git a/meta-fsl-arm/recipes-kernel/linux/linux-imx.inc b/meta-fsl-arm/recipes-kernel/linux/linux-imx.inc
new file mode 100644 (file)
index 0000000..6909582
--- /dev/null
@@ -0,0 +1,64 @@
+# Copyright (C) 2012 O.S. Systems Software LTDA.
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Linux kernel for imx platforms"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+INC_PR = "r30"
+
+inherit kernel
+
+# Put a local version until we have a true SRCREV to point to
+LOCALVERSION ?= "+yocto-${DATE}"
+
+SRC_URI = "git://git.freescale.com/imx/linux-2.6-imx.git \
+           file://defconfig \
+"
+
+S = "${WORKDIR}/git"
+
+kernel_conf_variable() {
+       CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
+       if test "$2" = "n"
+       then
+               echo "# CONFIG_$1 is not set" >> ${S}/.config
+       else
+               echo "CONFIG_$1=$2" >> ${S}/.config
+       fi
+}
+
+do_configure_prepend() {
+       echo "" > ${S}/.config
+       CONF_SED_SCRIPT=""
+
+       kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
+       kernel_conf_variable LOCALVERSION_AUTO n
+
+       sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${S}/.config'
+}
+
+# install nedded headers for imx-test compilation
+do_install_append() {
+       # bounds.h may be used by a module and is currently missing
+       if [ -d include/generated ]; then
+               cp include/generated/* $kerneldir/include/generated/
+       fi
+
+       # Host architecture object file
+       rm -f $kerneldir/scripts/kconfig/kxgettext.o
+}
+
+sysroot_stage_all_append() {
+       # denzil does not have KERNEL_SRC_PATH so we default to /kernel
+       destdir=${KERNEL_SRC_PATH}
+       if [ -z "$destdir" ]; then
+               destdir=/kernel
+       fi
+
+       # Copy native binaries need for imx-test build onto sysroot
+       mkdir -p ${SYSROOT_DESTDIR}/usr/src/kernel/scripts/basic \
+                ${SYSROOT_DESTDIR}/usr/src/kernel/scripts/mod
+       cp ${S}/scripts/basic/fixdep ${SYSROOT_DESTDIR}$destdir/scripts/basic
+       cp ${S}/scripts/mod/modpost ${SYSROOT_DESTDIR}$destdir/scripts/mod
+}