diff mbox series

[cip-dec,isar-cip-core,RFC,v2,1/3] efibootguard-efi.py: copy signed ebg binary to DEPLOY_DIR

Message ID 20231211122528.486786-2-Quirin.Gylstorff@siemens.com (mailing list archive)
State Superseded
Headers show
Series Add Bootloader to Update binary | expand

Commit Message

Gylstorff Quirin Dec. 11, 2023, 12:19 p.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

This allows to add the signed ebg binary to a swu file for
updating the bootloader.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 scripts/lib/wic/plugins/source/efibootguard-efi.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/scripts/lib/wic/plugins/source/efibootguard-efi.py b/scripts/lib/wic/plugins/source/efibootguard-efi.py
index 86a22e0..f40b706 100644
--- a/scripts/lib/wic/plugins/source/efibootguard-efi.py
+++ b/scripts/lib/wic/plugins/source/efibootguard-efi.py
@@ -68,6 +68,12 @@  class EfibootguardEFIPlugin(SourcePlugin):
             "riscv64": "riscv64-linux-gnu",
         }
 
+        deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+        if not deploy_dir:
+            msger.error("DEPLOY_DIR_IMAGE not set, exiting\n")
+            exit(1)
+        creator.deploy_dir = deploy_dir
+
         distro_arch = get_bitbake_var("DISTRO_ARCH")
         bootloader = "/usr/lib/{libpath}/efibootguard/efibootguard{efiarch}.efi".format(
             libpath=distro_to_lib_arch[distro_arch],
@@ -90,6 +96,13 @@  class EfibootguardEFIPlugin(SourcePlugin):
                                               part_rootfs_dir,
                                               name)
         exec_cmd(cp_cmd, True)
+        msger.debug("copy {signed_bootloader} to deploy")
+        cp_to_deploy_cmd = "cp %s/%s %s/%s" % (cr_workdir,
+                                               signed_bootloader,
+                                               deploy_dir,
+                                               name)
+        exec_cmd(cp_to_deploy_cmd, True)
+
         du_cmd = "du --apparent-size -ks %s" % part_rootfs_dir
         blocks = int(exec_cmd(du_cmd).split()[0])