summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/os-release
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-03 12:43:19 +0100
commit3983e3ffcc694a5728effa5f5f81010190830606 (patch)
treec2c021a842cef775d8d8c0fc798024bd50988a3a /meta/recipes-core/os-release
parent752736ae9f9c8842018e45cff2f5b1d770557d86 (diff)
downloadpoky-3983e3ffcc694a5728effa5f5f81010190830606.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] (From OE-Core rev: f7359ad6bec82d4aa761287a6c6d53cbc25adab3) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/os-release')
-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}"
24BUILD_ID[vardepsexclude] = "DATETIME" 24BUILD_ID[vardepsexclude] = "DATETIME"
25 25
26python do_compile () { 26python do_compile () {
27 import shutil
27 with open(d.expand('${B}/os-release'), 'w') as f: 28 with open(d.expand('${B}/os-release'), 'w') as f:
28 for field in d.getVar('OS_RELEASE_FIELDS', True).split(): 29 for field in d.getVar('OS_RELEASE_FIELDS', True).split():
29 value = d.getVar(field, True) 30 value = d.getVar(field, True)
30 if value: 31 if value:
31 f.write('{0}={1}\n'.format(field, value)) 32 f.write('{0}={1}\n'.format(field, value))
33 if d.getVar('RPM_SIGN_PACKAGES', True) == '1':
34 rpm_gpg_pubkey = d.getVar('RPM_GPG_PUBKEY', True)
35 os.mkdir('${B}/rpm-gpg')
36 distro_version = self.d.getVar('DISTRO_VERSION', True) or "oe.0"
37 shutil.copy2(rpm_gpg_pubkey, d.expand('${B}/rpm-gpg/RPM-GPG-KEY-%s' % distro_version))
32} 38}
33do_compile[vardeps] += "${OS_RELEASE_FIELDS}" 39do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
34 40
35do_install () { 41do_install () {
36 install -d ${D}${sysconfdir} 42 install -d ${D}${sysconfdir}
37 install -m 0644 os-release ${D}${sysconfdir}/ 43 install -m 0644 os-release ${D}${sysconfdir}/
44
45 if [ -d "rpm-gpg" ]; then
46 install -d "${D}${sysconfdir}/pki"
47 cp -r "rpm-gpg" "${D}${sysconfdir}/pki/"
48 fi
38} 49}