All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 4/9] copy_buildsystem.py: Add methods to copy shared state.
Date: Mon, 23 Feb 2015 17:00:38 +0000	[thread overview]
Message-ID: <c869bdd23d67ed0253f78fa3829deb5a5a35e1ae.1424709353.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1424709353.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1424709353.git.paul.eggleton@linux.intel.com>

From: Randy Witt <randy.e.witt@linux.intel.com>

Added the helper functions necessary to copy the sstate from the
current build, and generate the file to "lock" it.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/copy_buildsystem.py | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
index 5a4d8c3..cf7fada 100644
--- a/meta/lib/oe/copy_buildsystem.py
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -68,3 +68,35 @@ class BuildSystem(object):
                     _smart_copy(layer, layerdestpath)
 
         return layers_copied
+
+def generate_locked_sigs(sigfile, d):
+    bb.utils.mkdirhier(os.path.dirname(sigfile))
+    depd = d.getVar('BB_TASKDEPDATA', True)
+    tasks = ['%s.%s' % (v[2], v[1]) for v in depd.itervalues()]
+    bb.parse.siggen.dump_lockedsigs(sigfile, tasks)
+
+def prune_lockedsigs(allowed_tasks, excluded_targets, lockedsigs, pruned_output):
+    with open(lockedsigs, 'r') as infile:
+        bb.utils.mkdirhier(os.path.dirname(pruned_output))
+        with open(pruned_output, 'w') as f:
+            invalue = False
+            for line in infile:
+                if invalue:
+                    if line.endswith('\\\n'):
+                        splitval = line.strip().split(':')
+                        if splitval[1] in allowed_tasks and not splitval[0] in excluded_targets:
+                            f.write(line)
+                    else:
+                        f.write(line)
+                        invalue = False
+                elif line.startswith('SIGGEN_LOCKEDSIGS'):
+                    invalue = True
+                    f.write(line)
+
+def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cache, d, fixedlsbstring=""):
+    bb.note('Generating sstate-cache...')
+
+    bb.process.run("gen-lockedsig-cache %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache))
+    if fixedlsbstring:
+        os.rename(output_sstate_cache + '/' + d.getVar('NATIVELSBSTRING', True),
+        output_sstate_cache + '/' + fixedlsbstring)
-- 
1.9.3



  parent reply	other threads:[~2015-02-23 17:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 17:00 [PATCH 0/9] Extensible SDK Paul Eggleton
2015-02-23 17:00 ` [PATCH 1/9] gen-lockedsig-cache: Allow cross-filesystem copies Paul Eggleton
2015-02-23 17:00 ` [PATCH 2/9] sstatesig: Add ability to filter list of tasks for locked-sigs.inc Paul Eggleton
2015-02-23 17:00 ` [PATCH 3/9] copy_buildsystem.py: Add a way to copy buildsystem to a directory Paul Eggleton
2015-02-23 17:00 ` Paul Eggleton [this message]
2015-02-23 17:00 ` [PATCH 5/9] toolchain-scripts: Add parameters to toolchain_create_sdk_env_script Paul Eggleton
2015-02-23 17:00 ` [PATCH 6/9] toolchain-shar-template.sh: Make relocation optional Paul Eggleton
2015-02-23 17:00 ` [PATCH 7/9] uninative-tarball: Actually use bzip2 for compression Paul Eggleton
2015-02-23 17:00 ` [PATCH 8/9] scripts/oe-buildenv-internal: add means of skipping SDK check during setup Paul Eggleton
2015-02-23 17:00 ` [PATCH 9/9] populate_sdk_ext: add extensible SDK Paul Eggleton
2015-02-23 17:41   ` Otavio Salvador
2015-02-23 17:54     ` Paul Eggleton
2015-02-23 18:00       ` Otavio Salvador
2015-02-23 18:06         ` Richard Purdie
2015-02-23 18:11           ` Otavio Salvador
2015-02-23 18:29             ` Paul Eggleton
2015-02-23 22:33             ` Richard Purdie

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=c869bdd23d67ed0253f78fa3829deb5a5a35e1ae.1424709353.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.