when enabling camera, only set gpu mem if it is currently set below 128MiB

This commit is contained in:
Alex Bradbury 2013-12-16 21:09:43 +00:00
parent b194c2e2cd
commit 46aacb3003
1 changed files with 4 additions and 1 deletions

View File

@ -549,7 +549,10 @@ set_camera() {
sed /boot/config.txt -i -e "s/^fixup_file/#fixup_file/"
else # enable camera
set_config_var start_x 1 /boot/config.txt
set_config_var gpu_mem 128 /boot/config.txt
CUR_GPU_MEM=$(get_config_var gpu_mem /boot/config.txt)
if [ -z "$CUR_GPU_MEM" ] || [ "$CUR_GPU_MEM" -lt 128 ]; then
set_config_var gpu_mem 128 /boot/config.txt
fi
sed /boot/config.txt -i -e "s/^startx/#startx/"
sed /boot/config.txt -i -e "s/^fixup_file/#fixup_file/"
fi