From: Fabio Berton Date: Wed, 18 Jul 2018 17:25:32 +0000 (-0300) Subject: utilities.inc: Use only the basename for dtb files X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=fd89a85eaafb4f26a11d96db5702eadb83c02813;p=meta-freescale.git 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 --- 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])