diff options
author | Igor Opaniuk <igor.opaniuk@toradex.com> | 2020-05-26 11:01:52 +0300 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2020-06-09 18:33:42 +0200 |
commit | ff359672ac691e6a0fbb18b3d21e210813136d38 (patch) | |
tree | e78266d9b6ede9270d3dc5c71cf8a2e04f97c708 /classes/image_type_tezi.bbclass | |
parent | 3dc78640f88fa6c0e00b58a68b8a129162216054 (diff) |
image_type_tezi.bbclass: add dtoverlays support
Introduce TEZI_EXTERNAL_KERNEL_DEVICETREE and
TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT variables. First one provides the
list of overlays copied to boot partition (by default all overlays are
copied), the second one sets the list of overlays that should be loaded
during boot time (listed in ${bootfs}/overlays.txt).
TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT defaults to be empty.
Relates-to: ELB-2723
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
(cherry picked from commit c648af29199e2f8dedcaf6b7c3c61a2dcf6a579b)
Diffstat (limited to 'classes/image_type_tezi.bbclass')
-rw-r--r-- | classes/image_type_tezi.bbclass | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/classes/image_type_tezi.bbclass b/classes/image_type_tezi.bbclass index acdfda8..221c53a 100644 --- a/classes/image_type_tezi.bbclass +++ b/classes/image_type_tezi.bbclass @@ -11,7 +11,7 @@ do_image_teziimg[recrdeptask] += "do_deploy" do_image_teziimg_distro[recrdeptask] += "do_deploy" -WKS_FILE_DEPENDS_append = " tezi-metadata" +WKS_FILE_DEPENDS_append = " tezi-metadata virtual/dtb " DEPENDS += "${WKS_FILE_DEPENDS}" RM_WORK_EXCLUDE += "${PN}" @@ -24,6 +24,8 @@ TEZI_ROOT_LABEL ??= "RFS" TEZI_ROOT_SUFFIX ??= "tar.xz" TEZI_BOOT_SUFFIX ??= "bootfs.tar.xz" TEZI_CONFIG_FORMAT ??= "2" +TEZI_EXTERNAL_KERNEL_DEVICETREE ??= "" +TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT ??= "" TORADEX_FLASH_TYPE ??= "emmc" UBOOT_BINARY ??= "u-boot.${UBOOT_SUFFIX}" UBOOT_BINARY_TEZI_EMMC ?= "${UBOOT_BINARY}" @@ -344,7 +346,29 @@ tezi_deploy_bootfs_files[cleandirs] += "${WORKDIR}/bootfs" TAR_IMAGE_ROOTFS_task-image-bootfs = "${WORKDIR}/bootfs" IMAGE_CMD_bootfs () { - : + deploy_dt_dir=${DEPLOY_DIR_IMAGE}/devicetree/ + dtbos= + if [ -z "${TEZI_EXTERNAL_KERNEL_DEVICETREE}"] ; then + machine_dtbos=`cd $deploy_dt_dir && ls ${MACHINE}_*.dtbo` + common_dtbos=`cd $deploy_dt_dir && ls *.dtbo | grep -v -e 'imx[6-8]' -e 'tk1' | xargs` + dtbos="$machine_dtbos $common_dtbos" + else + dtbos=${TEZI_EXTERNAL_KERNEL_DEVICETREE} + fi + + # overlays to copy to bootfs/devicetree + mkdir -p ${WORKDIR}/bootfs/devicetree/ + for dtbo in $dtbos; do + cp $deploy_dt_dir/$dtbo ${WORKDIR}/bootfs/devicetree/ + done + + # overlays that we want to be applied during boot time + overlays= + for dtbo in ${TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT}; do + overlays="$overlays devicetree/$dtbo" + done + + echo "fdt_overlays=\"$(echo $overlays)\"" > ${WORKDIR}/bootfs/overlays.txt } do_image_bootfs[prefuncs] += "tezi_deploy_bootfs_files" |