summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/image-artifact-names.bbclass9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/classes/image-artifact-names.bbclass b/meta/classes/image-artifact-names.bbclass
index 3ac8dd731a..67f04e8165 100644
--- a/meta/classes/image-artifact-names.bbclass
+++ b/meta/classes/image-artifact-names.bbclass
@@ -4,7 +4,7 @@
4 4
5IMAGE_BASENAME ?= "${PN}" 5IMAGE_BASENAME ?= "${PN}"
6IMAGE_VERSION_SUFFIX ?= "-${DATETIME}" 6IMAGE_VERSION_SUFFIX ?= "-${DATETIME}"
7IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME" 7IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH"
8IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" 8IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
9IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}" 9IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}"
10 10
@@ -13,3 +13,10 @@ IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}"
13# by default) followed by additional suffices which describe the format (.ext4, 13# by default) followed by additional suffices which describe the format (.ext4,
14# .ext4.xz, etc.). 14# .ext4.xz, etc.).
15IMAGE_NAME_SUFFIX ??= ".rootfs" 15IMAGE_NAME_SUFFIX ??= ".rootfs"
16
17python () {
18 if bb.data.inherits_class('reproducible_build', d) and bb.data.inherits_class('deploy', d) and d.getVar("IMAGE_VERSION_SUFFIX") == "-${DATETIME}":
19 import datetime
20 d.setVar("IMAGE_VERSION_SUFFIX", "-" + datetime.datetime.fromtimestamp(int(d.getVar("SOURCE_DATE_EPOCH")), datetime.timezone.utc).strftime('%Y%m%d%H%M%S'))
21 d.setVarFlag("IMAGE_VERSION_SUFFIX", "vardepvalue", "")
22}