diff mbox series

[isar-cip-core,v3,3/9] refactor(u-boot): deploy via sstate-cache

Message ID 20230302152659.2096307-4-felix.moessbauer@siemens.com (mailing list archive)
State Superseded
Headers show
Series Add swupdate support for riscv64 | expand

Commit Message

Felix Moessbauer March 2, 2023, 3:26 p.m. UTC
This patch refactors how the firmware.bin is deployed to the
DEPLOY_DIR_IMAGE. Instead of directly copying, we now deploy via the
sstate cache. By that, the cleanup is automatically handled and
potential conflicts on the filename are reported.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 recipes-bsp/u-boot/u-boot-qemu-common.inc | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Comments

Jan Kiszka March 3, 2023, 7:23 a.m. UTC | #1
On 02.03.23 16:26, Felix Moessbauer wrote:
> This patch refactors how the firmware.bin is deployed to the
> DEPLOY_DIR_IMAGE. Instead of directly copying, we now deploy via the
> sstate cache. By that, the cleanup is automatically handled and
> potential conflicts on the filename are reported.
> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>  recipes-bsp/u-boot/u-boot-qemu-common.inc | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/recipes-bsp/u-boot/u-boot-qemu-common.inc b/recipes-bsp/u-boot/u-boot-qemu-common.inc
> index 0a9a15a..4d8b240 100644
> --- a/recipes-bsp/u-boot/u-boot-qemu-common.inc
> +++ b/recipes-bsp/u-boot/u-boot-qemu-common.inc
> @@ -13,11 +13,21 @@ require recipes-bsp/u-boot/u-boot-common.inc
>  
>  U_BOOT_BIN = "u-boot.bin"
>  
> -do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
> +DEPLOYDIR_U_BOOT = "${WORKDIR}/deploy-u-boot"
> +SSTATETASKS += "do_deploy"
> +
> +do_deploy[cleandirs] += "${DEPLOYDIR_U_BOOT}"
> +do_deploy[sstate-inputdirs] = "${DEPLOYDIR_U_BOOT}"
> +do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
>  do_deploy() {
>      dpkg --fsys-tarfile "${WORKDIR}/u-boot-${MACHINE}_${PV}_${DISTRO_ARCH}.deb" | \
>          tar xOf - "./usr/lib/u-boot/${MACHINE}/${U_BOOT_BIN}" \
> -        > "${DEPLOY_DIR_IMAGE}/firmware.bin"
> +        > "${DEPLOYDIR_U_BOOT}/firmware.bin"
> +}
> +
> +python do_deploy_setscene () {
> +    sstate_setscene(d)
>  }
> +addtask do_deploy_setscene
>  
>  addtask deploy after do_dpkg_build before do_deploy_deb

Also this one will already go in.

Thanks,
Jan
diff mbox series

Patch

diff --git a/recipes-bsp/u-boot/u-boot-qemu-common.inc b/recipes-bsp/u-boot/u-boot-qemu-common.inc
index 0a9a15a..4d8b240 100644
--- a/recipes-bsp/u-boot/u-boot-qemu-common.inc
+++ b/recipes-bsp/u-boot/u-boot-qemu-common.inc
@@ -13,11 +13,21 @@  require recipes-bsp/u-boot/u-boot-common.inc
 
 U_BOOT_BIN = "u-boot.bin"
 
-do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
+DEPLOYDIR_U_BOOT = "${WORKDIR}/deploy-u-boot"
+SSTATETASKS += "do_deploy"
+
+do_deploy[cleandirs] += "${DEPLOYDIR_U_BOOT}"
+do_deploy[sstate-inputdirs] = "${DEPLOYDIR_U_BOOT}"
+do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
 do_deploy() {
     dpkg --fsys-tarfile "${WORKDIR}/u-boot-${MACHINE}_${PV}_${DISTRO_ARCH}.deb" | \
         tar xOf - "./usr/lib/u-boot/${MACHINE}/${U_BOOT_BIN}" \
-        > "${DEPLOY_DIR_IMAGE}/firmware.bin"
+        > "${DEPLOYDIR_U_BOOT}/firmware.bin"
+}
+
+python do_deploy_setscene () {
+    sstate_setscene(d)
 }
+addtask do_deploy_setscene
 
 addtask deploy after do_dpkg_build before do_deploy_deb