From ac419895663889d65cc3828b7d6ce150199526bb Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Wed, 4 Oct 2017 17:36:04 -0300 Subject: imx-base.inc: Generate a default IMAGE_BOOT_FILES When the machine requires a boot partition, it needs to define the IMAGE_BOOT_FILES to include the device tree files and Linux kernel image. This is essentially a generic solution so instead of defining it for all machines we are providing a default value for them. To implement that, we borrowed an utility function from Raspberry Pi BSP. It is copied as is at conf/machine/include/utilities.inc file. Signed-off-by: Otavio Salvador --- conf/machine/include/utilities.inc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 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 000000000..bcb1c2a7b --- /dev/null +++ b/conf/machine/include/utilities.inc @@ -0,0 +1,28 @@ +### Machine definition file utilities + +def make_dtb_boot_files(d): + # Generate IMAGE_BOOT_FILES entries for device tree files listed in + # KERNEL_DEVICETREE. + alldtbs = d.getVar('KERNEL_DEVICETREE') + imgtyp = d.getVar('KERNEL_IMAGETYPE') + + def transform(dtb): + if dtb.endswith('dtb'): + # eg: whatever/bcm2708-rpi-b.dtb has: + # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-bcm2708-rpi-b.dtb + # destination: bcm2708-rpi-b.dtb + base = os.path.basename(dtb) + src = '{}-{}'.format(imgtyp, base) + dst = base + return '{};{}'.format(src, dst) + elif dtb.endswith('dtbo'): + # overlay dtb: + # eg: overlays/hifiberry-amp.dtbo has: + # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-hifiberry-amp.dtbo + # destination: overlays/hifiberry-amp.dtbo + base = os.path.basename(dtb) + src = '{}-{}'.format(imgtyp, base) + dst = dtb + return '{};{}'.format(src, dtb) + + return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb]) -- cgit v1.2.3-54-g00ecf