]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
image-artifact-names: add IMAGE_MACHINE_SUFFIX variable
authorMartin Jansa <Martin.Jansa@gmail.com>
Mon, 13 Mar 2023 12:15:36 +0000 (13:15 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 22 Mar 2023 13:53:24 +0000 (13:53 +0000)
* to make it easier for projects to avoid default -${MACHINE} suffix if
  the ${MACHINE} named DEPLOY_DIR_IMAGE works better for them

* also use IMAGE_LINK_NAME in IMAGE_NAME to make it more clear
  that IMAGE_NAME is the same as IMAGE_LINK_NAME but with version
  suffix

* adding it as separate variable helps us to catch the cases
  where we didn't respect ${IMAGE_LINK_NAME} variable and just used
  the common default ${IMAGE_BASENAME}-${MACHINE}.

[YOCTO #12937]

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/classes-recipe/image-artifact-names.bbclass
meta/classes-recipe/kernel-artifact-names.bbclass

index 9dc25b6dde683cf149a82782bc5d9ed322d81d70..ac2376d59a93bc3a77342af4dba2239e9dba66d5 100644 (file)
 IMAGE_BASENAME ?= "${PN}"
 IMAGE_VERSION_SUFFIX ?= "-${DATETIME}"
 IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH"
-IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
-IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}"
+IMAGE_NAME ?= "${IMAGE_LINK_NAME}${IMAGE_VERSION_SUFFIX}"
+IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}${IMAGE_MACHINE_SUFFIX}"
 
 # This needs to stay in sync with IMAGE_LINK_NAME, but with INITRAMFS_IMAGE instead of IMAGE_BASENAME
-INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}-${MACHINE}', ''][d.getVar('INITRAMFS_IMAGE') == '']}"
+INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}${IMAGE_MACHINE_SUFFIX}', ''][d.getVar('INITRAMFS_IMAGE') == '']}"
+
+# The default DEPLOY_DIR_IMAGE is ${MACHINE} directory:
+# meta/conf/bitbake.conf:DEPLOY_DIR_IMAGE ?= "${DEPLOY_DIR}/images/${MACHINE}"
+# so many people find it unnecessary to include this suffix to every image
+# stored there, but other people often fetch various images for different
+# MACHINEs to the same downloads directory and then the suffix is very helpful
+# add separate variable for projects to decide which scheme works best for them
+# without understanding the IMAGE_NAME/IMAGE_LINK_NAME structure.
+IMAGE_MACHINE_SUFFIX ??= "-${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
index 311075c68dc166906c50691eadd9761ab8ba87b0..1a7611a15e8ace95ff9d9ca6309c45f1b9d1808e 100644 (file)
@@ -12,7 +12,7 @@
 
 inherit image-artifact-names
 
-KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
+KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}${IMAGE_MACHINE_SUFFIX}${IMAGE_VERSION_SUFFIX}"
 KERNEL_ARTIFACT_LINK_NAME ?= "${MACHINE}"
 KERNEL_ARTIFACT_BIN_EXT ?= ".bin"