diff options
author | Christopher Larson <chris_larson@mentor.com> | 2018-07-27 22:24:28 +0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-16 09:49:39 +0100 |
commit | bb3a1321cdffa767c83ee33b83ec4b8524e289c2 (patch) | |
tree | f2fa8acb31a5391665daf5fc79a6ab72f69349be | |
parent | 85518a20017c1a091f3a393f09fb2ceffe057bed (diff) | |
download | poky-bb3a1321cdffa767c83ee33b83ec4b8524e289c2.tar.gz |
image-postinst-intercepts.bbclass: add class
This class sets POSTINST_INTERCEPTS and POSTINST_INTERCEPTS_CHECKSUMS,
to allow us to pull intercepts from BBPATH. This is kept as a separate
class, as it's needed by both image construction and sdk construction,
the latter to support meta-toolchain & similar recipes.
(From OE-Core rev: 7a2044df4ae8d80cf25a6bfd9b71978ffefbfa33)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/image-postinst-intercepts.bbclass | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/classes/image-postinst-intercepts.bbclass b/meta/classes/image-postinst-intercepts.bbclass new file mode 100644 index 0000000000..ed30bbd98d --- /dev/null +++ b/meta/classes/image-postinst-intercepts.bbclass | |||
@@ -0,0 +1,23 @@ | |||
1 | # Gather existing and candidate postinst intercepts from BBPATH | ||
2 | POSTINST_INTERCEPTS_DIR ?= "${COREBASE}/scripts/postinst-intercepts" | ||
3 | POSTINST_INTERCEPTS_PATHS ?= "${@':'.join('%s/postinst-intercepts' % p for p in '${BBPATH}'.split(':'))}:${POSTINST_INTERCEPTS_DIR}" | ||
4 | |||
5 | python find_intercepts() { | ||
6 | intercepts = {} | ||
7 | search_paths = [] | ||
8 | paths = d.getVar('POSTINST_INTERCEPTS_PATHS').split(':') | ||
9 | overrides = (':' + d.getVar('FILESOVERRIDES')).split(':') + [''] | ||
10 | search_paths = [os.path.join(p, op) for p in paths for op in overrides] | ||
11 | searched = oe.path.which_wild('*', ':'.join(search_paths), candidates=True) | ||
12 | files, chksums = [], [] | ||
13 | for pathname, candidates in searched: | ||
14 | if os.path.isfile(pathname): | ||
15 | files.append(pathname) | ||
16 | chksums.append('%s:True' % pathname) | ||
17 | chksums.extend('%s:False' % c for c in candidates[:-1]) | ||
18 | |||
19 | d.setVar('POSTINST_INTERCEPT_CHECKSUMS', ' '.join(chksums)) | ||
20 | d.setVar('POSTINST_INTERCEPTS', ' '.join(files)) | ||
21 | } | ||
22 | find_intercepts[eventmask] += "bb.event.RecipePreFinalise" | ||
23 | addhandler find_intercepts | ||