[OE-core] [PATCH 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine

Otavio Salvador otavio at ossystems.com.br
Thu Nov 20 13:36:39 UTC 2014


Hello Chunrong,

On Thu, Nov 20, 2014 at 8:06 AM, Chunrong Guo <B40290 at freescale.com> wrote:
>      *This class provides a system similar to PACKAGECONFIG but for U-Boot.
>       The format is: UBOOT_CONFIG ??= <default> UBOOT_CONFIG[foo] = "config,images"
>       Below there's an usage example: ,----[ i.MX6Q SABRE AUTO based example ]
>      | UBOOT_CONFIG ??= "sd eimnor nand"
>      | UBOOT_CONFIG[sd] = "mx6qsabreauto_config,sdcard"
>      | UBOOT_CONFIG[eimnor] = "mx6qsabreauto_eimnor_config"
>      | UBOOT_CONFIG[nand] = "mx6qsabreauto_nand_config,ubifs"
>      | UBOOT_CONFIG[spinor] = "mx6qsabreauto_spinor_config"
>
> Signed-off-by: Chunrong Guo <B40290 at freescale.com>

I would prefer if you explain what this patch "adds" on top of the
original class; the commit log is very close of the initial commit log
when I included the class on the OE-Core.

Maybe something in like as:

...
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).
...

> ---
>  meta/classes/uboot-config.bbclass | 40 ++++++++++++++-------------------------
>  1 file changed, 14 insertions(+), 26 deletions(-)
>
> diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
> index 8ac1b71..f02ca58 100644
> --- a/meta/classes/uboot-config.bbclass
> +++ b/meta/classes/uboot-config.bbclass
> @@ -31,31 +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 f == 'defaultval':
> +                    continue
> +                if config == f:
> +                    flag =  f.split(' ')

This is new and I fail to see why you are using the split here.

> +                    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])
> +                    d.appendVar('IMAGE_FSTYPES', ' ' + flag[0])

This should be items[1] as previous code or you will break backward
compatibility.

> +                    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():
> -        if f == 'defaultval':
> -            continue
> -
> -        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 at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



-- 
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



More information about the Openembedded-core mailing list