All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-fsl-ppc][PATCH][v2] linux: add support for kernel fragmentation
@ 2014-09-30  8:42 b40527
  2014-10-02  4:48 ` Bob Cochran
  0 siblings, 1 reply; 4+ messages in thread
From: b40527 @ 2014-09-30  8:42 UTC (permalink / raw)
  To: meta-freescale; +Cc: Zongchun Yu

From: Zongchun Yu <Zongchun.Yu@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@freescale.com>
---
 recipes-kernel/linux/files/base.scc      |  7 +++++++
 recipes-kernel/linux/linux-qoriq.inc     | 36 +++++++++++++++++++-------------
 recipes-kernel/linux/linux-qoriq_3.12.bb |  5 +----
 3 files changed, 29 insertions(+), 19 deletions(-)
 create mode 100644 recipes-kernel/linux/files/base.scc

diff --git a/recipes-kernel/linux/files/base.scc b/recipes-kernel/linux/files/base.scc
new file mode 100644
index 0000000..9076e6b
--- /dev/null
+++ b/recipes-kernel/linux/files/base.scc
@@ -0,0 +1,7 @@
+# Force the base configuration
+force kconf non-hardware base.cfg
+
+patch powerpc-Fix-64-bit-builds-with-binutils-2.24.patch
+patch Fix-for-CVE-2014-5045-fs-umount-on-symlink-leak.patch
+patch Fix-CVE-2014-5471_CVE-2014-5472.patch
+patch Fix-CVE-2014-5077-sctp-inherit-auth-capable-on-INIT-collisions.patch
diff --git a/recipes-kernel/linux/linux-qoriq.inc b/recipes-kernel/linux/linux-qoriq.inc
index 9e463dd..1fb5653 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,24 @@ KERNEL_CC_append = " ${TOOLCHAIN_OPTIONS}"
 KERNEL_LD_append = " ${TOOLCHAIN_OPTIONS}"
 
 SCMVERSION ?= "y"
-DELTA_KERNEL_DEFCONFIG ?= ""
+LINUX_VERSION_EXTENSION = ""
+BASECFGDIR = "${FILE_DIRNAME}/files"
+
+do_patch_prepend() {
+    # if bbappend file is used. copy the kernel configure file as base.cfg
+    # to the folder defined in FILESEXTRAPATHS. 
+    if [ -n "${FILESEXTRAPATHS}" ]; then
+            BASECFGDIR=`echo ${FILESEXTRAPATHS} | cut -d ':' -f1`
+    fi
+    cp ${KERNEL_DEFCONFIG} ${BASECFGDIR}/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
+    # remove the base.cfg generated in do_patch task.
+    rm -f ${BASECFGDIR}/base.cfg
 
     #add git revision to the local version
     if [ "${SCMVERSION}" = "y" ]; then
@@ -36,7 +40,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 39270d4..ecae8cd 100644
--- a/recipes-kernel/linux/linux-qoriq_3.12.bb
+++ b/recipes-kernel/linux/linux-qoriq_3.12.bb
@@ -1,10 +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://Fix-CVE-2014-5077-sctp-inherit-auth-capable-on-INIT-collisions.patch \
-    file://Fix-CVE-2014-5471_CVE-2014-5472.patch \
+    file://base.scc \
 "
 SRCREV = "c29fe1a733308cbe592b3af054a97be1b91cf2dd"
 
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [meta-fsl-ppc][PATCH][v2] linux: add support for kernel fragmentation
  2014-09-30  8:42 [meta-fsl-ppc][PATCH][v2] linux: add support for kernel fragmentation b40527
@ 2014-10-02  4:48 ` Bob Cochran
  2014-10-03 14:01   ` Otavio Salvador
  2014-10-09  6:23   ` Zongchun.Yu
  0 siblings, 2 replies; 4+ messages in thread
