summaryrefslogtreecommitdiffstats
path: root/conf/machine/include/utilities.inc
diff options
context:
space:
mode:
authorFabio Berton <fabio.berton@ossystems.com.br>2018-07-18 14:25:32 -0300
committerFabio Berton <fabio.berton@ossystems.com.br>2018-07-20 14:06:57 -0300
commitfd89a85eaafb4f26a11d96db5702eadb83c02813 (patch)
tree24cc031dbe82649eb567422d35baf025da6556e5 /conf/machine/include/utilities.inc
parent54cfea29b1af7ab1302cd9dd5204a07a0b4a2ef3 (diff)
downloadmeta-freescale-fd89a85eaafb4f26a11d96db5702eadb83c02813.tar.gz
utilities.inc: Use only the basename for dtb files
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>
Diffstat (limited to 'conf/machine/include/utilities.inc')
-rw-r--r--conf/machine/include/utilities.inc16
1 files changed, 16 insertions, 0 deletions
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 @@
1### Machine definition file utilities
2
3def make_dtb_boot_files(d):
4 # Generate IMAGE_BOOT_FILES entries for device tree files listed in
5 # KERNEL_DEVICETREE.
6 # Use only the basename for dtb files:
7 alldtbs = d.getVar('KERNEL_DEVICETREE')
8
9 def transform(dtb):
10 if dtb.endswith('dtb') or dtb.endswith('dtbo'):
11 # eg: whatever/bcm2708-rpi-b.dtb has:
12 # DEPLOYDIR file: bcm2708-rpi-b.dtb
13 # destination: bcm2708-rpi-b.dtb
14 return os.path.basename(dtb)
15
16 return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])