summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/os-release/os-release.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/os-release/os-release.bb')
-rw-r--r--meta/recipes-core/os-release/os-release.bb36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
new file mode 100644
index 0000000000..33e958137f
--- /dev/null
+++ b/meta/recipes-core/os-release/os-release.bb
@@ -0,0 +1,36 @@
1inherit allarch
2
3SUMMARY = "Operating system identification"
4DESCRIPTION = "The /etc/os-release file contains operating system identification data."
5LICENSE = "MIT"
6INHIBIT_DEFAULT_DEPS = "1"
7
8do_fetch[noexec] = "1"
9do_unpack[noexec] = "1"
10do_patch[noexec] = "1"
11do_configure[noexec] = "1"
12
13# Other valid fields: BUILD_ID ID_LIKE ANSI_COLOR CPE_NAME
14# HOME_URL SUPPORT_URL BUG_REPORT_URL
15OS_RELEASE_FIELDS = "ID ID_LIKE NAME VERSION VERSION_ID PRETTY_NAME"
16
17ID = "${DISTRO}"
18NAME = "${DISTRO_NAME}"
19VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}"
20VERSION_ID = "${DISTRO_VERSION}"
21PRETTY_NAME = "${DISTRO_NAME} ${VERSION}"
22BUILD_ID ?= "${DATETIME}"
23
24python do_compile () {
25 with open(d.expand('${B}/os-release'), 'w') as f:
26 for field in d.getVar('OS_RELEASE_FIELDS', True).split():
27 value = d.getVar(field, True)
28 if value:
29 f.write('{0}={1}\n'.format(field, value))
30}
31do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
32
33do_install () {
34 install -d ${D}${sysconfdir}
35 install -m 0644 os-release ${D}${sysconfdir}/
36}