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