diff mbox series

u-boot: add hook to prepare binaries before copying

Message ID 20250409221851.1005988-1-dmitry.baryshkov@oss.qualcomm.com
State New
Headers show
Series u-boot: add hook to prepare binaries before copying | expand

Commit Message

Dmitry Baryshkov April 9, 2025, 10:18 p.m. UTC
BSP layers might need to perform additional steps on the U-Boot binary,
which are not a part of the oe_runmake invocation. For example, the
binary might need to be signed or converted to the Android boot image.

In order to let BSP recipes to perform such tasks without duplicating
u-boot.inc functions, add a special hook to be called before
uboot_compile_config_copy_binary().

Note: it is of course possible to push necessary steps into
uboot_compile_config_copy_binary() itself, but it doesn't look as clean
as just adding a hook.

Cc: Koen Kooi <koen.kooi@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 9464736b8418..fe86ba0ad011 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -81,6 +81,7 @@  uboot_compile_config () {
     for binary in ${UBOOT_BINARIES}; do
         k=$(expr $k + 1);
         if [ $k -eq $i ]; then
+            uboot_compile_config_prepare_binary $config $type $binary
             uboot_compile_config_copy_binary $config $type $binary
         fi
     done
@@ -93,6 +94,13 @@  uboot_compile_config () {
     fi
 }
 
+# Do nothing by default, this is a hook to be extended by BSP recipes
+uboot_compile_config_prepare_binary () {
+    config=$1
+    type=$2
+    binary=$3
+}
+
 uboot_compile_config_copy_binary () {
     config=$1
     type=$2