diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-05-31 09:54:28 +0800 |
---|---|---|
committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2018-05-31 11:26:13 +0800 |
commit | 38ba5938416ba488f10849080a11069242924e89 (patch) | |
tree | 8aa5f41876fdf97ebad0ce18f975064c6f8aa87c | |
parent | 6ca33b325d265afd2cab4890cd1379b2a95114f8 (diff) | |
download | meta-secure-core-38ba5938416ba488f10849080a11069242924e89.tar.gz |
sign_rpm_ext.bbclass: fix check_rpm_public_key racing at recipe parsing time
All recipe will be parsed which caused lockfile of
check_rpm_public_key racing issue.
...
|WARNING: meta-secure-core/meta/recipes-core/images/secure-core-image-initramfs.bb:
oe-core/bitbake/lib/bb/utils.py:400: ResourceWarning: unclosed file
<_io.TextIOWrapper name='tmp-glibc/check_rpm_public_key.lock' mode='a+' encoding='UTF-8'>
...
Refer do_package_write_rpm, add check_rpm_public_key to
prefunc of do_rootfs, only the running image recipe will
invoke check_rpm_public_key.
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-rw-r--r-- | meta-integrity/classes/sign_rpm_ext.bbclass | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/meta-integrity/classes/sign_rpm_ext.bbclass b/meta-integrity/classes/sign_rpm_ext.bbclass index 4a25691..8b25d74 100644 --- a/meta-integrity/classes/sign_rpm_ext.bbclass +++ b/meta-integrity/classes/sign_rpm_ext.bbclass | |||
@@ -34,6 +34,7 @@ python check_rpm_public_key () { | |||
34 | } | 34 | } |
35 | check_rpm_public_key[lockfiles] = "${TMPDIR}/check_rpm_public_key.lock" | 35 | check_rpm_public_key[lockfiles] = "${TMPDIR}/check_rpm_public_key.lock" |
36 | do_package_write_rpm[prefuncs] += "check_rpm_public_key" | 36 | do_package_write_rpm[prefuncs] += "check_rpm_public_key" |
37 | do_rootfs[prefuncs] += "check_rpm_public_key" | ||
37 | check_rpm_public_key[prefuncs] += "check_deploy_keys" | 38 | check_rpm_public_key[prefuncs] += "check_deploy_keys" |
38 | 39 | ||
39 | python () { | 40 | python () { |
@@ -47,8 +48,4 @@ python () { | |||
47 | if status: | 48 | if status: |
48 | raise bb.build.FuncFailed('Failed to create gpg keying %s: %s' % | 49 | raise bb.build.FuncFailed('Failed to create gpg keying %s: %s' % |
49 | (gpg_path, output)) | 50 | (gpg_path, output)) |
50 | |||
51 | is_image = bb.data.inherits_class('image', d) | ||
52 | if is_image: | ||
53 | bb.build.exec_func("check_rpm_public_key", d) | ||
54 | } | 51 | } |