diff options
| author | Christopher Clark <christopher.w.clark@gmail.com> | 2020-02-25 16:16:06 -0800 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-02-27 16:59:23 -0500 |
| commit | 5591f772fefde05ee462138246c4b555a39125b3 (patch) | |
| tree | abad313d43fc7a86bc1a0f85688a4793fb13ef2f | |
| parent | 1d99ae2bcf068747313d576886e3a0728ce7212a (diff) | |
| download | meta-virtualization-5591f772fefde05ee462138246c4b555a39125b3.tar.gz | |
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>
| -rw-r--r-- | recipes-extended/xen/xen-hypervisor.inc | 30 | ||||
| -rw-r--r-- | recipes-extended/xen/xen-tools.inc | 11 |
2 files changed, 31 insertions, 10 deletions
diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc index 41de9b6a..21d9c7ff 100644 --- a/recipes-extended/xen/xen-hypervisor.inc +++ b/recipes-extended/xen/xen-hypervisor.inc | |||
| @@ -47,20 +47,34 @@ do_install() { | |||
| 47 | do_deploy() { | 47 | do_deploy() { |
| 48 | install -d ${DEPLOYDIR} | 48 | install -d ${DEPLOYDIR} |
| 49 | 49 | ||
| 50 | if [ -f ${D}/boot/xen ]; then | 50 | if [ -f ${B}/xen/xen.gz ]; then |
| 51 | install -m 0644 ${D}/boot/xen ${DEPLOYDIR}/xen-${MACHINE} | 51 | install -m 0644 ${B}/xen/xen ${DEPLOYDIR}/xen-${MACHINE} |
| 52 | fi | 52 | fi |
| 53 | 53 | ||
| 54 | if [ -f ${D}/boot/xen.gz ]; then | 54 | if [ -f ${B}/xen/xen.gz ]; then |
| 55 | install -m 0644 ${D}/boot/xen.gz ${DEPLOYDIR}/xen-${MACHINE}.gz | 55 | install -m 0644 ${B}/xen/xen.gz ${DEPLOYDIR}/xen-${MACHINE}.gz |
| 56 | fi | 56 | fi |
| 57 | 57 | ||
| 58 | if [ -f ${D}/usr/lib64/efi/xen.efi ]; then | 58 | if [ -f ${B}/xen/xen.efi ]; then |
| 59 | install -m 0644 ${D}/usr/lib64/efi/xen.efi ${DEPLOYDIR}/xen-${MACHINE}.efi | 59 | install -m 0644 ${B}/xen/xen.efi ${DEPLOYDIR}/xen-${MACHINE}.efi |
| 60 | fi | 60 | fi |
| 61 | } | 61 | } |
| 62 | 62 | # Scheduling the do_deploy task: | |
| 63 | addtask deploy after do_populate_sysroot | 63 | # - deploy copies files from ${B} that are written during do_compile so must |
| 64 | # at least run afer that task has completed | ||
| 65 | # - the hypervisor binaries may be included in the image filesystem, so we | ||
| 66 | # must ensure that the binaries deployed match what is staged in the sysroot: | ||
| 67 | # so do deploy must run after do_populate_sysroot -- which is always after | ||
| 68 | # do_compile, so that handles 'after do_compile' too | ||
| 69 | # - add the task before do_build to ensure that deployment has completed when | ||
| 70 | # the recipe build done stamp is written | ||
| 71 | addtask deploy after do_populate_sysroot before do_build | ||
| 72 | # To ensure that a deployed hypervisor has matching tools, add a dependency to | ||
| 73 | # make sure that the tools have built and been staged: | ||
| 74 | do_deploy[depends] += "xen-tools:do_populate_sysroot" | ||
| 75 | # Also ensure anything that the tools recipe needs to deploy, such as a | ||
| 76 | # XSM policy file, has been deployed first: | ||
| 77 | do_deploy[depends] += "xen-tools:do_deploy" | ||
| 64 | 78 | ||
| 65 | # Enable use of menuconfig directly from bitbake and also within the devshell | 79 | # Enable use of menuconfig directly from bitbake and also within the devshell |
| 66 | OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO" | 80 | OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO" |
diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc index 864c40cd..8bdbfec9 100644 --- a/recipes-extended/xen/xen-tools.inc +++ b/recipes-extended/xen/xen-tools.inc | |||
| @@ -781,5 +781,12 @@ do_deploy() { | |||
| 781 | ln -sf ${FLASK_POLICY_FILE} ${DEPLOYDIR}/xenpolicy-${MACHINE} | 781 | ln -sf ${FLASK_POLICY_FILE} ${DEPLOYDIR}/xenpolicy-${MACHINE} |
| 782 | fi | 782 | fi |
| 783 | } | 783 | } |
| 784 | 784 | # Scheduling the do_deploy task: | |
| 785 | addtask deploy after do_populate_sysroot | 785 | # - deploy copies files from ${D} that are written during do_install so must run |
| 786 | # after that task | ||
| 787 | # - the tools binaries are included in the image filesystem, so we must ensure | ||
| 788 | # that the binaries deployed match what is staged in the sysroot: | ||
| 789 | # so do_deploy must run after do_populate_sysroot | ||
| 790 | # - add the task before do_build to ensure that deployment has completed when | ||
| 791 | # the recipe build done stamp is written | ||
| 792 | addtask deploy after do_install do_populate_sysroot before do_build | ||