From: Bob Cochran @ 2014-10-02  4:48 UTC (permalink / raw)
  To: meta-freescale, b40527, Zongchun.Yu

On 09/30/2014 04:42 AM, b40527@freescale.com wrote:
> From: Zongchun Yu <Zongchun.Yu@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.


I think you mean to say 'add support for kernel configuration 
fragments', not 'kernel fragmentation'.  However, perhaps stating that 
you are adding support for scc description files would be more 
appropriate.

I'm wondering why you are adding this abstraction to the base 
configuration.  Is this the start of further customization following the 
linux-yocto model as described in the Yocto Project Linux Kernel 
Development Manual?  My impression of scc files is that they are useful 
for describing various features and BSPs.  They only seem to make sense 
if multiple scc files exist and can be chosen for various reasons.

This single, particular scc file just describes the base kernel, so I'm 
wondering why it's being added now & if multiple scc files are going to 
follow for linux-qoriq.  If not, I think it just adds unneeded 
abstraction / complexity.

And will the use of scc files also be adopted in meta-fsl-arm / linux-imx?




>
> Signed-off-by: Zongchun Yu <Zongchun.Yu@freescale.com>
> ---
>   recipes-kernel/linux/files/base.scc      |  7 +++++++
>   recipes-kernel/linux/linux-qoriq.inc     | 36 +++++++++++++++++++-------------
>   recipes-kernel/linux/linux-qoriq_3.12.bb |  5 +----
>   3 files changed, 29 insertions(+), 19 deletions(-)
>   create mode 100644 recipes-kernel/linux/files/base.scc
>
> diff --git a/recipes-kernel/linux/files/base.scc b/recipes-kernel/linux/files/base.scc
> new file mode 100644
> index 0000000..9076e6b
> --- /dev/null
> +++ b/recipes-kernel/linux/files/base.scc
> @@ -0,0 +1,7 @@
> +# Force the base configuration
> +force kconf non-hardware base.cfg
> +
> +patch powerpc-Fix-64-bit-builds-with-binutils-2.24.patch
> +patch Fix-for-CVE-2014-5045-fs-umount-on-symlink-leak.patch
> +patch Fix-CVE-2014-5471_CVE-2014-5472.patch
> +patch Fix-CVE-2014-5077-sctp-inherit-auth-capable-on-INIT-collisions.patch
> diff --git a/recipes-kernel/linux/linux-qoriq.inc b/recipes-kernel/linux/linux-qoriq.inc
> index 9e463dd..1fb5653 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,24 @@ KERNEL_CC_append = " ${TOOLCHAIN_OPTIONS}"
>   KERNEL_LD_append = " ${TOOLCHAIN_OPTIONS}"
>
>   SCMVERSION ?= "y"
> -DELTA_KERNEL_DEFCONFIG ?= ""
> +LINUX_VERSION_EXTENSION = ""
> +BASECFGDIR = "${FILE_DIRNAME}/files"
> +
> +do_patch_prepend() {
> +    # if bbappend file is used. copy the kernel configure file as base.cfg
> +    # to the folder defined in FILESEXTRAPATHS.
> +    if [ -n "${FILESEXTRAPATHS}" ]; then
> +            BASECFGDIR=`echo ${FILESEXTRAPATHS} | cut -d ':' -f1`
> +    fi
> +    cp ${KERNEL_DEFCONFIG} ${BASECFGDIR}/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
> +    # remove the base.cfg generated in do_patch task.
> +    rm -f ${BASECFGDIR}/base.cfg
>
>       #add git revision to the local version
>       if [ "${SCMVERSION}" = "y" ]; then
> @@ -36,7 +40,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 39270d4..ecae8cd 100644
> --- a/recipes-kernel/linux/linux-qoriq_3.12.bb
> +++ b/recipes-kernel/linux/linux-qoriq_3.12.bb
> @@ -1,10 +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://Fix-CVE-2014-5077-sctp-inherit-auth-capable-on-INIT-collisions.patch \
> -    file://Fix-CVE-2014-5471_CVE-2014-5472.patch \
> +    file://base.scc \
>   "
>   SRCREV = "c29fe1a733308cbe592b3af054a97be1b91cf2dd"
>
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-fsl-ppc][PATCH][v2] linux: add support for kernel fragmentation
  2014-10-02  4:48 ` Bob Cochran
@ 2014-10-03 14:01   ` Otavio Salvador
  2014-10-09  6:23   ` Zongchun.Yu
  1 sibling, 0 replies; 4+ messages in thread
From: Otavio Salvador @ 2014-10-03 14:01 UTC (permalink / raw)
  To: Bob Cochran
  Cc: meta-freescale@yoctoproject.org, Zongchun Yu, Yu Zongchun-B40527

On Thu, Oct 2, 2014 at 1:48 AM, Bob Cochran <yocto@mindchasers.com> wrote:
> On 09/30/2014 04:42 AM, b40527@freescale.com wrote:
>>
>> From: Zongchun Yu <Zongchun.Yu@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.
>
>
>
> I think you mean to say 'add support for kernel configuration fragments',
> not 'kernel fragmentation'.  However, perhaps stating that you are adding
> support for scc description files would be more appropriate.
>
> I'm wondering why you are adding this abstraction to the base configuration.
> Is this the start of further customization following the linux-yocto model
> as described in the Yocto Project Linux Kernel Development Manual?  My
> impression of scc files is that they are useful for describing various
> features and BSPs.  They only seem to make sense if multiple scc files exist
> and can be chosen for various reasons.
>
> This single, particular scc file just describes the base kernel, so I'm
> wondering why it's being added now & if multiple scc files are going to
> follow for linux-qoriq.  If not, I think it just adds unneeded abstraction /
> complexity.

Agreed.  I think this is the direction to go in long term but I would
also expect a more complete set of scc files so it could be indeed
flexible.

> And will the use of scc files also be adopted in meta-fsl-arm / linux-imx?

I hope we do it in future. I didn't yet looked at it and I am not
aware of someone working on it yet.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-fsl-ppc][PATCH][v2] linux: add support for kernel fragmentation
  2014-10-02  4:48 ` Bob Cochran
  2014-10-03 14:01   ` Otavio Salvador
@ 2014-10-09  6:23   ` Zongchun.Yu
  1 sibling, 0 replies; 4+ messages in thread
