diff options
-rw-r--r-- | meta/recipes-core/os-release/os-release.bb | 11 |
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}" | |||
24 | BUILD_ID[vardepsexclude] = "DATETIME" | 24 | BUILD_ID[vardepsexclude] = "DATETIME" |
25 | 25 | ||
26 | python do_compile () { | 26 | python 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 | } |
33 | do_compile[vardeps] += "${OS_RELEASE_FIELDS}" | 39 | do_compile[vardeps] += "${OS_RELEASE_FIELDS}" |
34 | 40 | ||
35 | do_install () { | 41 | do_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 | } |