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>
This commit is contained in:
Alejandro Hernandez
2020-07-02 18:45:16 -07:00
committed by Richard Purdie
parent 6178eb247c
commit 5f460e4c18

View 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