From: Zongchun.Yu @ 2014-10-09  6:23 UTC (permalink / raw)
  To: Bob Cochran; +Cc: meta-freescale@yoctoproject.org

>I think you mean to say 'add support for kernel configuration fragments', not 'kernel fragmentation'.  However, perhaps stating that you are adding support for scc description files would be more appropriate.
[Zongchun] Thanks for your comments. I will improve the description of this patch.

>I'm wondering why you are adding this abstraction to the base configuration.  Is this the start of further customization following the linux-yocto model as described in the Yocto Project Linux Kernel Development Manual?  My impression of scc files is that they are useful for describing various features and BSPs.  They only seem to make sense if multiple scc files exist and can be chosen for various reasons.
[Zongchun] Yes. this patch is a start of further customization following the linux-yocto model. I assume that 'base.scc' is a common scc file used by all the features. Different features can be
Defined by different scc files. All the feature scc files can use this base configuration by including base.scc file.

>This single, particular scc file just describes the base kernel, so I'm wondering why it's being added now & if multiple scc files are going to follow for linux-qoriq.  If not, I think it just adds unneeded abstraction / complexity.
[Zongchun] we will add more fearute scc files in future. 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-09  6:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  8:42 [meta-fsl-ppc][PATCH][v2] linux: add support for kernel fragmentation b40527
2014-10-02  4:48 ` Bob Cochran
2014-10-03 14:01   ` Otavio Salvador
2014-10-09  6:23   ` Zongchun.Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.