diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2017-11-20 16:38:53 +0000 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.com> | 2018-07-07 11:28:48 +0100 |
commit | 4826d225807850f082d99ba42019023e54215b84 (patch) | |
tree | ecaf21a3c8d8db9a27bb2f52c2e1a57a8d154ee5 | |
parent | c4400ca81124243859706cc9a46aa44d443a6e6d (diff) | |
download | meta-raspberrypi-4826d225807850f082d99ba42019023e54215b84.tar.gz |
sdcard_image-rpi.bbclass: copy the DTB files with canonical name
* instead of using ${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb use
the entries from KERNEL_DEVICETREE
* basename is still needed because raspberrypi3-64 is using:
broadcom/bcm2710-rpi-3-b.dtb and the ${DEPLOY_DIR_IMAGE} doesn't
contain any directories for DTBs and we cannot remove broadcom/
prefix, because then "make bcm2710-rpi-3-b.dtb" from
kernel-devicetree.bbclass will fail with:
make[3]: *** No rule to make target 'arch/arm64/boot/dts/bcm2710-rpi-3-b.dtb'. Stop.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-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 |