From c6ae24ee38a69e4bcd463337aed43276d70845df Mon Sep 17 00:00:00 2001 From: John Toomey Date: Wed, 3 Apr 2024 15:36:32 +0100 Subject: bootbin-version-string: Add text version file Add a version header file in plain text format required for Versal machines using the optional data field in the BIF file for version information Signed-off-by: John Toomey Signed-off-by: Mark Hatle --- .../recipes-bsp/bootbin/bootbin-version-string.bb | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-string.bb diff --git a/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-string.bb b/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-string.bb new file mode 100644 index 00000000..af30a17d --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-string.bb @@ -0,0 +1,32 @@ +DESCRIPTION = "Bootbin version file - text format" +SUMMARY = "The BIF file for bootbin requires a version file in a text format" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +COMPATIBLE_MACHINE = "^$" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +BOOTBIN_VER_MAIN ?= "" +BOOTBIN_VER_SUFFIX ?= "${@(d.getVar('XILINX_VER_BUILD') or '')[:8] if d.getVar('XILINX_VER_UPDATE') != 'release' and not d.getVar('XILINX_VER_UPDATE').startswith('update') else ''}" +BOOTBIN_VER_FILE = "bootbin-version-string.txt" + +#BOOTBIN_MANIFEST_FILE ?= "bootbin-version-header.manifest" + +inherit deploy image-artifact-names + +python do_configure() { + if d.getVar("BOOTBIN_VER_SUFFIX"): + version = version + "-" + d.getVar("BOOTBIN_VER_SUFFIX") + with open(d.expand("${B}/${BOOTBIN_VER_FILE}"), "w") as f: + f.write(version) +} + +do_deploy() { + install -m 0644 ${B}/${BOOTBIN_VER_FILE} ${DEPLOYDIR}/${IMAGE_NAME}.txt + ln -s ${IMAGE_NAME}.txt ${DEPLOYDIR}/${IMAGE_LINK_NAME}.txt +# install -m 0644 ${B}/${BOOTBIN_MANIFEST_FILE} ${DEPLOYDIR}/${IMAGE_NAME}.manifest +# ln -s ${IMAGE_NAME}.manifest ${DEPLOYDIR}/${IMAGE_LINK_NAME}.manifest +} + +addtask deploy after do_compile -- cgit v1.2.3-54-g00ecf