]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
baremetal-helloworld: Use do_image_complete instead of do_deploy
authorAlejandro Hernandez <alejandro@enedino.org>
Fri, 3 Jul 2020 01:45:16 +0000 (18:45 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 3 Jul 2020 19:16:20 +0000 (20:16 +0100)
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.

Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb

index e84a90f28c75cbab0a68318067f6625c2587dc6d..a5789e27d3ee8a9da7f1d3ce3f210cdfee6ecef1 100644 (file)
@@ -36,21 +36,19 @@ do_install(){
 
 # Borrowed from meta-freertos
 inherit rootfs-postcommands
-inherit deploy
 IMGDEPLOYDIR ?= "${WORKDIR}/deploy-${PN}-image-complete"
-do_deploy[dirs] = "${DEPLOYDIR} ${DEPLOY_DIR_IMAGE}"
 do_rootfs[dirs] = "${DEPLOYDIR} ${DEPLOY_DIR_IMAGE}"
 DEPLOYDIR = "${IMGDEPLOYDIR}"
 IMAGE_LINK_NAME ?= "baremetal-helloworld-image-${MACHINE}"
 IMAGE_NAME_SUFFIX ?= ""
 
-do_deploy(){
-    install ${D}/${datadir}/hello_baremetal_${MACHINE}.bin ${DEPLOYDIR}/${IMAGE_LINK_NAME}.bin
-    install ${D}/${datadir}/hello_baremetal_${MACHINE}.elf ${DEPLOYDIR}/${IMAGE_LINK_NAME}.elf
+do_image_complete(){
+    :
 }
 
 do_image(){
-    :
+    install ${D}/${datadir}/hello_baremetal_${MACHINE}.bin ${DEPLOYDIR}/${IMAGE_LINK_NAME}.bin
+    install ${D}/${datadir}/hello_baremetal_${MACHINE}.elf ${DEPLOYDIR}/${IMAGE_LINK_NAME}.elf
 }
 
 FILES_${PN} += " \
@@ -83,11 +81,28 @@ QB_OPT_APPEND = "-nographic"
 QB_DEFAULT_FSTYPE = "bin"
 QB_DTB = ""
 
+
+# Assure binaries, manifest and qemubootconf are populated on DEPLOY_DIR_IMAGE
+do_image_complete[dirs] = "${TOPDIR}"
+do_image_complete[umask] = "022"
+SSTATETASKS += "do_image_complete"
+SSTATE_SKIP_CREATION_task-image-complete = '1'
+do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}"
+do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
+do_image_complete[stamp-extra-info] = "${MACHINE_ARCH}"
+addtask do_image_complete after do_image before do_build
+
+python do_image_complete_setscene () {
+    sstate_setscene(d)
+}
+addtask do_image_complete_setscene
+
 # This next part is necessary to trick the build system into thinking
 # its building an image recipe so it generates the qemuboot.conf
-addtask do_deploy after do_write_qemuboot_conf before do_build
-addtask do_rootfs before do_deploy after do_install
+addtask do_deploy after do_write_qemuboot_conf before do_build
+addtask do_rootfs before do_image after do_install
 addtask do_image after do_rootfs before do_build
+addtask do_image_complete after do_image before do_build
 inherit qemuboot
 
 # Based on image.bbclass to make sure we build qemu