[OE-core] [PATCH] siteinfo: Add mechanism to extend siteinfo information from BSP layer

Khem Raj raj.khem at gmail.com
Fri Jul 22 15:47:14 UTC 2016


Whats the motivation here. This looks like a backdoor for bsps. To user it
will make inconsistent behaviour. Even now its quite hard to root cause
errors due to siteinfo

On Jul 22, 2016 7:26 AM, "Richard Purdie" <
richard.purdie at linuxfoundation.org> wrote:
>
> In order to add a new architecture or sub-architecture to OE, you
currently
> need to tweak the table in siteinfo.bbclass. This adds a mechanism so this
> can be done from a BSP layer. It needs a function definition which needs
> a class file but can then be done with something like:
>
> def rp_testfunc2(archinfo, osinfo, targetinfo, d):
>     archinfo['testarch'] = "little-endian bit-32"
>     osinfo['testos'] = "common-linux"
>     targetinfo['mymach-linux'] = "mymach-linux-common"
>
>     return archinfo, osinfo, targetinfo
>
> SITEINFO_EXTRA_DATAFUNCS = "rp_testfunc2"
>
> [YOCTO #8554]
>
> Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
>
> diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
> index 50141a3..3c9ab2a 100644
> --- a/meta/classes/siteinfo.bbclass
> +++ b/meta/classes/siteinfo.bbclass
> @@ -107,6 +107,14 @@ def siteinfo_data(d):
>          "x86_64-mingw32": "bit-64",
>      }
>
> +    # Add in any extra user supplied data which may come from a BSP
layer, removing the
> +    # need to always change this class directly
> +    extra_siteinfo = (d.getVar("SITEINFO_EXTRA_DATAFUNCS", True) or
"").split()
> +    for m in extra_siteinfo:
> +        call = m + "(archinfo, osinfo, targetinfo, d)"
> +        locs = { "archinfo" : archinfo, "osinfo" : osinfo, "targetinfo"
: targetinfo, "d" : d}
> +        archinfo, osinfo, targetinfo = bb.utils.better_eval(call, locs)
> +
>      hostarch = d.getVar("HOST_ARCH", True)
>      hostos = d.getVar("HOST_OS", True)
>      target = "%s-%s" % (hostarch, hostos)
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160722/10d2809c/attachment-0002.html>


More information about the Openembedded-core mailing list