xen, xen-tools: updates to the deploy task

Amend addtask for deploy in both recipes: add deploy before do_build to
ensure that it completes before the build step stamp is written.
Suggested-by: Bertrand Marquis <bertrand.marquis@arm.com>

Add comments explaining the scheduling of the deploy task to
both the hypervisor and tools recipes.

In the hypervisor build, change deploy to obtain files from ${B} rather
than ${D}, since it allows a bbappend to modify boot binary file
destinations in do_install without breaking do_deploy.

To ensure that a deployed hypervisor has matching tools in any image
being built, add a dependency to make sure that the tools have built and
been staged first:
    do_deploy[depends] += "xen-tools:do_populate_sysroot"

Also add a dependency to ensure that anything that the tools recipe
deploys, such as a XSM policy file, has been deployed first:
    do_deploy[depends] += "xen-tools:do_deploy"

Schedule deploy tasks after populate_sysroot to ensure that deployed
binaries match those staged for inclusion in the image rootfs.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Christopher Clark 2020-02-25 16:16:06 -08:00 committed by Bruce Ashfield
parent 1d99ae2bcf
commit 5591f772fe
2 changed files with 31 additions and 10 deletions

View File

@ -47,20 +47,34 @@ do_install() {
do_deploy() {
install -d ${DEPLOYDIR}
if [ -f ${D}/boot/xen ]; then
install -m 0644 ${D}/boot/xen ${DEPLOYDIR}/xen-${MACHINE}
if [ -f ${B}/xen/xen.gz ]; then
install -m 0644 ${B}/xen/xen ${DEPLOYDIR}/xen-${MACHINE}
fi
if [ -f ${D}/boot/xen.gz ]; then
install -m 0644 ${D}/boot/xen.gz ${DEPLOYDIR}/xen-${MACHINE}.gz
if [ -f ${B}/xen/xen.gz ]; then
install -m 0644 ${B}/xen/xen.gz ${DEPLOYDIR}/xen-${MACHINE}.gz
fi
if [ -f ${D}/usr/lib64/efi/xen.efi ]; then
install -m 0644 ${D}/usr/lib64/efi/xen.efi ${DEPLOYDIR}/xen-${MACHINE}.efi
if [ -f ${B}/xen/xen.efi ]; then
install -m 0644 ${B}/xen/xen.efi ${DEPLOYDIR}/xen-${MACHINE}.efi
fi
}
addtask deploy after do_populate_sysroot
# Scheduling the do_deploy task:
# - deploy copies files from ${B} that are written during do_compile so must
# at least run afer that task has completed
# - the hypervisor binaries may be included in the image filesystem, so we
# must ensure that the binaries deployed match what is staged in the sysroot:
# so do deploy must run after do_populate_sysroot -- which is always after
# do_compile, so that handles 'after do_compile' too
# - add the task before do_build to ensure that deployment has completed when
# the recipe build done stamp is written
addtask deploy after do_populate_sysroot before do_build
# To ensure that a deployed hypervisor has matching tools, add a dependency to
# make sure that the tools have built and been staged:
do_deploy[depends] += "xen-tools:do_populate_sysroot"
# Also ensure anything that the tools recipe needs to deploy, such as a
# XSM policy file, has been deployed first:
do_deploy[depends] += "xen-tools:do_deploy"
# Enable use of menuconfig directly from bitbake and also within the devshell
OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO"

View File

@ -781,5 +781,12 @@ do_deploy() {
ln -sf ${FLASK_POLICY_FILE} ${DEPLOYDIR}/xenpolicy-${MACHINE}
fi
}
addtask deploy after do_populate_sysroot
# Scheduling the do_deploy task:
# - deploy copies files from ${D} that are written during do_install so must run
# after that task
# - the tools binaries are included in the image filesystem, so we must ensure
# that the binaries deployed match what is staged in the sysroot:
# so do_deploy must run after do_populate_sysroot
# - add the task before do_build to ensure that deployment has completed when
# the recipe build done stamp is written
addtask deploy after do_install do_populate_sysroot before do_build