16 Commits

Author SHA1 Message Date
Hongxu Jia 38ba593841 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>
2018-05-31 11:26:13 +08:00
Hongxu Jia 7824fbdea8 sign_rpm_ext.bbclass: check rpm public key at image recipe parsing time
While multiple builds share a common sstate, the latter
build failed to build image which the public key not found.
...
|ERROR: initramfs-ostree-image-1.0-r0 do_rootfs: Importing GPG key failed.
Command 'rpmkeys --root=<path>/rootfs --import <path>/rpm-key' returned 1:
...

The latter build will not regenerate rpm packages and
check_rpm_public_key will not be invoked.

Explicitly invoke check_rpm_public_key at image recipe parsing time,
which make sure gpg public key be imported.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2018-05-23 19:32:55 +08:00
Jia Zhang c2962bba6d sign_rpm_ext: make sure all target recipes are signed
Placing the key import logic under signing-keys cannot ensure all
target recipes are always signed. Instead, place it before
do_package_write_rpm.

Signed-off-by: Jia Zhang <lans.zhang2008@gmail.com>
2017-08-24 08:18:01 +08:00
Jia Zhang 6b7e09b444 sign_rpm_ext: define the location of default gpg keyring to TMPDIR
Signed-off-by: Jia Zhang <lans.zhang2008@gmail.com>
2017-08-20 15:00:05 +08:00
Jia Zhang 5c584cb628 sign_rpm_ext: fix permission warning
Signed-off-by: Jia Zhang <lans.zhang2008@gmail.com>
2017-08-20 11:18:24 +08:00
Jia Zhang 820376c2b5 sign_rpm_ext.bbclass: clean up
Signed-off-by: Jia Zhang <lans.zhang2008@gmail.com>
2017-08-19 21:52:51 +08:00
Guojian 050cc889bb 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>
2017-08-19 15:18:58 +08:00
Jia Zhang 8544d2a4a5 sign_rpm_ext.bbclass: use the default setting from meta-signing-key
Signed-off-by: Jia Zhang <lans.zhang2008@gmail.com>
2017-08-19 12:54:19 +08:00
yunguowei e3f58965ab sign_rpm_ext: set default GPG_PATH if it is not specified (#2)
commit 52bf3b6636f95a(meta-integrity: move gpg keyring initialization
to signing-keys) tried to initialize keyring in the task check_public_keys
of the recipe signing-keys. However, it does work with the recipe
signing-keys only, and GPG_PATH can't be passed to other recipes.

We bring the python anonymous function back, and it makes sure GPG_PATH
is set before signing the packages for every recipe.

Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com>
2017-08-19 12:44:39 +08:00
Jia Zhang 52bf3b6636 meta-integrity: move gpg keyring initialization to signing-keys
Signed-off-by: Jia Zhang <lans.zhang2008@gmail.com>
2017-08-17 23:29:26 +08:00
Lans Zhang 464433a169 sign_rpm_ext: support RPM signing
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-08-17 11:22:49 +08:00
Lans Zhang 3eadb6ce1c sign_rpm_ext: remove the test lines
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-07-19 10:56:47 +08:00
Lans Zhang 9c8ddd5bd3 IMA: enable RPM file signing if ima is configured
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-07-19 09:56:29 +08:00
Lans Zhang fbce2ce14b meta-integrity: enable sign_rpm_ext to support rpm and file signing
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-07-11 12:58:05 +08:00
Lans Zhang 5d1376b6a0 IMA: clean up IMA signing
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-07-11 12:47:35 +08:00
Lans Zhang 1b3e594449 meta-secure-core: initial commit
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-06-22 15:24:04 +08:00