All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel-fitimage: fix ${KERNEL_DEVICETREE} includes subdirectory issue.
@ 2017-05-04  9:08 Chunrong Guo
  2017-05-04 17:31 ` Andreas Oberritter
  0 siblings, 1 reply; 2+ messages in thread
From: Chunrong Guo @ 2017-05-04  9:08 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 | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 2630b47..33b477f 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
@@ -233,6 +233,7 @@ EOF
 # $4 ... ramdisk ID
 # $5 ... config ID
 # $6 ... default flag
+# $7 ... DTB image path 
 fitimage_emit_section_config() {
 
 	conf_csum="sha1"
@@ -346,13 +347,14 @@ fitimage_assemble() {
 				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
+                        DTBNAME=`basename ${DTB}`
 			DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
 			if [ ! -e "${DTB_PATH}" ]; then
 				DTB_PATH="arch/${ARCH}/boot/${DTB}"
 			fi
 
 			DTBS="${DTBS} ${DTB}"
-			fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
+			fitimage_emit_section_dtb ${1} ${DTBNAME} ${DTB_PATH}
 		done
 	fi
 
@@ -369,7 +371,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
@@ -395,7 +397,8 @@ fitimage_assemble() {
 	if [ -n "${DTBS}" ]; then
 		i=1
 		for DTB in ${DTBS}; do
-			fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
+                        DTBNAME=`basename ${DTB}`
+			fitimage_emit_section_config ${1} "${kernelcount}" "${DTBNAME}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}` "${DTB}""
 			i=`expr ${i} + 1`
 		done
 	fi
-- 
1.9.0



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

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

On Thu, 4 May 2017 17:08:40 +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 | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
> index 2630b47..33b477f 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")

I'm not sure whether the KERNEL_IMAGETYPES variable needs to get considered, too.

>  
>  	# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
>  	# to kernel.bbclass . We have to override it, since we pack zImage
> @@ -233,6 +233,7 @@ EOF
>  # $4 ... ramdisk ID
>  # $5 ... config ID
>  # $6 ... default flag
> +# $7 ... DTB image path 
>  fitimage_emit_section_config() {
>  
>  	conf_csum="sha1"
> @@ -346,13 +347,14 @@ fitimage_assemble() {
>  				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
> +                        DTBNAME=`basename ${DTB}`
>  			DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
>  			if [ ! -e "${DTB_PATH}" ]; then
>  				DTB_PATH="arch/${ARCH}/boot/${DTB}"
>  			fi

How about replacing the lines above with DTB_PATH=`find arch/${ARCH}/boot -name "${DTB}"`
or a similar construct?

This would work with KERNEL_DEVICETREE ?= "fsl-ls1046a-rdb.dtb", which would
also match the make target IIRC.

Regards,
Andreas


>  
>  			DTBS="${DTBS} ${DTB}"
> -			fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
> +			fitimage_emit_section_dtb ${1} ${DTBNAME} ${DTB_PATH}
>  		done
>  	fi
>  
> @@ -369,7 +371,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
> @@ -395,7 +397,8 @@ fitimage_assemble() {
>  	if [ -n "${DTBS}" ]; then
>  		i=1
>  		for DTB in ${DTBS}; do
> -			fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
> +                        DTBNAME=`basename ${DTB}`
> +			fitimage_emit_section_config ${1} "${kernelcount}" "${DTBNAME}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}` "${DTB}""
>  			i=`expr ${i} + 1`
>  		done
>  	fi



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

end of thread, other threads:[~2017-05-04 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-04  9:08 [PATCH] kernel-fitimage: fix ${KERNEL_DEVICETREE} includes subdirectory issue Chunrong Guo
2017-05-04 17:31 ` 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.