diff options
Diffstat (limited to 'meta/recipes-core/os-release')
-rw-r--r-- | meta/recipes-core/os-release/os-release.bb | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb index a29d678125..8906906bc3 100644 --- a/meta/recipes-core/os-release/os-release.bb +++ b/meta/recipes-core/os-release/os-release.bb | |||
@@ -2,6 +2,7 @@ inherit allarch | |||
2 | 2 | ||
3 | SUMMARY = "Operating system identification" | 3 | SUMMARY = "Operating system identification" |
4 | DESCRIPTION = "The /usr/lib/os-release file contains operating system identification data." | 4 | DESCRIPTION = "The /usr/lib/os-release file contains operating system identification data." |
5 | HOMEPAGE = "https://www.freedesktop.org/software/systemd/man/os-release.html" | ||
5 | LICENSE = "MIT" | 6 | LICENSE = "MIT" |
6 | INHIBIT_DEFAULT_DEPS = "1" | 7 | INHIBIT_DEFAULT_DEPS = "1" |
7 | 8 | ||
@@ -10,16 +11,35 @@ do_unpack[noexec] = "1" | |||
10 | do_patch[noexec] = "1" | 11 | do_patch[noexec] = "1" |
11 | do_configure[noexec] = "1" | 12 | do_configure[noexec] = "1" |
12 | 13 | ||
14 | # See: https://www.freedesktop.org/software/systemd/man/os-release.html | ||
13 | # Other valid fields: BUILD_ID ID_LIKE ANSI_COLOR CPE_NAME | 15 | # Other valid fields: BUILD_ID ID_LIKE ANSI_COLOR CPE_NAME |
14 | # HOME_URL SUPPORT_URL BUG_REPORT_URL | 16 | # HOME_URL SUPPORT_URL BUG_REPORT_URL |
15 | OS_RELEASE_FIELDS = "ID ID_LIKE NAME VERSION VERSION_ID PRETTY_NAME" | 17 | OS_RELEASE_FIELDS = "\ |
18 | ID ID_LIKE NAME VERSION VERSION_ID VERSION_CODENAME PRETTY_NAME \ | ||
19 | CPE_NAME \ | ||
20 | " | ||
16 | OS_RELEASE_UNQUOTED_FIELDS = "ID VERSION_ID VARIANT_ID" | 21 | OS_RELEASE_UNQUOTED_FIELDS = "ID VERSION_ID VARIANT_ID" |
17 | 22 | ||
18 | ID = "${DISTRO}" | 23 | ID = "${DISTRO}" |
19 | NAME = "${DISTRO_NAME}" | 24 | NAME = "${DISTRO_NAME}" |
20 | VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}" | 25 | VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}" |
21 | VERSION_ID = "${DISTRO_VERSION}" | 26 | VERSION_ID = "${DISTRO_VERSION}" |
27 | VERSION_CODENAME = "${DISTRO_CODENAME}" | ||
22 | PRETTY_NAME = "${DISTRO_NAME} ${VERSION}" | 28 | PRETTY_NAME = "${DISTRO_NAME} ${VERSION}" |
29 | |||
30 | # The vendor field is hardcoded to "openembedded" deliberately. We'd | ||
31 | # advise developers leave it as this value to clearly identify the | ||
32 | # underlying build environment from which the OS was constructed. We | ||
33 | # understand people will want to identify themselves as the people who | ||
34 | # built the image, we'd suggest using the DISTRO element to do this, so | ||
35 | # that is customisable. | ||
36 | # This end result combines to mean systems can be traced back to both who | ||
37 | # built them and which system was used, which is ultimately the goal of | ||
38 | # the CPE. | ||
39 | |||
40 | CPE_DISTRO ??= "${DISTRO}" | ||
41 | CPE_NAME="cpe:/o:openembedded:${CPE_DISTRO}:${VERSION_ID}" | ||
42 | |||
23 | BUILD_ID ?= "${DATETIME}" | 43 | BUILD_ID ?= "${DATETIME}" |
24 | BUILD_ID[vardepsexclude] = "DATETIME" | 44 | BUILD_ID[vardepsexclude] = "DATETIME" |
25 | 45 | ||
@@ -47,7 +67,12 @@ do_compile[vardeps] += "${OS_RELEASE_FIELDS}" | |||
47 | do_install () { | 67 | do_install () { |
48 | install -d ${D}${nonarch_libdir} ${D}${sysconfdir} | 68 | install -d ${D}${nonarch_libdir} ${D}${sysconfdir} |
49 | install -m 0644 os-release ${D}${nonarch_libdir}/ | 69 | install -m 0644 os-release ${D}${nonarch_libdir}/ |
50 | lnr ${D}${nonarch_libdir}/os-release ${D}${sysconfdir}/os-release | 70 | ln -rs ${D}${nonarch_libdir}/os-release ${D}${sysconfdir}/os-release |
71 | ln -rs ${D}${nonarch_libdir}/os-release ${D}${sysconfdir}/initrd-release | ||
51 | } | 72 | } |
52 | 73 | ||
53 | FILES_${PN} += "${nonarch_libdir}/os-release" | 74 | FILES:${PN} = "${sysconfdir}/os-release ${nonarch_libdir}/os-release" |
75 | |||
76 | PACKAGES += "${PN}-initrd" | ||
77 | FILES:${PN}-initrd = "${sysconfdir}/initrd-release" | ||
78 | RDEPENDS:${PN}-initrd += "${PN}" | ||