diff options
Diffstat (limited to 'classes/mlinux-image.bbclass')
-rw-r--r-- | classes/mlinux-image.bbclass | 18 |
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} |