Patchwork [meta-fsl-arm-extra] u-boot-script-boundary: Use bb vars for overrides

login
register
mail settings
Submitter Christoph Settgast
Date July 11, 2014, 12:29 p.m.
Message ID <1405081756-24440-1-git-send-email-christoph.settgast@methodpark.de>
Download mbox | patch
Permalink /patch/75377/
State Accepted
Delegated to: Otavio Salvador
Headers show

Comments

Christoph Settgast - July 11, 2014, 12:29 p.m.
When using bitbake variables, overrides in bbappends are possible.
The embedded shell variables did not allow this.

Signed-off-by: Christoph Settgast <christoph.settgast@methodpark.de>
---
 recipes-bsp/u-boot/u-boot-script-boundary_git.bb |   32 ++++++++--------------
 1 file changed, 11 insertions(+), 21 deletions(-)
Eric Nelson - July 11, 2014, 1:41 p.m.
Thanks Christoph,

On 07/11/2014 05:29 AM, Christoph Settgast wrote:
> When using bitbake variables, overrides in bbappends are possible.
> The embedded shell variables did not allow this.
> 
> Signed-off-by: Christoph Settgast <christoph.settgast@methodpark.de>
> ---
>  recipes-bsp/u-boot/u-boot-script-boundary_git.bb |   32 ++++++++--------------
>  1 file changed, 11 insertions(+), 21 deletions(-)
> 
> diff --git a/recipes-bsp/u-boot/u-boot-script-boundary_git.bb b/recipes-bsp/u-boot/u-boot-script-boundary_git.bb
> index b39d963..df4b76f 100644
> --- a/recipes-bsp/u-boot/u-boot-script-boundary_git.bb
> +++ b/recipes-bsp/u-boot/u-boot-script-boundary_git.bb
> @@ -12,35 +12,25 @@ S = "${WORKDIR}/git"
>  
>  inherit deploy
>  
> -do_mkimage () {
> +BOOTSCRIPT = "${S}/board/boundary/${MACHINE}/6x_bootscript-yocto.txt"
> +BOOTSCRIPT_nitrogen6x-lite = "${S}/board/boundary/nit6xlite/6x_bootscript-yocto.txt"
>  
> -    boarddir=nitrogen6x;
> -    if test "${MACHINE}" = "nitrogen6x-lite"; then
> -            boarddir=nit6xlite;
> -    fi
> +UPGRADESCRIPT = "${S}/board/boundary/${MACHINE}/6x_upgrade.txt"
> +UPGRADESCRIPT_nitrogen6x-lite = "${S}/board/boundary/nitrogen6x/6x_upgrade.txt"
>  
> +do_mkimage () {
>      # allow deploy to use the ${MACHINE} name to simplify things
>      if [ ! -d board/boundary/${MACHINE} ]; then
>          mkdir board/boundary/${MACHINE}
>      fi
> -    bootscript=board/boundary/${boarddir}/6x_bootscript-yocto.txt;
> -    if ! [ -f $bootscript ]; then
> -        bootscript=board/boundary/${boarddir}/6x_bootscript-yocto.txt;
> -    fi
> -    echo "bootscript == $bootscript"
> -
> -    upgradescript=board/boundary/${boarddir}/6x_upgrade.txt;
> -    if ! [ -f $upgradescript ]; then
> -        upgradescript=board/boundary/nitrogen6x/6x_upgrade.txt;
> -    fi
>  
> -    uboot-mkimage  -A arm -O linux -T script -C none -a 0 -e 0 \
> -                   -n "boot script" -d $bootscript \
> -                   board/boundary/${MACHINE}/6x_bootscript
> +    uboot-mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
> +                  -n "boot script" -d ${BOOTSCRIPT} \
> +                  board/boundary/${MACHINE}/6x_bootscript
>  
> -    uboot-mkimage  -A arm -O linux -T script -C none -a 0 -e 0 \
> -                   -n "upgrade script" -d $upgradescript \
> -                   board/boundary/${MACHINE}/6x_upgrade
> +    uboot-mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
> +                  -n "upgrade script" -d ${UPGRADESCRIPT} \
> +                  board/boundary/${MACHINE}/6x_upgrade
>  }
>  
>  addtask mkimage after do_compile before do_install
> 

Reviewed-by: Eric Nelson <eric.nelson@boundarydevices.com>

Patch

diff --git a/recipes-bsp/u-boot/u-boot-script-boundary_git.bb b/recipes-bsp/u-boot/u-boot-script-boundary_git.bb
index b39d963..df4b76f 100644
--- a/recipes-bsp/u-boot/u-boot-script-boundary_git.bb
+++ b/recipes-bsp/u-boot/u-boot-script-boundary_git.bb
@@ -12,35 +12,25 @@  S = "${WORKDIR}/git"
 
 inherit deploy
 
-do_mkimage () {
+BOOTSCRIPT = "${S}/board/boundary/${MACHINE}/6x_bootscript-yocto.txt"
+BOOTSCRIPT_nitrogen6x-lite = "${S}/board/boundary/nit6xlite/6x_bootscript-yocto.txt"
 
-    boarddir=nitrogen6x;
-    if test "${MACHINE}" = "nitrogen6x-lite"; then
-            boarddir=nit6xlite;
-    fi
+UPGRADESCRIPT = "${S}/board/boundary/${MACHINE}/6x_upgrade.txt"
+UPGRADESCRIPT_nitrogen6x-lite = "${S}/board/boundary/nitrogen6x/6x_upgrade.txt"
 
+do_mkimage () {
     # allow deploy to use the ${MACHINE} name to simplify things
     if [ ! -d board/boundary/${MACHINE} ]; then
         mkdir board/boundary/${MACHINE}
     fi
-    bootscript=board/boundary/${boarddir}/6x_bootscript-yocto.txt;
-    if ! [ -f $bootscript ]; then
-        bootscript=board/boundary/${boarddir}/6x_bootscript-yocto.txt;
-    fi
-    echo "bootscript == $bootscript"
-
-    upgradescript=board/boundary/${boarddir}/6x_upgrade.txt;
-    if ! [ -f $upgradescript ]; then
-        upgradescript=board/boundary/nitrogen6x/6x_upgrade.txt;
-    fi
 
-    uboot-mkimage  -A arm -O linux -T script -C none -a 0 -e 0 \
-                   -n "boot script" -d $bootscript \
-                   board/boundary/${MACHINE}/6x_bootscript
+    uboot-mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+                  -n "boot script" -d ${BOOTSCRIPT} \
+                  board/boundary/${MACHINE}/6x_bootscript
 
-    uboot-mkimage  -A arm -O linux -T script -C none -a 0 -e 0 \
-                   -n "upgrade script" -d $upgradescript \
-                   board/boundary/${MACHINE}/6x_upgrade
+    uboot-mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+                  -n "upgrade script" -d ${UPGRADESCRIPT} \
+                  board/boundary/${MACHINE}/6x_upgrade
 }
 
 addtask mkimage after do_compile before do_install