blob: f5769e520f5c55f2cbb7ed2fbf5014a6471c832c [file] [log] [blame]
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001##################################################################
2# Specific image creation and rootfs population info.
3##################################################################
4
Andrew Geisslerc3d88e42020-10-02 09:45:00 -05005IMAGE_BASENAME ?= "${PN}"
6IMAGE_VERSION_SUFFIX ?= "-${DATETIME}"
Patrick Williams93c203f2021-10-06 16:15:23 -05007IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH"
Andrew Geisslerc3d88e42020-10-02 09:45:00 -05008IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
9IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050010
11# IMAGE_NAME is the base name for everything produced when building images.
12# The actual image that contains the rootfs has an additional suffix (.rootfs
13# by default) followed by additional suffices which describe the format (.ext4,
14# .ext4.xz, etc.).
15IMAGE_NAME_SUFFIX ??= ".rootfs"
Patrick Williams93c203f2021-10-06 16:15:23 -050016
17python () {
Andrew Geisslereff27472021-10-29 15:35:00 -050018 if bb.data.inherits_class('deploy', d) and d.getVar("IMAGE_VERSION_SUFFIX") == "-${DATETIME}":
Patrick Williams93c203f2021-10-06 16:15:23 -050019 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}