Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1 | ################################################################## |
| 2 | # Specific image creation and rootfs population info. |
| 3 | ################################################################## |
| 4 | |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 5 | IMAGE_BASENAME ?= "${PN}" |
| 6 | IMAGE_VERSION_SUFFIX ?= "-${DATETIME}" |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 7 | IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH" |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 8 | IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" |
| 9 | IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 10 | |
| 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.). |
| 15 | IMAGE_NAME_SUFFIX ??= ".rootfs" |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 16 | |
| 17 | python () { |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 18 | if bb.data.inherits_class('deploy', d) and d.getVar("IMAGE_VERSION_SUFFIX") == "-${DATETIME}": |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 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 | } |