From 38ba5938416ba488f10849080a11069242924e89 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Thu, 31 May 2018 09:54:28 +0800 Subject: 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 --- meta-integrity/classes/sign_rpm_ext.bbclass | 5 +---- 1 file changed, 1 insertion(+), 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 () { } 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) } -- cgit v1.2.3-54-g00ecf