diff options
Diffstat (limited to 'meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb')
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/embeddedsw/imgsel.bb | 72 |
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 @@ | |||
| 1 | DESCRIPTION = "Image Selector" | ||
| 2 | |||
| 3 | LICENSE = "CLOSED" | ||
| 4 | |||
| 5 | PROVIDES = "virtual/imgsel" | ||
| 6 | |||
| 7 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 8 | |||
| 9 | COMPATIBLE_MACHINE = "^$" | ||
| 10 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | ||
| 11 | |||
| 12 | # Since we're just copying, we can run any config | ||
| 13 | COMPATIBLE_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 | ||
| 18 | IMGSEL_DEPENDS ??= "" | ||
| 19 | IMGSEL_MCDEPENDS ??= "" | ||
| 20 | IMGSEL_DEPLOY_DIR ??= "${DEPLOY_DIR_IMAGE}" | ||
| 21 | IMGSEL_DEPLOY_DIR[vardepsexclude] += "TOPDIR" | ||
| 22 | IMGSEL_IMAGE_NAME ??= "image-selector-${MACHINE}" | ||
| 23 | |||
| 24 | # Default is for the multilib case (without the extension .bin) | ||
| 25 | IMGSEL_FILE ??= "${IMGSEL_DEPLOY_DIR}/${IMGSEL_IMAGE_NAME}" | ||
| 26 | IMGSEL_FILE[vardepsexclude] = "IMGSEL_DEPLOY_DIR" | ||
| 27 | |||
| 28 | do_fetch[depends] += "${IMGSEL_DEPENDS}" | ||
| 29 | do_fetch[mcdepends] += "${IMGSEL_MCDEPENDS}" | ||
| 30 | |||
| 31 | inherit deploy | ||
| 32 | |||
| 33 | # If the item is already in OUR deploy_image_dir, nothing to deploy! | ||
| 34 | SHOULD_DEPLOY = "${@'false' if (d.getVar('IMGSEL_FILE')).startswith(d.getVar('DEPLOY_DIR_IMAGE')) else 'true'}" | ||
| 35 | do_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 | |||
| 43 | addtask deploy before do_build after do_install | ||
| 44 | |||
| 45 | INSANE_SKIP:${PN} = "arch" | ||
| 46 | INSANE_SKIP:${PN}-dbg = "arch" | ||
| 47 | |||
| 48 | # Disable buildpaths QA check warnings. | ||
| 49 | INSANE_SKIP:${PN} += "buildpaths" | ||
| 50 | |||
| 51 | #SYSROOT_DIRS += "/boot" | ||
| 52 | #FILES:${PN} = "/boot/${PN}.bin" | ||
| 53 | |||
| 54 | def 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 | |||
| 69 | python() { | ||
| 70 | # Need to allow bbappends to change the check | ||
| 71 | check_imgsel_variables(d) | ||
| 72 | } | ||
