From fd89a85eaafb4f26a11d96db5702eadb83c02813 Mon Sep 17 00:00:00 2001 From: Fabio Berton Date: Wed, 18 Jul 2018 14:25:32 -0300 Subject: 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 --- conf/machine/include/utilities.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 conf/machine/include/utilities.inc (limited to 'conf/machine/include/utilities.inc') 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]) -- cgit v1.2.3-54-g00ecf