Skip to contentSkip to conversation

u-boot.inc: fix rename image error

PATCH Superseded Chunrong Guo 2 participants 2 messages Mar 9, 2015

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 u-boot.inc: fix rename image error

  Resolve mismatch between U-Boot configs and uboot image name.
  The ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} may alway be false
  and repeat compile or install so we need to check if ${type} match ${config} .
---
 meta/recipes-bsp/u-boot/u-boot.inc | 52 ++++++++------------------------------
 1 file changed, 11 insertions(+), 41 deletions(-)
meta/recipes-bsp/u-boot/u-boot.inc +11 -41
index 6bdc86a..27fa809 100644
@@ -62,19 +62,13 @@ do_compile () {
 		echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
 		echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
 	fi
-    
+
     if [ "x${UBOOT_CONFIG}" != "x" ]
     then
         for config in ${UBOOT_MACHINE}; do
-            for type in in ${UBOOT_CONFIG}; do
-                if [ "${type}"x = "in"x ]
-                then
-                    continue
-                fi
-                if [ -d "${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX}" ]
+            for type in ${UBOOT_CONFIG}; do
+                if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
                 then
-                    break
-                else
                     oe_runmake O=${config} ${config}
                     oe_runmake O=${config} ${UBOOT_MAKE_TARGET}
                     cp  ${S}/${config}/${UBOOT_BINARY}  ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
@@ -92,15 +86,9 @@ do_install () {
     if [ "x${UBOOT_CONFIG}" != "x" ]
     then
         for config in ${UBOOT_MACHINE}; do
-            for type in in ${UBOOT_CONFIG}; do
-                if [ "${type}"x = "in"x ]
-                then
-                    continue
-                fi
-                if [ -d "${D}/boot/u-boot-${type}.${UBOOT_SUFFIX}" ]
+            for type in ${UBOOT_CONFIG}; do
+                if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
                 then
-                    break
-                else
                     install -d ${D}/boot
                     install ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}.${UBOOT_SUFFIX}
                     ln -sf u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
@@ -123,15 +111,9 @@ do_install () {
         if [ "x${UBOOT_CONFIG}" != "x" ]   
         then
             for config in ${UBOOT_MACHINE}; do
-                for type in in ${UBOOT_CONFIG}; do
-                     if [ "${type}"x = "in"x ]
+                for type in ${UBOOT_CONFIG}; do
+                     if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
                      then
-                         continue
-                     fi
-                     if [ -d "${D}/boot/${SPL_IMAGE}-${type}" ]
-                     then
-                         break
-                     else
                          install ${S}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}
                          ln -sf ${SPL_IMAGE}-${type} ${D}/boot/${SPL_BINARY}-${type}
                          ln -sf ${SPL_IMAGE}-${type} ${D}/boot/${SPL_BINARY}
@@ -157,15 +139,9 @@ do_deploy () {
     if [ "x${UBOOT_CONFIG}" != "x" ]
     then
         for config in ${UBOOT_MACHINE}; do
-            for type in in ${UBOOT_CONFIG}; do
-                if [ "${type}"x = "in"x ]  
+            for type in ${UBOOT_CONFIG}; do
+                if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
                 then
-                    continue
-                fi
-                if [ -d "${DEPLOYDIR}/u-boot-${type}.${UBOOT_SUFFIX}" ]
-                then 
-                    break
-                else
                     install -d ${DEPLOYDIR}
                     install ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}.${UBOOT_SUFFIX}
                     cd ${DEPLOYDIR}
@@ -190,15 +166,9 @@ do_deploy () {
          if [ "x${UBOOT_CONFIG}" != "x" ]   
          then
              for config in ${UBOOT_MACHINE}; do
-                 for type in in ${UBOOT_CONFIG}; do
-                      if [ "${type}"x = "in"x ]
-                      then
-                          continue
-                      fi
-                      if [ -d "${DEPLOYDIR}/${SPL_IMAGE}-${type}" ]
+                 for type in ${UBOOT_CONFIG}; do
+                      if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
                       then
-                          break
-                      else
                           install ${S}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}
                           rm -f ${DEPLOYDIR}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
                           ln -sf ${SPL_IMAGE}-${type} ${DEPLOYDIR}/${SPL_BINARY}-${type}
Signature · 1 line
1.9.2
#1 lore raw
Quoted 5 lines · Chunrong Guo
  Resolve mismatch between U-Boot configs and uboot image name.
  The ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} may alway be false
  and repeat compile or install so we need to check if ${type} match ${config} .

I think we have a serious issue here:

+ echo mx6qsabresd_config
+ cut -d_ -f2
+ [ config = sd ]
+ echo mx6qsabresd_sata_config
+ cut -d_ -f2
+ [ sata = sd ]
+ echo mx6qsabresd_config
+ cut -d_ -f2
+ [ config = sata ]
+ echo mx6qsabresd_sata_config
+ cut -d_ -f2
+ [ sata = sata ]
+ oe_runmake O=mx6qsabresd_sata_config mx6qsabresd_sata_config
+ oe_runmake_call O=mx6qsabresd_sata_config mx6qsabresd_sata_config

This is wrong. It shouldn't expect a pattern in the UBOOT_MACHINE value. Instead it should match the UBOOT_CONFIG for it and done.

Signature · 3 lines
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