30 lines
963 B
Plaintext
30 lines
963 B
Plaintext
# Copyright (C) 2013 Digi International.
|
|
|
|
PRINC := "${@int(PRINC) + 1}"
|
|
PR_append = "+${DISTRO}"
|
|
|
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
|
|
|
SRC_URI += "file://os-release"
|
|
|
|
TIMESTAMP = "${@time.strftime('%Y%m%d%H%M')}"
|
|
LAYERS_REV = "${@"\nLayers 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.Popen(cmd, cwd=layer, shell=True, stdout=subprocess.PIPE).stdout.read()
|
|
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
|
|
cat >> ${D}${sysconfdir}/os-release <<-EOF
|
|
${LAYERS_REV}
|
|
EOF
|
|
}
|