Discussion:
[meta-freescale] [PATCH] utilities.inc: Use only the basename for dtb files
Fabio Berton
2018-07-20 20:45:47 UTC
Permalink
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 <***@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

--
Gary Bisson
2018-07-23 07:31:54 UTC
Permalink
Hi Fabio,

On Fri, Jul 20, 2018 at 10:45 PM, Fabio Berton
Post by Fabio Berton
Use make_dtb_boot_files function to use basename from
whatever/my_dtb_file.dtb
Tested-by: Gary Bisson <***@boundarydevices.com>

Regards,
Gary
--
Fabio Berton
2018-07-23 12:11:58 UTC
Permalink
Merged to master.

Thanks,

Fabio

On Mon, Jul 23, 2018 at 4:31 AM, Gary Bisson
Post by Gary Bisson
Hi Fabio,
On Fri, Jul 20, 2018 at 10:45 PM, Fabio Berton
Post by Fabio Berton
Use make_dtb_boot_files function to use basename from
whatever/my_dtb_file.dtb
Regards,
Gary
--

Loading...