[meta-freescale] [meta-fsl-ppc][PATCH] linux: add support for kernel fragmentation

b40527 at freescale.com b40527 at freescale.com
Tue Sep 23 00:36:16 PDT 2014


From: Zongchun Yu <Zongchun.Yu at freescale.com>

Using the metadata which is stored in recipe-space, and adding the .scc
files on the SRC_URI. BitBake can parses them and fetches any files
referenced in the .scc files by the include, patch, or kconf
commands. these commands can achieve kernel fragmentation configuration,
appliying patch and so on.

Signed-off-by: Zongchun Yu <Zongchun.Yu at freescale.com>
---
 ...r-CVE-2014-5045-fs-umount-on-symlink-leak.patch |  0
 recipes-kernel/linux/files/cfg/base/base.scc       |  5 +++
 ...erpc-Fix-64-bit-builds-with-binutils-2.24.patch |  0
 recipes-kernel/linux/linux-qoriq.inc               | 47 +++++++++++++++-------
 recipes-kernel/linux/linux-qoriq_3.12.bb           |  3 +-
 5 files changed, 38 insertions(+), 17 deletions(-)
 rename recipes-kernel/linux/files/{ => cfg/base}/Fix-for-CVE-2014-5045-fs-umount-on-symlink-leak.patch (100%)
 create mode 100644 recipes-kernel/linux/files/cfg/base/base.scc
 rename recipes-kernel/linux/files/{ => cfg/base}/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch (100%)

diff --git a/recipes-kernel/linux/files/Fix-for-CVE-2014-5045-fs-umount-on-symlink-leak.patch b/recipes-kernel/linux/files/cfg/base/Fix-for-CVE-2014-5045-fs-umount-on-symlink-leak.patch
similarity index 100%
rename from recipes-kernel/linux/files/Fix-for-CVE-2014-5045-fs-umount-on-symlink-leak.patch
rename to recipes-kernel/linux/files/cfg/base/Fix-for-CVE-2014-5045-fs-umount-on-symlink-leak.patch
diff --git a/recipes-kernel/linux/files/cfg/base/base.scc b/recipes-kernel/linux/files/cfg/base/base.scc
new file mode 100644
index 0000000..cb9f84b
--- /dev/null
+++ b/recipes-kernel/linux/files/cfg/base/base.scc
@@ -0,0 +1,5 @@
+# Force the base configuration
+force kconf non-hardware base.cfg
+
+patch Fix-for-CVE-2014-5045-fs-umount-on-symlink-leak.patch
+patch powerpc-Fix-64-bit-builds-with-binutils-2.24.patch
diff --git a/recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch b/recipes-kernel/linux/files/cfg/base/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch
similarity index 100%
rename from recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch
rename to recipes-kernel/linux/files/cfg/base/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch
diff --git a/recipes-kernel/linux/linux-qoriq.inc b/recipes-kernel/linux/linux-qoriq.inc
index 9e463dd..9602c38 100644
--- a/recipes-kernel/linux/linux-qoriq.inc
+++ b/recipes-kernel/linux/linux-qoriq.inc
@@ -1,5 +1,5 @@
-inherit kernel qoriq_build_64bit_kernel
-require recipes-kernel/linux/linux-dtb.inc
+inherit qoriq_build_64bit_kernel
+require recipes-kernel/linux/linux-yocto.inc
 
 DESCRIPTION = "Linux kernel for Freescale platforms"
 SECTION = "kernel"
@@ -14,20 +14,35 @@ KERNEL_CC_append = " ${TOOLCHAIN_OPTIONS}"
 KERNEL_LD_append = " ${TOOLCHAIN_OPTIONS}"
 
 SCMVERSION ?= "y"
-DELTA_KERNEL_DEFCONFIG ?= ""
+LINUX_VERSION_EXTENSION = ""
+BASECFGDIR = "${FILE_DIRNAME}/files"
+
+python () {
+        branch = d.getVar("SRC_URI", True)
+
+        if "nobranch" in branch:
+                d.setVar('NOBRANCH_FLAG', '1')
+}
+
+do_kernel_checkout_append() {
+    #reset to SRCREV if no branch is defined
+    if [ "${NOBRANCH_FLAG}" = "1" ]; then
+            git reset --hard ${SRCREV}
+    fi
+}
+
+do_patch_prepend() {
+    if [ -n "${FILESEXTRAPATHS}" ]; then
+            BASECFGDIR=`echo ${FILESEXTRAPATHS} | cut -d ':' -f1`
+    fi
+    cp ${KERNEL_DEFCONFIG} ${BASECFGDIR}/cfg/base/base.cfg
+}
+
 do_configure_prepend() {
-	# copy desired defconfig so we pick it up for the real kernel_do_configure
-	cp ${KERNEL_DEFCONFIG} ${B}/.config
-
-	# add config fragments
-	for deltacfg in ${DELTA_KERNEL_DEFCONFIG}; do
-		if [ -f "${deltacfg}" ]; then
-			${S}/scripts/kconfig/merge_config.sh -m .config ${deltacfg}
-		elif [ -f "${S}/arch/powerpc/configs/${deltacfg}" ]; then
-		    ${S}/scripts/kconfig/merge_config.sh -m .config \
-			    ${S}/arch/powerpc/configs/${deltacfg}
-		fi
-	done
+    if [ -n "${FILESEXTRAPATHS}" ]; then
+            BASECFGDIR=`echo ${FILESEXTRAPATHS} | cut -d ':' -f1`
+    fi
+    rm -f ${BASECFGDIR}/cfg/base/base.cfg
 
     #add git revision to the local version
     if [ "${SCMVERSION}" = "y" ]; then
@@ -36,7 +51,9 @@ do_configure_prepend() {
             if [ -n "${SDK_VERSION}" ]; then
                 sdkversion="-${SDK_VERSION}"
             fi
+            cd source
             head=`git rev-parse --verify --short HEAD 2> /dev/null`
+            cd -
             printf "%s%s%s" $sdkversion +g $head > ${S}/.scmversion
     fi
 }
diff --git a/recipes-kernel/linux/linux-qoriq_3.12.bb b/recipes-kernel/linux/linux-qoriq_3.12.bb
index 4e9c50b..a484215 100644
--- a/recipes-kernel/linux/linux-qoriq_3.12.bb
+++ b/recipes-kernel/linux/linux-qoriq_3.12.bb
@@ -1,8 +1,7 @@
 require recipes-kernel/linux/linux-qoriq.inc
 
 SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;nobranch=1 \
-    file://powerpc-Fix-64-bit-builds-with-binutils-2.24.patch \
-    file://Fix-for-CVE-2014-5045-fs-umount-on-symlink-leak.patch \
+    file://cfg/base/base.scc \
 "
 SRCREV = "c29fe1a733308cbe592b3af054a97be1b91cf2dd"
 
-- 
1.8.3.2



More information about the meta-freescale mailing list