Skip to contentSkip to conversation

raspberrypi: post-image.sh fix gpu_mem option

PATCH New Gaël PORTAY 3 participants 4 messages Oct 21, 2017 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raspberrypi: post-image.sh fix gpu_mem option

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.

---
 board/raspberrypi/post-image.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
board/raspberrypi/post-image.sh +3 -1
index a2d6a98e79..3c6c938407 100755
@@ -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
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 raspberrypi: post-image.sh fix gpu_mem option

Ga?l, All,

On 2017-10-21 09:52 -0400, Ga?l PORTAY spake thusly:

Quoted 12 lines

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

Quoted 7 lines

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.

Regards,
Yann E. MORIN.

Quoted 32 lines
---
 board/raspberrypi/post-image.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
board/raspberrypi/post-image.sh +3 -1
index a2d6a98e79..3c6c938407 100755
@@ -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
Signature · 6 lines
2.11.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 raspberrypi: post-image.sh fix gpu_mem option

In reply to Gaël PORTAY

Hello,

Quoted 15 lines · Ga?l PORTAY

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.

Quoted 7 lines

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

---
 board/raspberrypi/post-image.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 raspberrypi: post-image.sh fix gpu_mem option

Hi Thomas,

Quoted 21 lines · Thomas Petazzoni

Hello,

Quoted 18 lines · Ga?l PORTAY

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.

Quoted 7 lines
Quoted 4 lines
---
 board/raspberrypi/post-image.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Applied to master, thanks.

Thanks,
Gael