Skip to contentSkip to conversation

image-artifact-names: make variables overridable

PATCH In review Jens Rehsack 2 participants 2 messages Sep 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image-artifact-names: make variables overridable

From: Jens Rehsack <[email protected]>

Since the newly introduced image-artifact-names class is inherited at later processing stage, individual IMAGE_NAME settings are overridden (hopefully by accident instead on purpose).

Allow derived distributions define their own name schema by setting defaults iwth question mark.

---
 meta/classes/image-artifact-names.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/image-artifact-names.bbclass +4 -4
index 5ab8f1b7aa..3ac8dd731a 100644
@@ -2,11 +2,11 @@
 # Specific image creation and rootfs population info.
 ##################################################################
 
-IMAGE_BASENAME = "${PN}"
-IMAGE_VERSION_SUFFIX = "-${DATETIME}"
+IMAGE_BASENAME ?= "${PN}"
+IMAGE_VERSION_SUFFIX ?= "-${DATETIME}"
 IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME"
-IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
-IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
+IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
+IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}"
 
 # IMAGE_NAME is the base name for everything produced when building images.
 # The actual image that contains the rootfs has an additional suffix (.rootfs
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · Jens Rehsack

From: Jens Rehsack <[email protected]>

Since the newly introduced image-artifact-names class is inherited at later processing stage, individual IMAGE_NAME settings are overridden (hopefully by accident instead on purpose).

The purpose was was to make it easier for DISTRO to define own scheme, so LGTM.

You can still override the values from distro layer, but I agree that this makes it a bit easier to do that, thanks!

Quoted 31 lines

Allow derived distributions define their own name schema by setting defaults iwth question mark.

---
 meta/classes/image-artifact-names.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/image-artifact-names.bbclass +4 -4
index 5ab8f1b7aa..3ac8dd731a 100644
@@ -2,11 +2,11 @@
 # Specific image creation and rootfs population info.
 ##################################################################
 
-IMAGE_BASENAME = "${PN}"
-IMAGE_VERSION_SUFFIX = "-${DATETIME}"
+IMAGE_BASENAME ?= "${PN}"
+IMAGE_VERSION_SUFFIX ?= "-${DATETIME}"
 IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME"
-IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
-IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
+IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
+IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}"
 
 # IMAGE_NAME is the base name for everything produced when building images.
 # The actual image that contains the rootfs has an additional suffix (.rootfs
Signature · 1 line
2.17.1