summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-22 15:25:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-26 08:56:25 +0100
commitebc80fa30a98484b7fd1d568bd0f3d701a6f68d5 (patch)
treef92ce05e7950e3f5a789de31d2291420f2bc9aa1 /meta/classes
parente693f2e641afa88dfb53371482e9c5be8dc8eb92 (diff)
downloadpoky-ebc80fa30a98484b7fd1d568bd0f3d701a6f68d5.tar.gz
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] (From OE-Core rev: 2718bb9f2eabc15e3ef7cb5d67f4331de4f751d6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/siteinfo.bbclass8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
index 50141a353f..03d4c4fd20 100644
--- a/meta/classes/siteinfo.bbclass
+++ b/meta/classes/siteinfo.bbclass
@@ -107,6 +107,14 @@ def siteinfo_data(d):
107 "x86_64-mingw32": "bit-64", 107 "x86_64-mingw32": "bit-64",
108 } 108 }
109 109
110 # Add in any extra user supplied data which may come from a BSP layer, removing the
111 # need to always change this class directly
112 extra_siteinfo = (d.getVar("SITEINFO_EXTRA_DATAFUNCS", True) or "").split()
113 for m in extra_siteinfo:
114 call = m + "(archinfo, osinfo, targetinfo, d)"
115 locs = { "archinfo" : archinfo, "osinfo" : osinfo, "targetinfo" : targetinfo, "d" : d}
116 archinfo, osinfo, targetinfo = bb.utils.better_eval(call, locs)
117
110 hostarch = d.getVar("HOST_ARCH", True) 118 hostarch = d.getVar("HOST_ARCH", True)
111 hostos = d.getVar("HOST_OS", True) 119 hostos = d.getVar("HOST_OS", True)
112 target = "%s-%s" % (hostarch, hostos) 120 target = "%s-%s" % (hostarch, hostos)