raspberrypi: post-image.sh add new gpu_mem option
authorGaël PORTAY <gael.portay@savoirfairelinux.com>
Sat, 23 Sep 2017 23:30:06 +0000 (19:30 -0400)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Wed, 27 Sep 2017 20:08:03 +0000 (22:08 +0200)
The amount of GPU memory can be set using the new option --gpu_mem_XXX
(where XXX is the total amount of memory available on the board).

Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
board/raspberrypi/post-image.sh

index 3900a157271ecd461c4469c7e003577282c35007..a2d6a98e79f7188502024f2ef07156c86f2348ba 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 BOARD_DIR="$(dirname $0)"
 BOARD_NAME="$(basename ${BOARD_DIR})"
@@ -38,6 +38,11 @@ enable_uart=1
 __EOF__
                fi
                ;;
+               --gpu_mem_256=*|--gpu_mem_512=*|--gpu_mem_1024=*)
+               # Set GPU memory
+               gpu_mem="${1:2}"
+               sed -e "/^${gpu_mem%=*}=/s,=.*,=${gpu_mem##*=}," -i "${BINARIES_DIR}/rpi-firmware/config.txt"
+               ;;
        esac
 
 done