diff options
| author | Otavio Salvador <otavio@ossystems.com.br> | 2017-10-04 17:36:04 -0300 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2017-10-05 15:32:48 -0300 |
| commit | ac419895663889d65cc3828b7d6ce150199526bb (patch) | |
| tree | ff28d576a06b744c0f01f0e144d65233e601e528 | |
| parent | b35452627c07ccfbb6a3d41454adbd5ffbdc3bb8 (diff) | |
| download | meta-freescale-ac419895663889d65cc3828b7d6ce150199526bb.tar.gz | |
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 <otavio@ossystems.com.br>
| -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 06f93fcbc..e1b7895db 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 000000000..bcb1c2a7b --- /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]) | ||
