summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb')
-rw-r--r--meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb72
1 files changed, 72 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb b/meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb
new file mode 100644
index 00000000..0c0f1549
--- /dev/null
+++ b/meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb
@@ -0,0 +1,72 @@
1DESCRIPTION = "Image Selector"
2
3LICENSE = "CLOSED"
4
5PROVIDES = "virtual/imgsel"
6
7INHIBIT_DEFAULT_DEPS = "1"
8
9COMPATIBLE_MACHINE = "^$"
10COMPATIBLE_MACHINE:zynqmp = "zynqmp"
11
12# Since we're just copying, we can run any config
13COMPATIBLE_HOST = ".*"
14
15# Default expects the user to provide the imageselector in the deploy
16# directory, named "image-selector-${MACHINE}.bin" and "image-selector-${MACHINE}.bin"
17# A machine, multiconfig, or local.conf should override this
18IMGSEL_DEPENDS ??= ""
19IMGSEL_MCDEPENDS ??= ""
20IMGSEL_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}"
21IMGSEL_DEPLOY_DIR[vardepsexclude] += "TOPDIR"
22IMGSEL_IMAGE_NAME ??= "image-selector-${MACHINE}"
23
24# Default is for the multilib case (without the extension .bin)
25IMGSEL_FILE ??= "${IMGSEL_DEPLOY_DIR}/${IMGSEL_IMAGE_NAME}"
26IMGSEL_FILE[vardepsexclude] = "IMGSEL_DEPLOY_DIR"
27
28do_fetch[depends] += "${IMGSEL_DEPENDS}"
29do_fetch[mcdepends] += "${IMGSEL_MCDEPENDS}"
30
31inherit deploy
32
33# If the item is already in OUR deploy_image_dir, nothing to deploy!
34SHOULD_DEPLOY = "${@'false' if (d.getVar('IMGSEL_FILE')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}"
35do_deploy() {
36 # If the item is already in OUR deploy_image_dir, nothing to deploy!
37 if ${SHOULD_DEPLOY}; then
38 install -Dm 0644 ${IMGSEL_FILE}.bin ${DEPLOYDIR}/${IMGSEL_IMAGE_NAME}.bin
39 install -Dm 0644 ${IMGSEL_FILE}.elf ${DEPLOYDIR}/${IMGSEL_IMAGE_NAME}.elf
40 fi
41}
42
43addtask deploy before do_build after do_install
44
45INSANE_SKIP:${PN} = "arch"
46INSANE_SKIP:${PN}-dbg = "arch"
47
48# Disable buildpaths QA check warnings.
49INSANE_SKIP:${PN} += "buildpaths"
50
51#SYSROOT_DIRS += "/boot"
52#FILES:${PN} = "/boot/${PN}.bin"
53
54def check_imgsel_variables(d):
55 # If both are blank, the user MUST pass in the path to the firmware!
56 if not d.getVar('IMGSEL_DEPENDS') and not d.getVar('IMGSEL_MCDEPENDS'):
57 # Don't cache this, as the items on disk can change!
58 d.setVar('BB_DONT_CACHE', '1')
59
60 if not os.path.exists(d.getVar('IMGSEL_FILE') + ".bin"):
61 if not d.getVar('WITHIN_EXT_SDK'):
62 raise bb.parse.SkipRecipe("The expected file %s.bin is not available.\nSet IMGSEL_FILE to the path with a precompiled IMGSEL binary." % d.getVar('IMGSEL_FILE'))
63 else:
64 # We found the file, so be sure to track it
65 d.setVar('SRC_URI', 'file://${IMGSEL_FILE}.bin')
66 d.setVarFlag('do_install', 'file-checksums', '${IMGSEL_FILE}.bin:True')
67 d.setVarFlag('do_deploy', 'file-checksums', '${IMGSEL_FILE}.bin:True')
68
69python() {
70 # Need to allow bbappends to change the check
71 check_imgsel_variables(d)
72}