# HG changeset patch # User Christophe Lincoln # Date 1397785538 -7200 # Node ID b5629d67388b04765a920b60a71d5cfc3db975f8 # Parent 7f8c51f837a5d228ac8a0579098c172efb83c102 tazberry: add suport for gpu_mem diff -r 7f8c51f837a5 -r b5629d67388b rpi/tazberry --- a/rpi/tazberry Fri Apr 18 02:46:52 2014 +0200 +++ b/rpi/tazberry Fri Apr 18 03:45:38 2014 +0200 @@ -26,6 +26,7 @@ $(boldify "$(gettext 'Commands:')") oclock $(gettext 'Display overclocking information') ls-functions $(gettext 'List TazBerry functions') + rpi_ $(gettext 'Execute any tazberry_function') testsuite $(gettext 'Run TazBerry testsuite') EOT @@ -145,6 +146,25 @@ --textbox "$out" ${height} ${width} } +gpu_mem_box() { + dialog \ + --clear \ + --title "$title" \ + --ok-label "Set mem" \ + --cancel-label "TazBerry" \ + --menu "\nSet the memory alocated to the GPU (in MB)" \ + ${height} ${width} 14 \ +"16" "For server, NAS, base system without X" \ +"32" "For very small TFT and TV display" \ +"64" "Default value, fine for low latency desktop" \ +"128" "For a faster desktop, using a video player" \ +"256" "For media center, GL/3D applications" 2>${tmp} + mem=$(cat $tmp) + sed -i \ + -e s"/#gpu_mem=.*/gpu_mem=$mem/" \ + -e s"/gpu_mem=.*/gpu_mem=$mem/" /boot/config.txt +} + # Main Dialog menu main_box() { dialog \ @@ -154,11 +174,12 @@ --cancel-label "Quit" \ --menu "" ${height} ${width} 14 \ "rpi-stats" "$(gettext 'Show some RPi system stats')" \ +"gpu-mem" "$(gettext 'Set memory split between ARM and GPU')" \ +"act-led" "$(gettext 'Test the RPi onboard ACT green led')" \ +"oclock" "$(gettext 'Overclocking information and config')" \ +"rpi-turbo" "$(gettext 'Enable or disable RPi turbo on next boot')" \ "boot-cmdline" "$(gettext 'View boot args /boot/cmdline.txt')" \ "boot-config" "$(gettext 'View config file /boot/config.txt')" \ -"oclock" "$(gettext 'Overclocking information and config')" \ -"rpi-turbo" "$(gettext 'Enable or disable RPi turbo on next boot')" \ -"act-led" "$(gettext 'Test RPi onboard ACT green led')" \ "packages" "$(gettext 'Spk packages manager')" \ "config" "$(gettext 'System config (lang, keyboard)')" \ "reboot" "$(gettext 'Reboot SliTaz')" \ @@ -166,8 +187,7 @@ "quit" "$(gettext 'Exit TazBerry tool')" 2>${tmp} # Handle options - opt=${?} - case "$opt" in + case "$?" in 1|255) rm -rf ${tmpdir} && exit 0 ;; esac @@ -176,19 +196,21 @@ case "$action" in rpi-stats) msg_box "RPi Stats" "$(rpi_stats)" ;; - boot-cmdline) - text_box /boot/cmdline.txt ;; - boot-config) - text_box ${config} ;; + gpu-mem) + gpu_mem_box ;; + act-led) + brightness="/sys/class/leds/led0/brightness" + (echo "1" > ${brightness} + sleep 3; echo "0" > ${brightness}) & ;; oclock) oclock_box ;; rpi-turbo) rpi_turbo && newline gettext "Press ENTER to go back to TazBerry"; read ;; - act-led) - brightness="/sys/class/leds/led0/brightness" - (echo "1" > ${brightness} - sleep 2; echo "0" > ${brightness}) & ;; + boot-cmdline) + text_box /boot/cmdline.txt ;; + boot-config) + text_box ${config} ;; packages) spk-dialog ;; config)