diff options
-rw-r--r-- | meta/classes/image-artifact-names.bbclass | 9 |
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 | ||
5 | IMAGE_BASENAME ?= "${PN}" | 5 | IMAGE_BASENAME ?= "${PN}" |
6 | IMAGE_VERSION_SUFFIX ?= "-${DATETIME}" | 6 | IMAGE_VERSION_SUFFIX ?= "-${DATETIME}" |
7 | IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME" | 7 | IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH" |
8 | IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" | 8 | IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" |
9 | IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}" | 9 | IMAGE_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.). |
15 | IMAGE_NAME_SUFFIX ??= ".rootfs" | 15 | IMAGE_NAME_SUFFIX ??= ".rootfs" |
16 | |||
17 | python () { | ||
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 | } | ||