All of lore.kernel.org
 help / color / mirror / Atom feed
* [[PATCH v2] kernel-fitimage: fix ${KERNEL_DEVICETREE} includes subdirectory issue.
@ 2017-05-08  6:31 Chunrong Guo
  0 siblings, 0 replies; 5+ messages in thread
From: Chunrong Guo @ 2017-05-08  6:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: chunrong.guo

From: Chunrong Guo <chunrong.guo@nxp.com>

    * For example:
      KERNEL_DEVICETREE ?= "freescale/fsl-ls1046a-rdb.dtb"

      ${DTB}= "freescale/fsl-ls1046a-rdb.dtb"

      but only the dtb name should be used.

    * Support "ext2.gz " filesystems

    * Support mutiple KERNEL_IMAGETYPE
      For example:
       KERNEL_IMAGETYPE = "Image"  or  KERNEL_IMAGETYPE = "zImage"

Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
---
 meta/classes/kernel-fitimage.bbclass | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 2630b47..63f03a5 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -10,7 +10,7 @@ python __anonymous () {
         if d.getVar("UBOOT_ARCH") == "x86":
             replacementtype = "bzImage"
         else:
-            replacementtype = "zImage"
+            replacementtype = d.getVar("KERNEL_IMAGETYPE")
 
 	# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
 	# to kernel.bbclass . We have to override it, since we pack zImage
@@ -342,15 +342,8 @@ fitimage_assemble() {
 	if [ -n "${KERNEL_DEVICETREE}" ]; then
 		dtbcount=1
 		for DTB in ${KERNEL_DEVICETREE}; do
-			if echo ${DTB} | grep -q '/dts/'; then
-				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
-				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
-			fi
-			DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
-			if [ ! -e "${DTB_PATH}" ]; then
-				DTB_PATH="arch/${ARCH}/boot/${DTB}"
-			fi
-
+                        DTB=`basename ${DTB}`
+			DTB_PATH=`find arch/${ARCH}/boot -name "${DTB}"` 
 			DTBS="${DTBS} ${DTB}"
 			fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
 		done
@@ -369,7 +362,7 @@ fitimage_assemble() {
 	#
 	if [ "x${ramdiskcount}" = "x1" ] ; then
 		# Find and use the first initramfs image archive type we find
-		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
+		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio ext2.gz; do
 			initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
 			echo "Using $initramfs_path"
 			if [ -e "${initramfs_path}" ]; then
-- 
1.9.0



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

* Re: [[PATCH v2] kernel-fitimage: fix ${KERNEL_DEVICETREE} includes subdirectory issue.
  2017-05-09  7:38 Chunrong Guo
@ 2017-05-09  9:08 ` Andreas Oberritter
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Oberritter @ 2017-05-09  9:08 UTC (permalink / raw)
  To: Chunrong Guo; +Cc: chunrong.guo, openembedded-core

Dear Chunrong Guo,

you don't need to repost the same patch over and over again. Please consider
my reply to your first submission of v2.

http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136345.html

Regards,
Andreas

P.S.: The subject contains a superflous bracket.



On Tue, 9 May 2017 15:38:59 +0800
Chunrong Guo <B40290@freescale.com> wrote:

> From: Chunrong Guo <chunrong.guo@nxp.com>
> 
>     * For example:
>       KERNEL_DEVICETREE ?= "freescale/fsl-ls1046a-rdb.dtb"
> 
>       ${DTB}= "freescale/fsl-ls1046a-rdb.dtb"
> 
>       but only the dtb name should be used.
> 
>     * Support "ext2.gz " filesystems
> 
>     * Support mutiple KERNEL_IMAGETYPE
>       For example:
>        KERNEL_IMAGETYPE = "Image"  or  KERNEL_IMAGETYPE = "zImage"
> 
> Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
> ---
>  meta/classes/kernel-fitimage.bbclass | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
> index 2630b47..63f03a5 100644
> --- a/meta/classes/kernel-fitimage.bbclass
> +++ b/meta/classes/kernel-fitimage.bbclass
> @@ -10,7 +10,7 @@ python __anonymous () {
>          if d.getVar("UBOOT_ARCH") == "x86":
>              replacementtype = "bzImage"
>          else:
> -            replacementtype = "zImage"
> +            replacementtype = d.getVar("KERNEL_IMAGETYPE")
>  
>  	# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
>  	# to kernel.bbclass . We have to override it, since we pack zImage
> @@ -342,15 +342,8 @@ fitimage_assemble() {
>  	if [ -n "${KERNEL_DEVICETREE}" ]; then
>  		dtbcount=1
>  		for DTB in ${KERNEL_DEVICETREE}; do
> -			if echo ${DTB} | grep -q '/dts/'; then
> -				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
> -				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
> -			fi
> -			DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
> -			if [ ! -e "${DTB_PATH}" ]; then
> -				DTB_PATH="arch/${ARCH}/boot/${DTB}"
> -			fi
> -
> +                        DTB=`basename ${DTB}`
> +			DTB_PATH=`find arch/${ARCH}/boot -name "${DTB}"` 
>  			DTBS="${DTBS} ${DTB}"
>  			fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
>  		done
> @@ -369,7 +362,7 @@ fitimage_assemble() {
>  	#
>  	if [ "x${ramdiskcount}" = "x1" ] ; then
>  		# Find and use the first initramfs image archive type we find
> -		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
> +		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio ext2.gz; do
>  			initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
>  			echo "Using $initramfs_path"
>  			if [ -e "${initramfs_path}" ]; then



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

* [[PATCH v2] kernel-fitimage: fix ${KERNEL_DEVICETREE} includes subdirectory issue.
@ 2017-05-09  7:38 Chunrong Guo
  2017-05-09  9:08 ` Andreas Oberritter
  0 siblings, 1 reply; 5+ messages in thread
From: Chunrong Guo @ 2017-05-09  7:38 UTC (permalink / raw)
  To: openembedded-core; +Cc: chunrong.guo

From: Chunrong Guo <chunrong.guo@nxp.com>

    * For example:
      KERNEL_DEVICETREE ?= "freescale/fsl-ls1046a-rdb.dtb"

      ${DTB}= "freescale/fsl-ls1046a-rdb.dtb"

      but only the dtb name should be used.

    * Support "ext2.gz " filesystems

    * Support mutiple KERNEL_IMAGETYPE
      For example:
       KERNEL_IMAGETYPE = "Image"  or  KERNEL_IMAGETYPE = "zImage"

Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
---
 meta/classes/kernel-fitimage.bbclass | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 2630b47..63f03a5 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -10,7 +10,7 @@ python __anonymous () {
         if d.getVar("UBOOT_ARCH") == "x86":
             replacementtype = "bzImage"
         else:
-            replacementtype = "zImage"
+            replacementtype = d.getVar("KERNEL_IMAGETYPE")
 
 	# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
 	# to kernel.bbclass . We have to override it, since we pack zImage
@@ -342,15 +342,8 @@ fitimage_assemble() {
 	if [ -n "${KERNEL_DEVICETREE}" ]; then
 		dtbcount=1
 		for DTB in ${KERNEL_DEVICETREE}; do
-			if echo ${DTB} | grep -q '/dts/'; then
-				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
-				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
-			fi
-			DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
-			if [ ! -e "${DTB_PATH}" ]; then
-				DTB_PATH="arch/${ARCH}/boot/${DTB}"
-			fi
-
+                        DTB=`basename ${DTB}`
+			DTB_PATH=`find arch/${ARCH}/boot -name "${DTB}"` 
 			DTBS="${DTBS} ${DTB}"
 			fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
 		done
@@ -369,7 +362,7 @@ fitimage_assemble() {
 	#
 	if [ "x${ramdiskcount}" = "x1" ] ; then
 		# Find and use the first initramfs image archive type we find
-		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
+		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio ext2.gz; do
 			initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
 			echo "Using $initramfs_path"
 			if [ -e "${initramfs_path}" ]; then
-- 
1.9.0



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

* Re: [[PATCH v2] kernel-fitimage: fix ${KERNEL_DEVICETREE} includes subdirectory issue.
  2017-05-05  3:57 Chunrong Guo
@ 2017-05-05 11:14 ` Andreas Oberritter
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Oberritter @ 2017-05-05 11:14 UTC (permalink / raw)
  To: openembedded-core

On Fri, 5 May 2017 11:57:44 +0800
Chunrong Guo <B40290@freescale.com> wrote:

> From: Chunrong Guo <chunrong.guo@nxp.com>
> 
>     * For example:
>       KERNEL_DEVICETREE ?= "freescale/fsl-ls1046a-rdb.dtb"

Does this work at all? This runs oe_runmake freescale/fsl-ls1046a-rdb.dtb, if
I'm not mistaken. I think KERNEL_DEVICETREE ?= "fsl-ls1046a-rdb.dtb" would be
correct. However, I'm not sure whether my impression comes from old or patched
vendor kernels.

> 
>       ${DTB}= "freescale/fsl-ls1046a-rdb.dtb"
> 
>       but only the dtb name should be used.
> 
>     * Support "ext2.gz " filesystems

This could be a separate patch. It doesn't match the topic.

> 
>     * Support mutiple KERNEL_IMAGETYPE
>       For example:
>        KERNEL_IMAGETYPE = "Image"  or  KERNEL_IMAGETYPE = "zImage"

This assumption seems to be flawed. The code assumes that one of
KERNEL_IMAGETYPE, KERNEL_ALT_IMAGETYPE or KERNEL_IMAGETYPES contains
"fitImage". With your patch, KERNEL_IMAGETYPE = "fitImage" would become
an invalid option. If you need a special case for your architecture,
please add it to the if-else-block.

I think setting replacementtype to "vmlinux" should work for many if
not all architectures, because vmlinux is what uboot_prep_kimage() in
kernel-uboot.bbclass actually expects.

Please also create a separate patch for this task.

> 
> Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
> ---
>  meta/classes/kernel-fitimage.bbclass | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
> index 2630b47..63f03a5 100644
> --- a/meta/classes/kernel-fitimage.bbclass
> +++ b/meta/classes/kernel-fitimage.bbclass
> @@ -10,7 +10,7 @@ python __anonymous () {
>          if d.getVar("UBOOT_ARCH") == "x86":
>              replacementtype = "bzImage"
>          else:
> -            replacementtype = "zImage"
> +            replacementtype = d.getVar("KERNEL_IMAGETYPE")
>  
>  	# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
>  	# to kernel.bbclass . We have to override it, since we pack zImage
> @@ -342,15 +342,8 @@ fitimage_assemble() {
>  	if [ -n "${KERNEL_DEVICETREE}" ]; then
>  		dtbcount=1
>  		for DTB in ${KERNEL_DEVICETREE}; do
> -			if echo ${DTB} | grep -q '/dts/'; then
> -				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
> -				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
> -			fi

I don't see any justification for removing these lines.

Regards,
Andreas

> -			DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
> -			if [ ! -e "${DTB_PATH}" ]; then
> -				DTB_PATH="arch/${ARCH}/boot/${DTB}"
> -			fi
> -
> +                        DTB=`basename ${DTB}`
> +			DTB_PATH=`find arch/${ARCH}/boot -name "${DTB}"` 
>  			DTBS="${DTBS} ${DTB}"
>  			fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
>  		done
> @@ -369,7 +362,7 @@ fitimage_assemble() {
>  	#
>  	if [ "x${ramdiskcount}" = "x1" ] ; then
>  		# Find and use the first initramfs image archive type we find
> -		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
> +		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio ext2.gz; do
>  			initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
>  			echo "Using $initramfs_path"
>  			if [ -e "${initramfs_path}" ]; then



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

* [[PATCH v2] kernel-fitimage: fix ${KERNEL_DEVICETREE} includes subdirectory issue.
@ 2017-05-05  3:57 Chunrong Guo
  2017-05-05 11:14 ` Andreas Oberritter
  0 siblings, 1 reply; 5+ messages in thread
From: Chunrong Guo @ 2017-05-05  3:57 UTC (permalink / raw)
  To: openembedded-core; +Cc: chunrong.guo

From: Chunrong Guo <chunrong.guo@nxp.com>

    * For example:
      KERNEL_DEVICETREE ?= "freescale/fsl-ls1046a-rdb.dtb"

      ${DTB}= "freescale/fsl-ls1046a-rdb.dtb"

      but only the dtb name should be used.

    * Support "ext2.gz " filesystems

    * Support mutiple KERNEL_IMAGETYPE
      For example:
       KERNEL_IMAGETYPE = "Image"  or  KERNEL_IMAGETYPE = "zImage"

Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
---
 meta/classes/kernel-fitimage.bbclass | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 2630b47..63f03a5 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -10,7 +10,7 @@ python __anonymous () {
         if d.getVar("UBOOT_ARCH") == "x86":
             replacementtype = "bzImage"
         else:
-            replacementtype = "zImage"
+            replacementtype = d.getVar("KERNEL_IMAGETYPE")
 
 	# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
 	# to kernel.bbclass . We have to override it, since we pack zImage
@@ -342,15 +342,8 @@ fitimage_assemble() {
 	if [ -n "${KERNEL_DEVICETREE}" ]; then
 		dtbcount=1
 		for DTB in ${KERNEL_DEVICETREE}; do
-			if echo ${DTB} | grep -q '/dts/'; then
-				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
-				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
-			fi
-			DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
-			if [ ! -e "${DTB_PATH}" ]; then
-				DTB_PATH="arch/${ARCH}/boot/${DTB}"
-			fi
-
+                        DTB=`basename ${DTB}`
+			DTB_PATH=`find arch/${ARCH}/boot -name "${DTB}"` 
 			DTBS="${DTBS} ${DTB}"
 			fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
 		done
@@ -369,7 +362,7 @@ fitimage_assemble() {
 	#
 	if [ "x${ramdiskcount}" = "x1" ] ; then
 		# Find and use the first initramfs image archive type we find
-		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
+		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio ext2.gz; do
 			initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
 			echo "Using $initramfs_path"
 			if [ -e "${initramfs_path}" ]; then
-- 
1.9.0



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

end of thread, other threads:[~2017-05-09  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08  6:31 [[PATCH v2] kernel-fitimage: fix ${KERNEL_DEVICETREE} includes subdirectory issue Chunrong Guo
  -- strict thread matches above, loose matches on Subject: below --
2017-05-09  7:38 Chunrong Guo
2017-05-09  9:08 ` Andreas Oberritter
2017-05-05  3:57 Chunrong Guo
2017-05-05 11:14 ` Andreas Oberritter

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.