summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-08-25 14:49:14 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-01 21:58:04 +0100
commitf7359ad6bec82d4aa761287a6c6d53cbc25adab3 (patch)
tree5ea6de482528229487f2c6c00711a7414fc935b2 /meta
parent75f5f11b19ba1bf8743caf9ee7c99a3c67f4b266 (diff)
downloadopenembedded-core-contrib-f7359ad6bec82d4aa761287a6c6d53cbc25adab3.tar.gz
os-release: add the public package-signing key
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@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/os-release/os-release.bb11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
index 10a4570492..cc431d2cdc 100644
--- a/meta/recipes-core/os-release/os-release.bb
+++ b/meta/recipes-core/os-release/os-release.bb
@@ -24,15 +24,26 @@ BUILD_ID ?= "${DATETIME}"
BUILD_ID[vardepsexclude] = "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)
+ os.mkdir('${B}/rpm-gpg')
+ distro_version = self.d.getVar('DISTRO_VERSION', True) or "oe.0"
+ shutil.copy2(rpm_gpg_pubkey, d.expand('${B}/rpm-gpg/RPM-GPG-KEY-%s' % distro_version))
}
do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
do_install () {
install -d ${D}${sysconfdir}
install -m 0644 os-release ${D}${sysconfdir}/
+
+ if [ -d "rpm-gpg" ]; then
+ install -d "${D}${sysconfdir}/pki"
+ cp -r "rpm-gpg" "${D}${sysconfdir}/pki/"
+ fi
}