Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] siteinfo: Add mechanism to extend siteinfo information from BSP layer
Date: Fri, 22 Jul 2016 15:25:43 +0100	[thread overview]
Message-ID: <1469197543.23580.65.camel@linuxfoundation.org> (raw)

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




             reply	other threads:[~2016-07-22 14:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 14:25 Richard Purdie [this message]
     [not found] ` <CAMKF1srw4bVtAHrq6uOVU__WueXjoNwKRsvxLNLudt_zFyzrzQ@mail.gmail.com>
     [not found]   ` <CAMKF1sqzsoR=+FyXL99f+SZts6gxnNOfH0_MpX_y2M1FP-gbdA@mail.gmail.com>
2016-07-22 15:47     ` [PATCH] siteinfo: Add mechanism to extend siteinfo information from BSP layer Khem Raj
2016-07-22 15:55       ` Richard Purdie
2016-07-22 18:20         ` Khem Raj
2016-07-22 22:16           ` Richard Purdie
2016-07-23  1:28             ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469197543.23580.65.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox