meta-digi-del: add '/etc/os-release' file
This file contains version and OS info. https://jira.digi.com/browse/DEL-280 #resolve Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
parent
79394ea92c
commit
bd8ca73775
|
|
@ -0,0 +1,11 @@
|
||||||
|
NAME="Digi Embedded Linux"
|
||||||
|
VERSION="1.0.0 (for Danny)"
|
||||||
|
ID=del
|
||||||
|
ID_LIKE=yocto
|
||||||
|
VERSION_ID="1.0.0"
|
||||||
|
PRETTY_NAME="Digi Embedded Linux 1.0.0 (for Danny)"
|
||||||
|
|
||||||
|
BUILD CONFIGURATION
|
||||||
|
===================
|
||||||
|
BUILD_TIMESTAMP=##BUILD_TIMESTAMP##
|
||||||
|
DEL_TAG=##DEL_TAG##
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
|
PR_append = "+${DISTRO}.r0"
|
||||||
|
|
||||||
|
SRC_URI += "file://os-release"
|
||||||
|
|
||||||
|
TIMESTAMP = "${@time.strftime('%Y%m%d%H%M')}"
|
||||||
|
LAYERS_REV = "${@"Layers revisions:\n%s\n" % '\n'.join(get_layers_branch_rev(d))}"
|
||||||
|
DEL_TAG = "${@del_tag(d).strip()}"
|
||||||
|
|
||||||
|
def del_tag(d):
|
||||||
|
import subprocess
|
||||||
|
for layer in d.getVar('BBLAYERS', True).split():
|
||||||
|
if 'meta-digi-del' in layer:
|
||||||
|
cmd = 'git describe --tags --exact-match 2>/dev/null || true'
|
||||||
|
return subprocess.check_output(cmd, cwd=layer, shell=True)
|
||||||
|
return ""
|
||||||
|
|
||||||
|
do_install_append() {
|
||||||
|
install -m 0644 ${WORKDIR}/os-release ${D}${sysconfdir}/
|
||||||
|
sed -i -e 's,##DEL_TAG##,${DEL_TAG},g' ${D}${sysconfdir}/os-release
|
||||||
|
sed -i -e 's,##BUILD_TIMESTAMP##,${TIMESTAMP},g' ${D}${sysconfdir}/os-release
|
||||||
|
printf "\n%s\n" "${LAYERS_REV}" >> ${D}${sysconfdir}/os-release
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue