diff options
author | yunguowei <yunguo.wei@windriver.com> | 2017-08-19 12:44:39 +0800 |
---|---|---|
committer | Lans Zhang <lans.zhang2008@gmail.com> | 2017-08-19 12:44:39 +0800 |
commit | e3f58965abe99e9cd4c3ccdfd5401df61b47d6c9 (patch) | |
tree | 542c2397e3db7a0977859975cc23174791ba055e /meta-integrity/classes | |
parent | 60588ac9295e50262c4b88f96a45ad311545b882 (diff) | |
download | meta-secure-core-e3f58965abe99e9cd4c3ccdfd5401df61b47d6c9.tar.gz |
sign_rpm_ext: set default GPG_PATH if it is not specified (#2)
commit 52bf3b6636f95a(meta-integrity: move gpg keyring initialization
to signing-keys) tried to initialize keyring in the task check_public_keys
of the recipe signing-keys. However, it does work with the recipe
signing-keys only, and GPG_PATH can't be passed to other recipes.
We bring the python anonymous function back, and it makes sure GPG_PATH
is set before signing the packages for every recipe.
Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com>
Diffstat (limited to 'meta-integrity/classes')
-rw-r--r-- | meta-integrity/classes/sign_rpm_ext.bbclass | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/meta-integrity/classes/sign_rpm_ext.bbclass b/meta-integrity/classes/sign_rpm_ext.bbclass index d758773..4b52d6a 100644 --- a/meta-integrity/classes/sign_rpm_ext.bbclass +++ b/meta-integrity/classes/sign_rpm_ext.bbclass | |||
@@ -15,3 +15,18 @@ RPM_FSK_PATH ?= "${@uks_ima_keys_dir(d) + 'x509_ima.key'}" | |||
15 | RPM_FSK_PASSWORD ?= "password" | 15 | RPM_FSK_PASSWORD ?= "password" |
16 | 16 | ||
17 | inherit sign_rpm user-key-store | 17 | inherit sign_rpm user-key-store |
18 | |||
19 | python () { | ||
20 | gpg_path = d.getVar('GPG_PATH', True) | ||
21 | if not gpg_path: | ||
22 | gpg_path = d.getVar('DEPLOY_DIR_IMAGE', True) + '/.gnupg' | ||
23 | |||
24 | if not os.path.exists(gpg_path): | ||
25 | cmd = ' '.join(('mkdir -p', gpg_path)) | ||
26 | status, output = oe.utils.getstatusoutput(cmd) | ||
27 | if status: | ||
28 | raise bb.build.FuncFailed('Failed to create gpg keying %s: %s' % | ||
29 | (gpg_path, output)) | ||
30 | |||
31 | d.setVar('GPG_PATH', gpg_path) | ||
32 | } | ||