[meta-freescale] [meta-fsl-arm PATCH v2 3/3] linux-fslc: Refactor to use linux-imx.inc and avoid duplication of code

Otavio Salvador otavio at ossystems.com.br
Thu Apr 18 11:59:39 PDT 2013


Provides a new linux-fslc.inc file which abstracts the specific
changes for the linux-fslc based kernels. A new variable has been add
to linux-imx.inc to allow to skip the 'imx-test' specific hacks after
kernel install as 'imx-test' is not supported for Linux mainline.

Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---
Changes in v2:
- Reuse linux-imx.inc
- Add linux-fslc.inc

 recipes-kernel/linux/linux-fslc.inc    | 20 ++++++++++++++++++++
 recipes-kernel/linux/linux-fslc_3.8.bb | 25 +------------------------
 recipes-kernel/linux/linux-imx.inc     | 17 +++++++++++------
 3 files changed, 32 insertions(+), 30 deletions(-)
 create mode 100644 recipes-kernel/linux/linux-fslc.inc

diff --git a/recipes-kernel/linux/linux-fslc.inc b/recipes-kernel/linux/linux-fslc.inc
new file mode 100644
index 0000000..6ebf833
--- /dev/null
+++ b/recipes-kernel/linux/linux-fslc.inc
@@ -0,0 +1,20 @@
+# Copyright (C) 2012-2013 O.S. Systems Software LTDA.
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Freescale Community mainline based Linux kernel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+DEPENDS += "lzop-native"
+PROVIDES = "virtual/kernel linux-mainline"
+
+inherit kernel
+
+require recipes-kernel/linux/linux-imx.inc
+require recipes-kernel/linux/linux-dtb.inc
+
+# Avoid imx-test installation hacks
+IMX_TEST_SUPPORT = "n"
+
+SRC_URI = "git://github.com/Freescale/linux-mainline.git \
+           file://defconfig"
+LOCALVERSION = "-fslc"
diff --git a/recipes-kernel/linux/linux-fslc_3.8.bb b/recipes-kernel/linux/linux-fslc_3.8.bb
index 06f6dfb..68fa8e1 100644
--- a/recipes-kernel/linux/linux-fslc_3.8.bb
+++ b/recipes-kernel/linux/linux-fslc_3.8.bb
@@ -1,15 +1,7 @@
 # Copyright (C) 2012-2013 O.S. Systems Software LTDA.
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-DESCRIPTION = "Linux mainline kernel"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
-DEPENDS += "lzop-native"
-PROVIDES = "virtual/kernel linux-mainline"
-
-inherit kernel
-
-require recipes-kernel/linux/linux-dtb.inc
+include linux-fslc.inc
 
 PV = "3.8+git${SRCPV}"
 PR = "r5"
@@ -17,19 +9,4 @@ PR = "r5"
 # patches-3.8
 SRCREV = "9674b8d96fca62bc47be48fd857591dcfca874b1"
 
-SRC_URI = "git://github.com/Freescale/linux-mainline.git \
-           \
-           file://defconfig"
-
-S = "${WORKDIR}/git"
-
-do_configure_append () {
-    # Ensure we have a proper GIT hash in kernel version
-    rm ${S}/.scmversion
-}
-
-# We need to pass it as param since kernel might support more then one
-# machine, with different entry points
-EXTRA_OEMAKE += "LOADADDR=${UBOOT_ENTRYPOINT}"
-
 COMPATIBLE_MACHINE = "(mxs|mx3|mx5|mx6)"
diff --git a/recipes-kernel/linux/linux-imx.inc b/recipes-kernel/linux/linux-imx.inc
index 9020f57..6a8eeb8 100644
--- a/recipes-kernel/linux/linux-imx.inc
+++ b/recipes-kernel/linux/linux-imx.inc
@@ -13,6 +13,9 @@ inherit kernel
 LOCALVERSION ?= "+yocto"
 SCMVERSION ?= "y"
 
+# Add imx-test support hacks
+IMX_TEST_SUPPORT ?= "y"
+
 SRC_URI = "git://git.freescale.com/imx/linux-2.6-imx.git \
            file://defconfig \
 "
@@ -51,13 +54,15 @@ do_configure_prepend() {
 
 # 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
+	if [ "${IMX_TEST_SUPPORT}" = "y" ]; then
+		# 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
+		# Host architecture object file
+		rm -f $kerneldir/scripts/kconfig/kxgettext.o
+	fi
 }
 
 sysroot_stage_all_append() {
-- 
1.8.1




More information about the meta-freescale mailing list