diff options
-rw-r--r-- | conf/machine/include/imx-base.inc | 7 | ||||
-rw-r--r-- | conf/machine/include/utilities.inc | 28 |
2 files changed, 35 insertions, 0 deletions
diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index 06f93fcb..e1b7895d 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc | |||
@@ -3,6 +3,8 @@ | |||
3 | include conf/machine/include/fsl-default-settings.inc | 3 | include conf/machine/include/fsl-default-settings.inc |
4 | include conf/machine/include/fsl-default-versions.inc | 4 | include conf/machine/include/fsl-default-versions.inc |
5 | 5 | ||
6 | require conf/machine/include/utilities.inc | ||
7 | |||
6 | # Set specific make target and binary suffix | 8 | # Set specific make target and binary suffix |
7 | PREFERRED_PROVIDER_u-boot ??= "u-boot-fslc" | 9 | PREFERRED_PROVIDER_u-boot ??= "u-boot-fslc" |
8 | PREFERRED_PROVIDER_virtual/bootloader ??= "u-boot-fslc" | 10 | PREFERRED_PROVIDER_virtual/bootloader ??= "u-boot-fslc" |
@@ -226,6 +228,11 @@ SOC_DEFAULT_IMAGE_FSTYPES_mxs = "uboot-mxsboot-sdcard sdcard.gz" | |||
226 | SDCARD_ROOTFS ?= "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4" | 228 | SDCARD_ROOTFS ?= "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4" |
227 | IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}" | 229 | IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}" |
228 | 230 | ||
231 | IMAGE_BOOT_FILES ?= " \ | ||
232 | ${KERNEL_IMAGETYPE} \ | ||
233 | ${@make_dtb_boot_files(d)} \ | ||
234 | " | ||
235 | |||
229 | ### wic default support | 236 | ### wic default support |
230 | WKS_FILE_DEPENDS ?= " \ | 237 | WKS_FILE_DEPENDS ?= " \ |
231 | virtual/bootloader \ | 238 | virtual/bootloader \ |
diff --git a/conf/machine/include/utilities.inc b/conf/machine/include/utilities.inc new file mode 100644 index 00000000..bcb1c2a7 --- /dev/null +++ b/conf/machine/include/utilities.inc | |||
@@ -0,0 +1,28 @@ | |||
1 | ### Machine definition file utilities | ||
2 | |||
3 | def make_dtb_boot_files(d): | ||
4 | # Generate IMAGE_BOOT_FILES entries for device tree files listed in | ||
5 | # KERNEL_DEVICETREE. | ||
6 | alldtbs = d.getVar('KERNEL_DEVICETREE') | ||
7 | imgtyp = d.getVar('KERNEL_IMAGETYPE') | ||
8 | |||
9 | def transform(dtb): | ||
10 | if dtb.endswith('dtb'): | ||
11 | # eg: whatever/bcm2708-rpi-b.dtb has: | ||
12 | # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-bcm2708-rpi-b.dtb | ||
13 | # destination: bcm2708-rpi-b.dtb | ||
14 | base = os.path.basename(dtb) | ||
15 | src = '{}-{}'.format(imgtyp, base) | ||
16 | dst = base | ||
17 | return '{};{}'.format(src, dst) | ||
18 | elif dtb.endswith('dtbo'): | ||
19 | # overlay dtb: | ||
20 | # eg: overlays/hifiberry-amp.dtbo has: | ||
21 | # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-hifiberry-amp.dtbo | ||
22 | # destination: overlays/hifiberry-amp.dtbo | ||
23 | base = os.path.basename(dtb) | ||
24 | src = '{}-{}'.format(imgtyp, base) | ||
25 | dst = dtb | ||
26 | return '{};{}'.format(src, dtb) | ||
27 | |||
28 | return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb]) | ||