diff options
| -rw-r--r-- | classes/sdcard_image-rpi.bbclass | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass index f03595c..15c1aac 100644 --- a/classes/sdcard_image-rpi.bbclass +++ b/classes/sdcard_image-rpi.bbclass | |||
| @@ -79,6 +79,7 @@ SDIMG_LINK_VFAT = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.vfat" | |||
| 79 | 79 | ||
| 80 | def split_overlays(d, out, ver=None): | 80 | def split_overlays(d, out, ver=None): |
| 81 | dts = d.getVar("KERNEL_DEVICETREE") | 81 | dts = d.getVar("KERNEL_DEVICETREE") |
| 82 | # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' (4.1.x) or by '.dtbo' (4.4.9+) string and will be put in a dedicated folder | ||
| 82 | if out: | 83 | if out: |
| 83 | overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d) | 84 | overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d) |
| 84 | overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d) | 85 | overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d) |
| @@ -118,24 +119,17 @@ IMAGE_CMD_rpi-sdimg () { | |||
| 118 | mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS | 119 | mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS |
| 119 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/ | 120 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/ |
| 120 | if test -n "${DTS}"; then | 121 | if test -n "${DTS}"; then |
| 121 | # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' (4.1.x) or by '.dtbo' (4.4.9+) string and will be put in a dedicated folder | ||
| 122 | DT_OVERLAYS="${@split_overlays(d, 0)}" | ||
| 123 | DT_ROOT="${@split_overlays(d, 1)}" | ||
| 124 | |||
| 125 | # Copy board device trees to root folder | 122 | # Copy board device trees to root folder |
| 126 | for DTB in $DT_ROOT; do | 123 | for dtbf in ${@split_overlays(d, True)}; do |
| 127 | DTB_BASE_NAME=`basename ${DTB} .dtb` | 124 | dtb=`basename $dtbf` |
| 128 | 125 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/$dtb ::$dtb | |
| 129 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb | ||
| 130 | done | 126 | done |
| 131 | 127 | ||
| 132 | # Copy device tree overlays to dedicated folder | 128 | # Copy device tree overlays to dedicated folder |
| 133 | mmd -i ${WORKDIR}/boot.img overlays | 129 | mmd -i ${WORKDIR}/boot.img overlays |
| 134 | for DTB in $DT_OVERLAYS; do | 130 | for dtbf in ${@split_overlays(d, False)}; do |
| 135 | DTB_EXT=${DTB##*.} | 131 | dtb=`basename $dtbf` |
| 136 | DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"` | 132 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/$dtb ::overlays/$dtb |
| 137 | |||
| 138 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.${DTB_EXT} ::overlays/${DTB_BASE_NAME}.${DTB_EXT} | ||
| 139 | done | 133 | done |
| 140 | fi | 134 | fi |
| 141 | if [ "${RPI_USE_U_BOOT}" = "1" ]; then | 135 | if [ "${RPI_USE_U_BOOT}" = "1" ]; then |
