diff mbox series

[5/5] image-artifact-names.bbclass: Decouple from IMAGE_LINK_NAME

Message ID 20250114153748.2358116-5-niko.mauno@vaisala.com
State New
Headers show
Series [1/5] vex.bbclass: Drop redundant import update_symlinks | expand

Commit Message

Niko Mauno Jan. 14, 2025, 3:37 p.m. UTC
If the user has wanted to avoid complementary symbolic link creation by
setting IMAGE_LINK_NAME value to empty string, then he/she needs to
override the value of IMAGE_NAME name as well in order to avoid build
breakage.

Mitigate the issue by placing the common segment in a separate variable
which is referenced in default values of both IMAGE_NAME and
IMAGE_LINK_NAME.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 meta/classes-recipe/image-artifact-names.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/image-artifact-names.bbclass b/meta/classes-recipe/image-artifact-names.bbclass
index bc76ff0e16..8acdc16072 100644
--- a/meta/classes-recipe/image-artifact-names.bbclass
+++ b/meta/classes-recipe/image-artifact-names.bbclass
@@ -11,8 +11,9 @@ 
 IMAGE_BASENAME ?= "${PN}"
 IMAGE_VERSION_SUFFIX ?= "-${DATETIME}"
 IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH"
-IMAGE_NAME ?= "${IMAGE_LINK_NAME}${IMAGE_VERSION_SUFFIX}"
-IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}${IMAGE_MACHINE_SUFFIX}${IMAGE_NAME_SUFFIX}"
+IMAGE_NAME_BASE ?= "${IMAGE_BASENAME}${IMAGE_MACHINE_SUFFIX}${IMAGE_NAME_SUFFIX}"
+IMAGE_NAME ?= "${IMAGE_NAME_BASE}${IMAGE_VERSION_SUFFIX}"
+IMAGE_LINK_NAME ?= "${IMAGE_NAME_BASE}"
 
 # This needs to stay in sync with IMAGE_LINK_NAME, but with INITRAMFS_IMAGE instead of IMAGE_BASENAME
 # and without ${IMAGE_NAME_SUFFIX} which all initramfs images should set to empty