summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2016-09-29 23:03:22 +0300
committerBrandon Bayer <bbayer@multitech.com>2016-10-26 15:36:30 -0500
commit4ef2f4846db7ddf0a5895506552f6c45295eb01a (patch)
tree257fc28190abba5804a1606f5042a70891f2892f
parentd3759b99f4fe025e82a507fb8fa6caddbeae4940 (diff)
downloadmeta-mlinux-4ef2f4846db7ddf0a5895506552f6c45295eb01a.tar.gz
meta-mlinux-4ef2f4846db7ddf0a5895506552f6c45295eb01a.tar.bz2
meta-mlinux-4ef2f4846db7ddf0a5895506552f6c45295eb01a.zip
mtp: added mlinux_set_product_version to ROOTFS_POSTPROCESS_COMMAND.
If ${FIRMWARE_PRODUCT_VER} variable is set it will be appended to /etc/issue file.
-rw-r--r--classes/mlinux-image.bbclass18
1 files changed, 18 insertions, 0 deletions
diff --git a/classes/mlinux-image.bbclass b/classes/mlinux-image.bbclass
index 3f49a94..13cacb5 100644
--- a/classes/mlinux-image.bbclass
+++ b/classes/mlinux-image.bbclass
@@ -12,6 +12,24 @@ mlinux_set_root_password () {
}
ROOTFS_POSTPROCESS_COMMAND += "mlinux_set_root_password;"
+# set custom product sw version to /etc/issue file if $FIRMWARE_PRODUCT_VER is set
+mlinux_set_product_version () {
+ if [ -n "${FIRMWARE_PRODUCT_VER}" ]; then
+ # set issue
+ if cat ${IMAGE_ROOTFS}/etc/issue | grep "Version: " > /dev/null 2>&1 ; then
+ # replace
+ sed -i "s/^Version: .*$/Version: $FIRMWARE_PRODUCT_VER/g" ${IMAGE_ROOTFS}/etc/issue
+ sed -i "s/^Date: .*$/Date: $FIRMWARE_PRODUCT_DATE/g" ${IMAGE_ROOTFS}/etc/issue
+ else
+ # add
+ echo "" >> ${IMAGE_ROOTFS}/etc/issue
+ echo "Version: ${FIRMWARE_PRODUCT_VER}" >> ${IMAGE_ROOTFS}/etc/issue
+ echo "Date: $(date +%Y-%m-%dT%H:%M:%S)" >> ${IMAGE_ROOTFS}/etc/issue
+ fi
+ fi
+}
+ROOTFS_POSTPROCESS_COMMAND += "mlinux_set_product_version;"
+
# generate upgrade.bin files -- provides single file for upgrades
do_firmware () {
cd ${DEPLOY_DIR_IMAGE}