Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 1 | inherit esw deploy |
| 2 | |
| 3 | ESW_COMPONENT_SRC = "/lib/sw_apps/hello_world/src/" |
| 4 | |
| 5 | DEPENDS += "dtc-native python3-dtc-native libxil xiltimer device-tree" |
| 6 | |
| 7 | inherit python3native |
| 8 | |
| 9 | do_configure_prepend() { |
| 10 | cd ${S} |
| 11 | nativepython3 ${S}/scripts/linker_gen.py -d ${DTBFILE} -o ${OECMAKE_SOURCEPATH} |
| 12 | } |
| 13 | |
| 14 | do_install() { |
| 15 | install -d ${D}/${base_libdir}/firmware |
| 16 | # Note that we have to make the ELF executable for it to be stripped |
| 17 | install -m 0755 ${B}/hello_world* ${D}/${base_libdir}/firmware |
| 18 | } |
| 19 | |
| 20 | HELLO_WORLD_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" |
| 21 | HELLO_WORLD_BASE_NAME[vardepsexclude] = "DATETIME" |
| 22 | |
| 23 | do_deploy() { |
| 24 | |
| 25 | # We need to deploy the stripped elf, hence why not doing it from ${D} |
| 26 | install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/hello_world.elf ${DEPLOYDIR}/${HELLO_WORLD_BASE_NAME}.elf |
| 27 | ln -sf ${HELLO_WORLD_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf |
| 28 | ${OBJCOPY} -O binary ${WORKDIR}/package/${base_libdir}/firmware/hello_world.elf ${WORKDIR}/package/${base_libdir}/firmware/hello_world.bin |
| 29 | install -m 0644 ${WORKDIR}/package/${base_libdir}/firmware/hello_world.bin ${DEPLOYDIR}/${HELLO_WORLD_BASE_NAME}.bin |
| 30 | ln -sf ${HELLO_WORLD_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin |
| 31 | } |
| 32 | |
| 33 | addtask deploy before do_build after do_package |
| 34 | |
| 35 | FILES_${PN} = "${base_libdir}/firmware/hello_world*" |