Patchwork [meta-fsl-arm] image_types_fsl.bbclass: Fix imx-bootlets build with new image code

login
register
mail settings
Submitter Otavio Salvador
Date Feb. 27, 2014, 9:04 p.m.
Message ID <1393535097-10189-1-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/67651/
State Accepted
Delegated to: Otavio Salvador
Headers show

Comments

Otavio Salvador - Feb. 27, 2014, 9:04 p.m.
Since the image_types.bbclass is not cd'ing to ${DEPLOY_DIR_IMAGE}
anymore, the imx-bootlets code need to be reworked to take this into
account.

Change-Id: Ic7890557e93b47997590143047816ecb0378ad13
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 classes/image_types_fsl.bbclass | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Alexandre Belloni - Feb. 28, 2014, 9:54 a.m.
On 27/02/2014 at 18:04:57 -0300, Otavio Salvador wrote :
> Since the image_types.bbclass is not cd'ing to ${DEPLOY_DIR_IMAGE}
> anymore, the imx-bootlets code need to be reworked to take this into
> account.
> 
> Change-Id: Ic7890557e93b47997590143047816ecb0378ad13
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

So it was broken :)

Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

> ---
>  classes/image_types_fsl.bbclass | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/classes/image_types_fsl.bbclass b/classes/image_types_fsl.bbclass
> index f0160df..47e8338 100644
> --- a/classes/image_types_fsl.bbclass
> +++ b/classes/image_types_fsl.bbclass
> @@ -15,8 +15,8 @@ UBOOT_SUFFIX_SDCARD ?= "${UBOOT_SUFFIX}"
>  IMAGE_DEPENDS_linux.sb = "elftosb-native imx-bootlets virtual/kernel"
>  IMAGE_LINK_NAME_linux.sb = ""
>  IMAGE_CMD_linux.sb () {
> -	kernel_bin="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.bin`"
> -	kernel_dtb="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.dtb || true`"
> +	kernel_bin="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin`"
> +	kernel_dtb="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.dtb || true`"
>  	linux_bd_file=imx-bootlets-linux.bd-${MACHINE}
>  	if [ `basename $kernel_bin .bin` = `basename $kernel_dtb .dtb` ]; then
>  		# When using device tree we build a zImage with the dtb
> @@ -24,16 +24,16 @@ IMAGE_CMD_linux.sb () {
>  		linux_bd_file=imx-bootlets-linux.bd-dtb-${MACHINE}
>  		cat $kernel_bin $kernel_dtb \
>  		    > $kernel_bin-dtb
> -		rm -f ${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
> -		ln -s $kernel_bin-dtb ${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
> +		rm -f ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
> +		ln -s $kernel_bin-dtb ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
>  	fi
>  
>  	# Ensure the file is generated
> -	rm -f ${IMAGE_NAME}.linux.sb
> -	elftosb -z -c $linux_bd_file -o ${IMAGE_NAME}.linux.sb
> +	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.linux.sb
> +	(cd ${DEPLOY_DIR_IMAGE}; elftosb -z -c $linux_bd_file -o ${IMAGE_NAME}.linux.sb)
>  
>  	# Remove the appended file as it is only used here
> -	rm -f $kernel_bin-dtb
> +	rm -f ${DEPLOY_DIR_IMAGE}/$kernel_bin-dtb
>  }
>  
>  # IMX Bootlets barebox bootstream
> -- 
> 1.9.0
> 
> _______________________________________________
> meta-freescale mailing list
> meta-freescale@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale
Daiane Angolini - Feb. 28, 2014, 12:10 p.m.
> -----Original Message-----
> From: meta-freescale-bounces@yoctoproject.org [mailto:meta-freescale-
> bounces@yoctoproject.org] On Behalf Of Otavio Salvador
> Sent: Thursday, February 27, 2014 6:05 PM
> To: meta-freescale Mailing List
> Cc: Otavio Salvador
> Subject: [meta-freescale] [meta-fsl-arm][PATCH] image_types_fsl.bbclass:
> Fix imx-bootlets build with new image code
> 
> Since the image_types.bbclass is not cd'ing to ${DEPLOY_DIR_IMAGE} anymore,
> the imx-bootlets code need to be reworked to take this into account.

Nice! I´m happy you was able to get this done, Otavio ;-)

Reviewed-by,
Daiane


> 
> Change-Id: Ic7890557e93b47997590143047816ecb0378ad13
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  classes/image_types_fsl.bbclass | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/classes/image_types_fsl.bbclass
> b/classes/image_types_fsl.bbclass index f0160df..47e8338 100644
> --- a/classes/image_types_fsl.bbclass
> +++ b/classes/image_types_fsl.bbclass
> @@ -15,8 +15,8 @@ UBOOT_SUFFIX_SDCARD ?= "${UBOOT_SUFFIX}"
>  IMAGE_DEPENDS_linux.sb = "elftosb-native imx-bootlets virtual/kernel"
>  IMAGE_LINK_NAME_linux.sb = ""
>  IMAGE_CMD_linux.sb () {
> -	kernel_bin="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.bin`"
> -	kernel_dtb="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.dtb || true`"
> +	kernel_bin="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-
> ${MACHINE}.bin`"
> +	kernel_dtb="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-
> ${MACHINE}.dtb || true`"
>  	linux_bd_file=imx-bootlets-linux.bd-${MACHINE}
>  	if [ `basename $kernel_bin .bin` = `basename $kernel_dtb .dtb` ];
> then
>  		# When using device tree we build a zImage with the dtb @@ -
> 24,16 +24,16 @@ IMAGE_CMD_linux.sb () {
>  		linux_bd_file=imx-bootlets-linux.bd-dtb-${MACHINE}
>  		cat $kernel_bin $kernel_dtb \
>  		    > $kernel_bin-dtb
> -		rm -f ${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
> -		ln -s $kernel_bin-dtb ${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
> +		rm -f ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin-
> dtb
> +		ln -s $kernel_bin-dtb
> +${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
>  	fi
> 
>  	# Ensure the file is generated
> -	rm -f ${IMAGE_NAME}.linux.sb
> -	elftosb -z -c $linux_bd_file -o ${IMAGE_NAME}.linux.sb
> +	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.linux.sb
> +	(cd ${DEPLOY_DIR_IMAGE}; elftosb -z -c $linux_bd_file -o
> +${IMAGE_NAME}.linux.sb)
> 
>  	# Remove the appended file as it is only used here
> -	rm -f $kernel_bin-dtb
> +	rm -f ${DEPLOY_DIR_IMAGE}/$kernel_bin-dtb
>  }
> 
>  # IMX Bootlets barebox bootstream
> --
> 1.9.0
> 
> _______________________________________________
> meta-freescale mailing list
> meta-freescale@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale
>

Patch

diff --git a/classes/image_types_fsl.bbclass b/classes/image_types_fsl.bbclass
index f0160df..47e8338 100644
--- a/classes/image_types_fsl.bbclass
+++ b/classes/image_types_fsl.bbclass
@@ -15,8 +15,8 @@  UBOOT_SUFFIX_SDCARD ?= "${UBOOT_SUFFIX}"
 IMAGE_DEPENDS_linux.sb = "elftosb-native imx-bootlets virtual/kernel"
 IMAGE_LINK_NAME_linux.sb = ""
 IMAGE_CMD_linux.sb () {
-	kernel_bin="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.bin`"
-	kernel_dtb="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.dtb || true`"
+	kernel_bin="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin`"
+	kernel_dtb="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.dtb || true`"
 	linux_bd_file=imx-bootlets-linux.bd-${MACHINE}
 	if [ `basename $kernel_bin .bin` = `basename $kernel_dtb .dtb` ]; then
 		# When using device tree we build a zImage with the dtb
@@ -24,16 +24,16 @@  IMAGE_CMD_linux.sb () {
 		linux_bd_file=imx-bootlets-linux.bd-dtb-${MACHINE}
 		cat $kernel_bin $kernel_dtb \
 		    > $kernel_bin-dtb
-		rm -f ${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
-		ln -s $kernel_bin-dtb ${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
+		rm -f ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
+		ln -s $kernel_bin-dtb ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb
 	fi
 
 	# Ensure the file is generated
-	rm -f ${IMAGE_NAME}.linux.sb
-	elftosb -z -c $linux_bd_file -o ${IMAGE_NAME}.linux.sb
+	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.linux.sb
+	(cd ${DEPLOY_DIR_IMAGE}; elftosb -z -c $linux_bd_file -o ${IMAGE_NAME}.linux.sb)
 
 	# Remove the appended file as it is only used here
-	rm -f $kernel_bin-dtb
+	rm -f ${DEPLOY_DIR_IMAGE}/$kernel_bin-dtb
 }
 
 # IMX Bootlets barebox bootstream