]> code.ossystems Code Review - meta-freescale.git/commitdiff
utilities.inc: Use only the basename for dtb files
authorFabio Berton <fabio.berton@ossystems.com.br>
Wed, 18 Jul 2018 17:25:32 +0000 (14:25 -0300)
committerFabio Berton <fabio.berton@ossystems.com.br>
Fri, 20 Jul 2018 17:06:57 +0000 (14:06 -0300)
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@ossystems.com.br>
conf/machine/include/imx-base.inc
conf/machine/include/utilities.inc [new file with mode: 0644]

index b130ef72c65bb38ebb0785c468259fecb21589b3..5270010569b07b150070fa4967087cd4b58f0ed8 100644 (file)
@@ -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 (file)
index 0000000..e6cfda8
--- /dev/null
@@ -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])