From 8baed9aa93c84b682546b64e006abbcc24531a1b Mon Sep 17 00:00:00 2001 From: ScottW514 Date: Fri, 7 Aug 2026 21:19:50 -0400 Subject: [PATCH] images: version stamp in /etc, shown at console and SSH login Every image writes /etc/forgefirm-version and echoes "ForgeFIRM " on the serial-console login prompt (/etc/issue, beneath the OpenGlow banner) and at SSH login (motd). Release images carry v${FORGEFIRM_RELEASE}; the dev image stamps the build timestamp - the same DATETIME as the artifact name - tagged (dev) so a bench machine is never mistaken for a release. --- .../images/forgefirm-image-dev.bb | 4 ++++ .../recipes-forgefirm/images/forgefirm-image.bb | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/meta-forgefirm/recipes-forgefirm/images/forgefirm-image-dev.bb b/meta-forgefirm/recipes-forgefirm/images/forgefirm-image-dev.bb index 4064a74..364bee1 100644 --- a/meta-forgefirm/recipes-forgefirm/images/forgefirm-image-dev.bb +++ b/meta-forgefirm/recipes-forgefirm/images/forgefirm-image-dev.bb @@ -11,3 +11,7 @@ IMAGE_INSTALL += " \ IMAGE_FEATURES += " \ tools-debug \ " + +# Dev builds identify by build timestamp (matches the artifact name), +# tagged so a bench machine is never mistaken for a release. +FORGEFIRM_VERSION_STRING = "${DATETIME} (dev)" diff --git a/meta-forgefirm/recipes-forgefirm/images/forgefirm-image.bb b/meta-forgefirm/recipes-forgefirm/images/forgefirm-image.bb index 0e54073..7e67070 100644 --- a/meta-forgefirm/recipes-forgefirm/images/forgefirm-image.bb +++ b/meta-forgefirm/recipes-forgefirm/images/forgefirm-image.bb @@ -17,3 +17,20 @@ IMAGE_INSTALL:remove = "gfui-client" # v4l-utils provides media-ctl / v4l2-ctl for the imx-media pipeline (also a # forgectrl runtime dependency, kept explicit here for bring-up use). IMAGE_INSTALL:append = " grblhal-glowforge forgectrl gfhome v4l-utils" + +# Version stamp: /etc/forgefirm-version (machine-readable), echoed on the +# serial-console login prompt (/etc/issue) and at SSH login (motd). +# Release images carry the release version; the dev image overrides the +# string with the build timestamp (the same DATETIME as the artifact +# name) plus a dev tag. +FORGEFIRM_RELEASE ?= "0.1.0" +FORGEFIRM_VERSION_STRING ?= "v${FORGEFIRM_RELEASE}" + +write_forgefirm_version() { + echo "${FORGEFIRM_VERSION_STRING}" > ${IMAGE_ROOTFS}${sysconfdir}/forgefirm-version + echo "ForgeFIRM ${FORGEFIRM_VERSION_STRING}" >> ${IMAGE_ROOTFS}${sysconfdir}/issue + echo "" >> ${IMAGE_ROOTFS}${sysconfdir}/issue + echo "ForgeFIRM ${FORGEFIRM_VERSION_STRING}" > ${IMAGE_ROOTFS}${sysconfdir}/motd +} +write_forgefirm_version[vardepsexclude] += "DATETIME" +ROOTFS_POSTPROCESS_COMMAND += "write_forgefirm_version;"