public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] classes/image_postprocessing: Add variant version to os_release
@ 2020-04-14 14:46 Q. Gylstorff
  2020-04-14 14:55 ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Q. Gylstorff @ 2020-04-14 14:46 UTC (permalink / raw)
  To: isar-users; +Cc: Quirin Gylstorff

From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

to identify the image version in a human readable way
.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 meta/classes/image-postproc-extension.bbclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass
index 7280202..1091fa4 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -4,10 +4,12 @@
 update_etc_os_release() {
     OS_RELEASE_BUILD_ID=""
     OS_RELEASE_VARIANT=""
+    OS_RELEASE_VARIANT_VERSION=""
     while true; do
         case "$1" in
         --build-id) OS_RELEASE_BUILD_ID=$2; shift ;;
         --variant) OS_RELEASE_VARIANT=$2; shift ;;
+        --version) OS_RELEASE_VARIANT_VERSION=$2; shift ;;
         -*) bbfatal "$0: invalid option specified: $1" ;;
         *) break ;;
         esac
@@ -24,6 +26,11 @@ update_etc_os_release() {
         echo "VARIANT=\"${OS_RELEASE_VARIANT}\"" | \
             sudo tee -a '${IMAGE_ROOTFS}/etc/os-release'
     fi
+    if [ -n "${OS_RELEASE_VARIANT_VERSION}" ]; then
+        sudo sed -i '/^ISAR_IMAGE_VERSION=.*/d' '${IMAGE_ROOTFS}/etc/os-release'
+        echo "VARIANT_VERSION=\"${PV}\"" | \
+            sudo tee -a '${IMAGE_ROOTFS}/etc/os-release'
+    fi
 }
 
 ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure"
@@ -43,7 +50,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_mark"
 image_postprocess_mark() {
     BUILD_ID=$(get_build_id)
     update_etc_os_release \
-        --build-id "${BUILD_ID}" --variant "${DESCRIPTION}"
+        --build-id "${BUILD_ID}" --variant "${DESCRIPTION}" --version "${PV}"
 }
 
 ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-05-07 19:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 14:46 [PATCH] classes/image_postprocessing: Add variant version to os_release Q. Gylstorff
2020-04-14 14:55 ` Jan Kiszka
2020-04-21 15:01   ` [PATCH v2] classes/image-postproc: Add image version Q. Gylstorff
2020-04-21 18:49     ` Henning Schild
2020-04-21 18:57       ` Henning Schild
2020-04-21 19:28       ` cedric_hombourger
2020-04-22  8:36         ` Gylstorff Quirin
2020-04-22 10:51           ` Henning Schild
2020-05-07 19:36     ` Baurzhan Ismagulov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox