diff mbox series

[1/2] wic: bootimg-partition allow to set var to get boot files

Message ID 20240323195304.2909926-1-anibal@limonsoftware.com
State New
Headers show
Series [1/2] wic: bootimg-partition allow to set var to get boot files | expand

Commit Message

Anibal Limon March 23, 2024, 7:53 p.m. UTC
This is a generic functionality that takes a set of files and create a
boot parition based on IMAGE_BOOT_FILES var, allow to sepcify the
variable name so a BSP plugin can extend this and re-use the
functionality.

Signed-off-by: Anibal Limon <anibal@limonsoftware.com>
---
 scripts/lib/wic/plugins/source/bootimg-partition.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py
index 58f6da72c3..1071d1af3f 100644
--- a/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -32,6 +32,7 @@  class BootimgPartitionPlugin(SourcePlugin):
     """
 
     name = 'bootimg-partition'
+    image_boot_files_var_name = 'IMAGE_BOOT_FILES'
 
     @classmethod
     def do_configure_partition(cls, part, source_params, cr, cr_workdir,
@@ -56,12 +57,12 @@  class BootimgPartitionPlugin(SourcePlugin):
             else:
                 var = ""
 
-            boot_files = get_bitbake_var("IMAGE_BOOT_FILES" + var)
+            boot_files = get_bitbake_var(cls.image_boot_files_var_name + var)
             if boot_files is not None:
                 break
 
         if boot_files is None:
-            raise WicError('No boot files defined, IMAGE_BOOT_FILES unset for entry #%d' % part.lineno)
+            raise WicError('No boot files defined, %s unset for entry #%d' % (cls.image_boot_files_var_name, part.lineno))
 
         logger.debug('Boot files: %s', boot_files)