diff options
| author | Sandy <39258624+sandy-lcq@users.noreply.github.com> | 2019-11-07 17:31:03 +0800 |
|---|---|---|
| committer | Jia Zhang <qianyue.zj@alibaba-inc.com> | 2019-11-07 17:31:03 +0800 |
| commit | 393b80fa358557bd24dde6a0b7052fcb87eb32d7 (patch) | |
| tree | af9c1142c7e04383d2607e1da9842b7aa82396bb | |
| parent | 99760f4771dfa011dce46ce853395b5d0fd09e22 (diff) | |
| download | meta-secure-core-393b80fa358557bd24dde6a0b7052fcb87eb32d7.tar.gz | |
sign_rpm_ext.bbclass: fix check_rpm_public_key failed while host not install gpg (#124)
Due to the following reasons, need to add the dependency to
task who needs to run check_rpm_public_key:
* packagegroup recipe don't have task prepare_recipe_sysroot
* varflags depends don't work for prefuncs
Signed-off-by: Changqing Li <changqing.li@windriver.com>
| -rw-r--r-- | meta-integrity/classes/sign_rpm_ext.bbclass | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/meta-integrity/classes/sign_rpm_ext.bbclass b/meta-integrity/classes/sign_rpm_ext.bbclass index a8362ef..d9a7f34 100644 --- a/meta-integrity/classes/sign_rpm_ext.bbclass +++ b/meta-integrity/classes/sign_rpm_ext.bbclass | |||
| @@ -10,8 +10,7 @@ RPM_FSK_PASSWORD ?= "password" | |||
| 10 | 10 | ||
| 11 | inherit sign_rpm user-key-store | 11 | inherit sign_rpm user-key-store |
| 12 | 12 | ||
| 13 | GPG_DEP = "${@'' if d.getVar('GPG_BIN') else 'gnupg-native pinentry-native'}" | 13 | GPG_DEP = "${@'' if d.getVar('GPG_BIN') else 'gnupg-native:do_populate_sysroot pinentry-native:do_populate_sysroot'}" |
| 14 | DEPENDS_append_class-target += "${GPG_DEP}" | ||
| 15 | 14 | ||
| 16 | python check_rpm_public_key () { | 15 | python check_rpm_public_key () { |
| 17 | gpg_path = d.getVar('GPG_PATH', True) | 16 | gpg_path = d.getVar('GPG_PATH', True) |
| @@ -35,9 +34,17 @@ python check_rpm_public_key () { | |||
| 35 | bb.fatal('Failed to import gpg key (%s): %s' % (gpg_key, output)) | 34 | bb.fatal('Failed to import gpg key (%s): %s' % (gpg_key, output)) |
| 36 | } | 35 | } |
| 37 | check_rpm_public_key[lockfiles] = "${TMPDIR}/check_rpm_public_key.lock" | 36 | check_rpm_public_key[lockfiles] = "${TMPDIR}/check_rpm_public_key.lock" |
| 38 | do_package_write_rpm[prefuncs] += "check_rpm_public_key" | ||
| 39 | do_rootfs[prefuncs] += "check_rpm_public_key" | ||
| 40 | check_rpm_public_key[prefuncs] += "check_deploy_keys" | 37 | check_rpm_public_key[prefuncs] += "check_deploy_keys" |
| 38 | do_package_write_rpm[depends] += "${GPG_DEP}" | ||
| 39 | do_rootfs[depends] += "${GPG_DEP}" | ||
| 40 | |||
| 41 | python do_package_write_rpm_prepend() { | ||
| 42 | bb.build.exec_func("check_rpm_public_key", d) | ||
| 43 | } | ||
| 44 | |||
| 45 | python do_rootfs_prepend() { | ||
| 46 | bb.build.exec_func("check_rpm_public_key", d) | ||
| 47 | } | ||
| 41 | 48 | ||
| 42 | python () { | 49 | python () { |
| 43 | gpg_path = d.getVar('GPG_PATH', True) | 50 | gpg_path = d.getVar('GPG_PATH', True) |
