diff options
author | Guojian <guojian.zhou@windriver.com> | 2017-08-19 15:18:58 +0800 |
---|---|---|
committer | Lans Zhang <lans.zhang2008@gmail.com> | 2017-08-19 15:18:58 +0800 |
commit | 050cc889bb5b46d21ede7598907bfc046ce5b000 (patch) | |
tree | 728a6feaaacdc708dc265ac42739541407a0bdd6 | |
parent | b8fd1f0fef43ff5bb1df086282715f7d4a83a76b (diff) | |
download | meta-secure-core-050cc889bb5b46d21ede7598907bfc046ce5b000.tar.gz |
sign_rpm_ext: Fix the GPG_PATH directory not exist issue (#4)
If "GPG_PATH" is set in the init script, then "signing-keys"
get_public_keys task will execute failed.
So the "GPG_PATH" directory would be created when "GPG_PATH" is set.
The do_get_public_keys failed to import gpg key error information is as following:
----------------------------------------------------------------------------------------
ERROR: signing-keys-1.0-r0 do_get_public_keys: Function failed: Failed to import gpg key
(layers/meta-secure-core/meta-signing-key/files/rpm_keys/RPM-GPG-PRIVKEY-SecureCore):
gpg: fatal: can't create directory
`tmp/deploy/images/intel-corei7-64/.gnupg': No such file or directory
Signed-off-by: Guojian Zhou <guojian.zhou@windriver.com>
-rw-r--r-- | meta-integrity/classes/sign_rpm_ext.bbclass | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/meta-integrity/classes/sign_rpm_ext.bbclass b/meta-integrity/classes/sign_rpm_ext.bbclass index 5a579ee..ebdf2b0 100644 --- a/meta-integrity/classes/sign_rpm_ext.bbclass +++ b/meta-integrity/classes/sign_rpm_ext.bbclass | |||
@@ -21,13 +21,12 @@ python () { | |||
21 | gpg_path = d.getVar('GPG_PATH', True) | 21 | gpg_path = d.getVar('GPG_PATH', True) |
22 | if not gpg_path: | 22 | if not gpg_path: |
23 | gpg_path = d.getVar('DEPLOY_DIR_IMAGE', True) + '/.gnupg' | 23 | gpg_path = d.getVar('DEPLOY_DIR_IMAGE', True) + '/.gnupg' |
24 | |||
25 | if not os.path.exists(gpg_path): | ||
26 | cmd = ' '.join(('mkdir -p', gpg_path)) | ||
27 | status, output = oe.utils.getstatusoutput(cmd) | ||
28 | if status: | ||
29 | raise bb.build.FuncFailed('Failed to create gpg keying %s: %s' % | ||
30 | (gpg_path, output)) | ||
31 | |||
32 | d.setVar('GPG_PATH', gpg_path) | 24 | d.setVar('GPG_PATH', gpg_path) |
25 | |||
26 | if not os.path.exists(gpg_path): | ||
27 | cmd = ' '.join(('mkdir -p', gpg_path)) | ||
28 | status, output = oe.utils.getstatusoutput(cmd) | ||
29 | if status: | ||
30 | raise bb.build.FuncFailed('Failed to create gpg keying %s: %s' % | ||
31 | (gpg_path, output)) | ||
33 | } | 32 | } |