All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine
@ 2014-12-11  3:32 Chunrong Guo
  2014-12-19  8:16 ` B40290
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chunrong Guo @ 2014-12-11  3:32 UTC (permalink / raw)
  To: openembedded-core

  This adds support to build multiple U-Boot configs for a machine; this
  is useful when we have support for different media boots which require
  different U-Boot configuration (e.g: eMMC and NAND).

Signed-off-by: Chunrong Guo <B40290@freescale.com>
---
 meta/classes/uboot-config.bbclass | 37 ++++++++++++++-----------------------
 1 file changed, 14 insertions(+), 23 deletions(-)

diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
index b467659..cb061af 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -31,28 +31,19 @@ python () {
         return
 
     ubootconfig = (d.getVar('UBOOT_CONFIG', True) or "").split()
-    if len(ubootconfig) > 1:
-        raise bb.parse.SkipPackage('You can only have a single default for UBOOT_CONFIG.')
+    if len(ubootconfig) > 0:
+        for config in ubootconfig:
+            for f, v in ubootconfigflags.items():
+                if config == f: 
+                    items = v.split(',')
+                    if items[0] and len(items) > 2:
+                        raise bb.parse.SkipPackage('Only config,images can be specified!')
+                    d.appendVar('UBOOT_MACHINE', ' ' + items[0])
+                    # IMAGE_FSTYPES appending
+                    if len(items) > 1 and items[1]:
+                        bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
+                        d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
+                    break
     elif len(ubootconfig) == 0:
-        raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
-    ubootconfig = ubootconfig[0]
-
-    for f, v in ubootconfigflags.items():
-        items = v.split(',')
-        if items[0] and len(items) > 2:
-            raise bb.parse.SkipPackage('Only config,images can be specified!')
-
-        if ubootconfig == f:
-            bb.debug(1, "Setting UBOOT_MACHINE to %s." % items[0])
-            d.setVar('UBOOT_MACHINE', items[0])
-
-            # IMAGE_FSTYPES appending
-            if len(items) > 1 and items[1]:
-                bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
-                d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
-
-            # Go out as we found a match!
-            break
-    else:
-        raise bb.parse.SkipPackage("UBOOT_CONFIG %s is not supported" % ubootconfig)
+       raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
 }
-- 
1.9.2



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

* Re: [PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine
  2014-12-11  3:32 [PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine Chunrong Guo
@ 2014-12-19  8:16 ` B40290
  2015-01-12  8:21 ` B40290
  2015-01-21 19:21 ` Denys Dmytriyenko
  2 siblings, 0 replies; 4+ messages in thread
From: B40290 @ 2014-12-19  8:16 UTC (permalink / raw)
  To: B40290, openembedded-core

Ping.

