[meta-freescale] [PATCH] utilities.inc: Use only the basename for dtb files

Fabio Berton fabio.berton at ossystems.com.br
Fri Jul 20 13:45:47 PDT 2018


Use make_dtb_boot_files function to use basename from
KERNEL_DEVICETREE files. This is useful for dtb with name:

  whatever/my_dtb_file.dtb

Signed-off-by: Fabio Berton <fabio.berton at ossystems.com.br>
---
 conf/machine/include/imx-base.inc  |  4 +++-
 conf/machine/include/utilities.inc | 16 ++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 conf/machine/include/utilities.inc

diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc
index b130ef72..52700105 100644
--- a/conf/machine/include/imx-base.inc
+++ b/conf/machine/include/imx-base.inc
@@ -3,6 +3,8 @@
 include conf/machine/include/fsl-default-settings.inc
 include conf/machine/include/fsl-default-versions.inc
 
+require conf/machine/include/utilities.inc
+
 # Set specific make target and binary suffix
 PREFERRED_PROVIDER_u-boot ??= "u-boot-fslc"
 PREFERRED_PROVIDER_virtual/bootloader ??= "u-boot-fslc"
@@ -291,7 +293,7 @@ IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}"
 
 IMAGE_BOOT_FILES ?= " \
     ${KERNEL_IMAGETYPE} \
-    ${KERNEL_DEVICETREE} \
+    ${@make_dtb_boot_files(d)} \
 "
 
 ### wic default support
diff --git a/conf/machine/include/utilities.inc b/conf/machine/include/utilities.inc
new file mode 100644
index 00000000..e6cfda80
--- /dev/null
+++ b/conf/machine/include/utilities.inc
@@ -0,0 +1,16 @@
+### Machine definition file utilities
+
+def make_dtb_boot_files(d):
+    # Generate IMAGE_BOOT_FILES entries for device tree files listed in
+    # KERNEL_DEVICETREE.
+    # Use only the basename for dtb files:
+    alldtbs = d.getVar('KERNEL_DEVICETREE')
+
+    def transform(dtb):
+        if dtb.endswith('dtb') or dtb.endswith('dtbo'):
+            # eg: whatever/bcm2708-rpi-b.dtb has:
+            #     DEPLOYDIR file: bcm2708-rpi-b.dtb
+            #     destination: bcm2708-rpi-b.dtb
+            return os.path.basename(dtb)
+
+    return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
-- 
2.18.0



More information about the meta-freescale mailing list