summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core
diff options
context:
space:
mode:
authorJohn Toomey <john.toomey@amd.com>2024-01-29 13:41:46 +0000
committerMark Hatle <mark.hatle@amd.com>2024-01-29 16:55:16 -0600
commitfe1fee9a45076aab2e39e38b5705d1ad0aa06de5 (patch)
tree262502966b6456cb9fb3d9eebe365b28f89a06fa /meta-xilinx-core
parent57b22cc33a24b32c4f3cef364378c5216d2fda87 (diff)
downloadmeta-xilinx-fe1fee9a45076aab2e39e38b5705d1ad0aa06de5.tar.gz
bootbin-version-header: Move recipe from meta-kria
Signed-off-by: John Toomey <john.toomey@amd.com> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core')
-rw-r--r--meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-header.bb54
1 files changed, 54 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-header.bb b/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-header.bb
new file mode 100644
index 00000000..98eebc3e
--- /dev/null
+++ b/meta-xilinx-core/recipes-bsp/bootbin/bootbin-version-header.bb
@@ -0,0 +1,54 @@
1DESCRIPTION = "Bootbin version string file"
2SUMMARY = "The BIF file for bootbin requires a version file in a specific format"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
5
6COMPATIBLE_MACHINE = "^$"
7
8PACKAGE_ARCH = "${MACHINE_ARCH}"
9
10BOOTBIN_VER_MAIN ?= ""
11
12BOOTBIN_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 ''}"
13BOOTBIN_VER_FILE = "bootbin-version-header.txt"
14BOOTBIN_VER_MAX_LEN = "36"
15
16BOOTBIN_MANIFEST_FILE ?= "bootbin-version-header.manifest"
17
18inherit deploy image-artifact-names
19
20python do_configure() {
21 if d.getVar("BOOTBIN_VER_SUFFIX"):
22 version = version + "-" + d.getVar("BOOTBIN_VER_SUFFIX")
23
24 if len(version) > int(d.getVar("BOOTBIN_VER_MAX_LEN")):
25 bb.error("version string too long")
26
27 with open(d.expand("${B}/${BOOTBIN_VER_FILE}"), "w") as f:
28 f.write(version.encode("utf-8").hex())
29
30 with open(d.expand("${B}/${BOOTBIN_MANIFEST_FILE}"), "w") as f:
31 f.write("* %s\n" % d.getVar('PN'))
32 f.write("VERSION: %s\n" % version)
33 f.write("PV: %s\n" % d.getVar('PV'))
34 f.write("XILINX_VER_MAIN: %s\n" % d.getVar('XILINX_VER_MAIN'))
35 f.write("XILINX_VER_UPDATE: %s\n" % d.getVar('XILINX_VER_UPDATE'))
36 f.write("XILINX_VER_BUILD: %s\n\n" % d.getVar('XILINX_VER_BUILD'))
37}
38
39do_install() {
40 install -d ${D}/boot
41 install -m 0644 ${B}/${BOOTBIN_VER_FILE} ${D}/boot/
42}
43
44do_deploy() {
45 install -m 0644 ${B}/${BOOTBIN_VER_FILE} ${DEPLOYDIR}/${IMAGE_NAME}.txt
46 ln -s ${IMAGE_NAME}.txt ${DEPLOYDIR}/${IMAGE_LINK_NAME}.txt
47 install -m 0644 ${B}/${BOOTBIN_MANIFEST_FILE} ${DEPLOYDIR}/${IMAGE_NAME}.manifest
48 ln -s ${IMAGE_NAME}.manifest ${DEPLOYDIR}/${IMAGE_LINK_NAME}.manifest
49}
50
51addtask deploy after do_compile
52
53SYSROOT_DIRS += "/boot"
54FILES:${PN} += "/boot/${BOOTBIN_VER_FILE}"