-----Original Message-----
From: Chunrong Guo [mailto:B40290@freescale.com] 
Sent: Thursday, December 11, 2014 11:33 AM
To: openembedded-core@lists.openembedded.org
Cc: Liu Ting-B28495; Luo Zhenhua-B19537; Guo Chunrong-B40290; Guo Chunrong-B40290
Subject: [OE-core][PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine

  This adds support to build multiple U-Boot configs for a machine; this
  is useful when we have support for different media boots which require
  different U-Boot configuration (e.g: eMMC and NAND).

Signed-off-by: Chunrong Guo <B40290@freescale.com>
---
 meta/classes/uboot-config.bbclass | 37 ++++++++++++++-----------------------
 1 file changed, 14 insertions(+), 23 deletions(-)

diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
index b467659..cb061af 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -31,28 +31,19 @@ python () {
         return
 
     ubootconfig = (d.getVar('UBOOT_CONFIG', True) or "").split()
-    if len(ubootconfig) > 1:
-        raise bb.parse.SkipPackage('You can only have a single default for UBOOT_CONFIG.')
+    if len(ubootconfig) > 0:
+        for config in ubootconfig:
+            for f, v in ubootconfigflags.items():
+                if config == f: 
+                    items = v.split(',')
+                    if items[0] and len(items) > 2:
+                        raise bb.parse.SkipPackage('Only config,images can be specified!')
+                    d.appendVar('UBOOT_MACHINE', ' ' + items[0])
+                    # IMAGE_FSTYPES appending
+                    if len(items) > 1 and items[1]:
+                        bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
+                        d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
+                    break
     elif len(ubootconfig) == 0:
-        raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
-    ubootconfig = ubootconfig[0]
-
-    for f, v in ubootconfigflags.items():
-        items = v.split(',')
-        if items[0] and len(items) > 2:
-            raise bb.parse.SkipPackage('Only config,images can be specified!')
-
-        if ubootconfig == f:
-            bb.debug(1, "Setting UBOOT_MACHINE to %s." % items[0])
-            d.setVar('UBOOT_MACHINE', items[0])
-
-            # IMAGE_FSTYPES appending
-            if len(items) > 1 and items[1]:
-                bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
-                d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
-
-            # Go out as we found a match!
-            break
-    else:
-        raise bb.parse.SkipPackage("UBOOT_CONFIG %s is not supported" % ubootconfig)
+       raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
 }
-- 
1.9.2



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

* Re: [PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine
  2014-12-11  3:32 [PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine Chunrong Guo
  2014-12-19  8:16 ` B40290
@ 2015-01-12  8:21 ` B40290
  2015-01-21 19:21 ` Denys Dmytriyenko
  2 siblings, 0 replies; 4+ messages in thread
From: B40290 @ 2015-01-12  8:21 UTC (permalink / raw)
  To: B40290, openembedded-core

Ping.


-----Original Message-----
From: Chunrong Guo [mailto:B40290@freescale.com] 
Sent: Thursday, December 11, 2014 11:33 AM
To: openembedded-core@lists.openembedded.org
Cc: Liu Ting-B28495; Luo Zhenhua-B19537; Guo Chunrong-B40290; Guo Chunrong-B40290
Subject: [OE-core][PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine

  This adds support to build multiple U-Boot configs for a machine; this
  is useful when we have support for different media boots which require
  different U-Boot configuration (e.g: eMMC and NAND).

Signed-off-by: Chunrong Guo <B40290@freescale.com>
---
 meta/classes/uboot-config.bbclass | 37 ++++++++++++++-----------------------
 1 file changed, 14 insertions(+), 23 deletions(-)

diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
index b467659..cb061af 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -31,28 +31,19 @@ python () {
         return
 
     ubootconfig = (d.getVar('UBOOT_CONFIG', True) or "").split()
-    if len(ubootconfig) > 1:
-        raise bb.parse.SkipPackage('You can only have a single default for UBOOT_CONFIG.')
+    if len(ubootconfig) > 0:
+        for config in ubootconfig:
+            for f, v in ubootconfigflags.items():
+                if config == f: 
+                    items = v.split(',')
+                    if items[0] and len(items) > 2:
+                        raise bb.parse.SkipPackage('Only config,images can be specified!')
+                    d.appendVar('UBOOT_MACHINE', ' ' + items[0])
+                    # IMAGE_FSTYPES appending
+                    if len(items) > 1 and items[1]:
+                        bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
+                        d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
+                    break
     elif len(ubootconfig) == 0:
-        raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
-    ubootconfig = ubootconfig[0]
-
-    for f, v in ubootconfigflags.items():
-        items = v.split(',')
-        if items[0] and len(items) > 2:
-            raise bb.parse.SkipPackage('Only config,images can be specified!')
-
-        if ubootconfig == f:
-            bb.debug(1, "Setting UBOOT_MACHINE to %s." % items[0])
-            d.setVar('UBOOT_MACHINE', items[0])
-
-            # IMAGE_FSTYPES appending
-            if len(items) > 1 and items[1]:
-                bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
-                d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
-
-            # Go out as we found a match!
-            break
-    else:
-        raise bb.parse.SkipPackage("UBOOT_CONFIG %s is not supported" % ubootconfig)
+       raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
 }
-- 
1.9.2



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

* Re: [PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine
  2014-12-11  3:32 [PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine Chunrong Guo
  2014-12-19  8:16 ` B40290
  2015-01-12  8:21 ` B40290
@ 2015-01-21 19:21 ` Denys Dmytriyenko
  2 siblings, 0 replies; 4+ messages in thread
From: Denys Dmytriyenko @ 2015-01-21 19:21 UTC (permalink / raw)
  To: Chunrong Guo; +Cc: openembedded-core

On Thu, Dec 11, 2014 at 11:32:35AM +0800, Chunrong Guo wrote:
>   This adds support to build multiple U-Boot configs for a machine; this
>   is useful when we have support for different media boots which require
>   different U-Boot configuration (e.g: eMMC and NAND).

Any examples how to use this?

-- 
Denys


> Signed-off-by: Chunrong Guo <B40290@freescale.com>
> ---
>  meta/classes/uboot-config.bbclass | 37 ++++++++++++++-----------------------
>  1 file changed, 14 insertions(+), 23 deletions(-)
> 
> diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
> index b467659..cb061af 100644
> --- a/meta/classes/uboot-config.bbclass
> +++ b/meta/classes/uboot-config.bbclass
> @@ -31,28 +31,19 @@ python () {
>          return
>  
>      ubootconfig = (d.getVar('UBOOT_CONFIG', True) or "").split()
> -    if len(ubootconfig) > 1:
> -        raise bb.parse.SkipPackage('You can only have a single default for UBOOT_CONFIG.')
> +    if len(ubootconfig) > 0:
> +        for config in ubootconfig:
> +            for f, v in ubootconfigflags.items():
> +                if config == f: 
> +                    items = v.split(',')
> +                    if items[0] and len(items) > 2:
> +                        raise bb.parse.SkipPackage('Only config,images can be specified!')
> +                    d.appendVar('UBOOT_MACHINE', ' ' + items[0])
> +                    # IMAGE_FSTYPES appending
> +                    if len(items) > 1 and items[1]:
> +                        bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
> +                        d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
> +                    break
>      elif len(ubootconfig) == 0:
> -        raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
> -    ubootconfig = ubootconfig[0]
> -
> -    for f, v in ubootconfigflags.items():
> -        items = v.split(',')
> -        if items[0] and len(items) > 2:
> -            raise bb.parse.SkipPackage('Only config,images can be specified!')
> -
> -        if ubootconfig == f:
> -            bb.debug(1, "Setting UBOOT_MACHINE to %s." % items[0])
> -            d.setVar('UBOOT_MACHINE', items[0])
> -
> -            # IMAGE_FSTYPES appending
> -            if len(items) > 1 and items[1]:
> -                bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
> -                d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
> -
> -            # Go out as we found a match!
> -            break
> -    else:
> -        raise bb.parse.SkipPackage("UBOOT_CONFIG %s is not supported" % ubootconfig)
> +       raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
>  }
> -- 
> 1.9.2
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

end of thread, other threads:[~2015-01-21 19:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11  3:32 [PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine Chunrong Guo
2014-12-19  8:16 ` B40290
2015-01-12  8:21 ` B40290
2015-01-21 19:21 ` Denys Dmytriyenko

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.