summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Hernandez <alejandro@enedino.org>2020-07-02 18:45:16 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-03 20:17:29 +0100
commit5f460e4c1846230cefe790d378c8a59f494620e1 (patch)
treee77fcf24ecdda7a3edae21ff03dc67efcd5fc609
parent6178eb247c73f9b2c7bd73f48cff8a7445e8e10c (diff)
downloadpoky-5f460e4c1846230cefe790d378c8a59f494620e1.tar.gz
baremetal-helloworld: Use do_image_complete instead of do_deploy
To better align with upstream and mimic how images are built, use do_image and do_image_complete instead of do_deploy to populate artifacts on DEPLOY_DIR_IMAGE. (From OE-Core rev: 9edb08c31700a85ce87344829989c1069d2760ab) Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb31
1 files changed, 23 insertions, 8 deletions
diff --git a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
index e84a90f28c..a5789e27d3 100644
--- a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
+++ b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
@@ -36,21 +36,19 @@ do_install(){
36 36
37# Borrowed from meta-freertos 37# Borrowed from meta-freertos
38inherit rootfs-postcommands 38inherit rootfs-postcommands
39inherit deploy
40IMGDEPLOYDIR ?= "${WORKDIR}/deploy-${PN}-image-complete" 39IMGDEPLOYDIR ?= "${WORKDIR}/deploy-${PN}-image-complete"
41do_deploy[dirs] = "${DEPLOYDIR} ${DEPLOY_DIR_IMAGE}"
42do_rootfs[dirs] = "${DEPLOYDIR} ${DEPLOY_DIR_IMAGE}" 40do_rootfs[dirs] = "${DEPLOYDIR} ${DEPLOY_DIR_IMAGE}"
43DEPLOYDIR = "${IMGDEPLOYDIR}" 41DEPLOYDIR = "${IMGDEPLOYDIR}"
44IMAGE_LINK_NAME ?= "baremetal-helloworld-image-${MACHINE}" 42IMAGE_LINK_NAME ?= "baremetal-helloworld-image-${MACHINE}"
45IMAGE_NAME_SUFFIX ?= "" 43IMAGE_NAME_SUFFIX ?= ""
46 44
47do_deploy(){ 45do_image_complete(){
48 install ${D}/${datadir}/hello_baremetal_${MACHINE}.bin ${DEPLOYDIR}/${IMAGE_LINK_NAME}.bin 46 :
49 install ${D}/${datadir}/hello_baremetal_${MACHINE}.elf ${DEPLOYDIR}/${IMAGE_LINK_NAME}.elf
50} 47}
51 48
52do_image(){ 49do_image(){
53 : 50 install ${D}/${datadir}/hello_baremetal_${MACHINE}.bin ${DEPLOYDIR}/${IMAGE_LINK_NAME}.bin
51 install ${D}/${datadir}/hello_baremetal_${MACHINE}.elf ${DEPLOYDIR}/${IMAGE_LINK_NAME}.elf
54} 52}
55 53
56FILES_${PN} += " \ 54FILES_${PN} += " \
@@ -83,11 +81,28 @@ QB_OPT_APPEND = "-nographic"
83QB_DEFAULT_FSTYPE = "bin" 81QB_DEFAULT_FSTYPE = "bin"
84QB_DTB = "" 82QB_DTB = ""
85 83
84
85# Assure binaries, manifest and qemubootconf are populated on DEPLOY_DIR_IMAGE
86do_image_complete[dirs] = "${TOPDIR}"
87do_image_complete[umask] = "022"
88SSTATETASKS += "do_image_complete"
89SSTATE_SKIP_CREATION_task-image-complete = '1'
90do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}"
91do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
92do_image_complete[stamp-extra-info] = "${MACHINE_ARCH}"
93addtask do_image_complete after do_image before do_build
94
95python do_image_complete_setscene () {
96 sstate_setscene(d)
97}
98addtask do_image_complete_setscene
99
86# This next part is necessary to trick the build system into thinking 100# This next part is necessary to trick the build system into thinking
87# its building an image recipe so it generates the qemuboot.conf 101# its building an image recipe so it generates the qemuboot.conf
88addtask do_deploy after do_write_qemuboot_conf before do_build 102# addtask do_deploy after do_write_qemuboot_conf before do_build
89addtask do_rootfs before do_deploy after do_install 103addtask do_rootfs before do_image after do_install
90addtask do_image after do_rootfs before do_build 104addtask do_image after do_rootfs before do_build
105addtask do_image_complete after do_image before do_build
91inherit qemuboot 106inherit qemuboot
92 107
93# Based on image.bbclass to make sure we build qemu 108# Based on image.bbclass to make sure we build qemu