diff mbox

[1/1] board/beaglebone: skip bonegreen.dtb if not built

Message ID 1502450173-3058-1-git-send-email-lothar.felten@gmail.com
State Changes Requested
Headers show

Commit Message

Lothar Felten Aug. 11, 2017, 11:16 a.m. UTC
The beaglebone_qt5_defconfig does not provide a dtb for the beaglebone green.
This patch removes the am335x-bonegreen.dtb from the genimage config if it was
not built.

Signed-off-by: Lothar Felten <lothar.felten@gmail.com>
---
 board/beaglebone/post-image.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Arnout Vandecappelle Aug. 11, 2017, 1:33 p.m. UTC | #1
Hi Lothar,

On 11-08-17 13:16, Lothar Felten wrote:
> The beaglebone_qt5_defconfig does not provide a dtb for the beaglebone green.
> This patch removes the am335x-bonegreen.dtb from the genimage config if it was
> not built.

 Weird that Thomas didn't notice this when he created 028eb673c8f (which removes
the build of bonegreen from beaglebone_qt5_defconfig).


> +#the 4.1 kernel does not provide a dtb for beaglebone green
> +#remove it from the genimage config if am335x-bonegreen.dtb is not built:
> +if [[ ! -e ${BINARIES_DIR}/am335x-bonegreen.dtb ]]
> +then
> +	sed -i '/am335x-bonegreen.dtb/d' ${BOARD_DIR}/genimage.cfg

 This is not OK, you can't modify files in the Buildroot directory while
building. The only proper way to do this is to make it a template file and
generate the real genimage.cfg as part of the post-build script. But perhaps an
easier solution is to use a different genimage.cfg for beaglebone_qt5. When the
kernel finally gets bumped, that can be removed again.

 Regards,
 Arnout

> +	echo "removed am335x-bonegreen.dtb from genimage.cfg"
> +fi
> +
>  GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
>  GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
>  
>
diff mbox

Patch

diff --git a/board/beaglebone/post-image.sh b/board/beaglebone/post-image.sh
index f0c2bc7..ed99379 100755
--- a/board/beaglebone/post-image.sh
+++ b/board/beaglebone/post-image.sh
@@ -8,6 +8,14 @@  BOARD_DIR="$(dirname $0)"
 # copy the uEnv.txt to the output/images directory
 cp board/beaglebone/uEnv.txt $BINARIES_DIR/uEnv.txt
 
+#the 4.1 kernel does not provide a dtb for beaglebone green
+#remove it from the genimage config if am335x-bonegreen.dtb is not built:
+if [[ ! -e ${BINARIES_DIR}/am335x-bonegreen.dtb ]]
+then
+	sed -i '/am335x-bonegreen.dtb/d' ${BOARD_DIR}/genimage.cfg
+	echo "removed am335x-bonegreen.dtb from genimage.cfg"
+fi
+
 GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
 GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"