LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" inherit mlinux_metadata_scm # always parse this file so PV can change automatically BB_DONT_CACHE = "1" PV = "${DISTRO_VERSION}_${MLINUX_METADATA_REVISION}" PR = "r3" PE = "1" PACKAGES = "${PN}" PACKAGE_ARCH = "${MACHINE_ARCH}" do_install() { mkdir -p ${D}${sysconfdir} echo "mLinux ${DISTRO_VERSION}" > ${D}${sysconfdir}/mlinux-version echo "Built from branch: ${MLINUX_METADATA_BRANCH}" >> ${D}${sysconfdir}/mlinux-version echo "Revision: ${MLINUX_METADATA_REVISION}" >> ${D}${sysconfdir}/mlinux-version echo "${MLINUX_LAYERS}" > ${D}${sysconfdir}/mlinux-layers } image_version = "${@define_iv(d)}" def define_iv(d): import subprocess source_dir = d.getVar('OEROOT',True) cmd = "git describe" proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, cwd=source_dir) out, err = proc.communicate() return out.decode("utf-8").rstrip() # For mLinux only, update the version on postinst # Should not affect Convergence. pkg_postinst_${PN}() { # Not for image builds if [ -n "$D" ] ; then exit 0 fi # If this is mLinux, update the version mlinux="^MultiTech Systems mLinux GNU/Linux$" version="Version: " if grep "${mlinux}" /etc/issue ; then tmpf=$(mktemp) cp -a /etc/issue $tmpf sed -i "s/^${version}.*/${version}${image_version}/" ${tmpf} if ! cmp /etc/issue ${tmpf} ; then mv ${tmpf} /etc/issue fi fi }