[OE-core] [PATCH 2/3] os-release: add the public package-signing key

Markus Lehtonen markus.lehtonen at linux.intel.com
Wed Aug 26 11:18:33 UTC 2015


Adds the public package-signing key into this package. It will be
installed under /etc/pki/rpm-gpg if the RPM signing feature is used. The
key file is not currently directly used by anything in the target
system. It is merely there for possible later use.

[YOCTO #8134]

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
---
 meta/recipes-core/os-release/os-release.bb | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
index 87fea6f..542cf56 100644
--- a/meta/recipes-core/os-release/os-release.bb
+++ b/meta/recipes-core/os-release/os-release.bb
@@ -23,15 +23,24 @@ PRETTY_NAME = "${DISTRO_NAME} ${VERSION}"
 BUILD_ID ?= "${DATETIME}"
 
 python do_compile () {
+    import shutil
     with open(d.expand('${B}/os-release'), 'w') as f:
         for field in d.getVar('OS_RELEASE_FIELDS', True).split():
             value = d.getVar(field, True)
             if value:
                 f.write('{0}={1}\n'.format(field, value))
+    if d.getVar('RPM_SIGN_PACKAGES', True) == '1':
+        rpm_gpg_pubkey = d.getVar('RPM_GPG_PUBKEY', True)
+        shutil.copy2(rpm_gpg_pubkey, d.expand('${B}/RPM-GPG-KEY-default'))
 }
 do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
 
 do_install () {
     install -d ${D}${sysconfdir}
     install -m 0644 os-release ${D}${sysconfdir}/
+
+    if [ -f "RPM-GPG-KEY-default" ]; then
+        install -d "${D}${sysconfdir}/pki/rpm-gpg"
+        install -m 0644 "RPM-GPG-KEY-oe" "${D}${sysconfdir}/pki/rpm-gpg/"
+    fi
 }
-- 
2.1.4




More information about the Openembedded-core mailing list