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>
This commit is contained in:
Hongxu Jia
2018-05-31 09:54:28 +08:00
committed by Jia Zhang
parent 6ca33b325d
commit 38ba593841

View File

@@ -34,6 +34,7 @@ python check_rpm_public_key () {
}
check_rpm_public_key[lockfiles] = "${TMPDIR}/check_rpm_public_key.lock"
do_package_write_rpm[prefuncs] += "check_rpm_public_key"
do_rootfs[prefuncs] += "check_rpm_public_key"
check_rpm_public_key[prefuncs] += "check_deploy_keys"
python () {
@@ -47,8 +48,4 @@ python () {
if status:
raise bb.build.FuncFailed('Failed to create gpg keying %s: %s' %
(gpg_path, output))
is_image = bb.data.inherits_class('image', d)
if is_image:
bb.build.exec_func("check_rpm_public_key", d)
}