[oe-commits] [openembedded-core] 02/72: siteinfo: Add mechanism to extend siteinfo information from BSP layer
git at git.openembedded.org
git at git.openembedded.org
Mon Jul 25 22:52:30 UTC 2016
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 2718bb9f2eabc15e3ef7cb5d67f4331de4f751d6
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Jul 22 15:25:43 2016 +0100
siteinfo: Add mechanism to extend siteinfo information from BSP layer
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>
---
meta/classes/siteinfo.bbclass | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
index 50141a3..03d4c4f 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)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list