]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
raspberrypi: post-image.sh fix gpu_mem option
authorGaël PORTAY <gael.portay@savoirfairelinux.com>
Sat, 21 Oct 2017 13:52:14 +0000 (09:52 -0400)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 21 Oct 2017 19:37:10 +0000 (21:37 +0200)
The gpu_mem option is not using the proper option argument which causes sed to
fail.

+ case "${arg}" in
+ gpu_mem=ome/gportay/output-rpi3-qtwe/images
+ sed -e '/^ome/gportay/output-rpi3-qtwe/images=/s,=.*,=ome/gportay/output-rpi3-qtwe/images,' -i /home/gportay/output-rpi3-qtwe/images/rpi-firmware/config.txt
sed: -e expression #1, char 8: extra characters after command
+ case "${arg}" in
+ gpu_mem=ome/gportay/output-rpi3-qtwe/images
+ sed -e '/^ome/gportay/output-rpi3-qtwe/images=/s,=.*,=ome/gportay/output-rpi3-qtwe/images,' -i /home/gportay/output-rpi3-qtwe/images/rpi-firmware/config.txt
sed: -e expression #1, char 8: extra characters after command

The issue comes from the use of $1 instead of $arg to extract the gpu_mem
value. $1 is the $(BINARIES_DIR) which leads to a sed expression error.

Also, it adds the error flag to the shell script to prevent from such situation
and terminate the build in error.

Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
board/raspberrypi/post-image.sh

index a2d6a98e79f7188502024f2ef07156c86f2348ba..3c6c938407c5a49d9842589042e005f8734d20ce 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+set -e
+
 BOARD_DIR="$(dirname $0)"
 BOARD_NAME="$(basename ${BOARD_DIR})"
 GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
@@ -40,7 +42,7 @@ __EOF__
                ;;
                --gpu_mem_256=*|--gpu_mem_512=*|--gpu_mem_1024=*)
                # Set GPU memory
-               gpu_mem="${1:2}"
+               gpu_mem="${arg:2}"
                sed -e "/^${gpu_mem%=*}=/s,=.*,=${gpu_mem##*=}," -i "${BINARIES_DIR}/rpi-firmware/config.txt"
                ;;
        esac