Thomas Martitz | 249bba0 | 2011-12-24 11:56:46 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | ###################################################################### |
| 3 | # __________ __ ___. |
| 4 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 5 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 6 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 7 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 8 | # \/ \/ \/ \/ \/ |
| 9 | # |
| 10 | # * Samsung YP-R0 Rockbox as an application loader * |
| 11 | # Lorenzo Miori (C) 2011 |
| 12 | ###################################################################### |
| 13 | |
| 14 | # This is expected to be sourced by the shell, which is then |
| 15 | # expected to run $MAINFILE |
| 16 | |
| 17 | # Check for menu button being pressed. Return immediately to launch the OF |
| 18 | var=$(dd if=/dev/r0Btn bs=4 count=1) |
| 19 | # Here a workaround to detect the byte |
| 20 | var2=$(echo -e -n "\x07") |
| 21 | |
| 22 | if [[ "$var" = "$var2" ]] |
| 23 | then |
| 24 | return |
| 25 | fi |
| 26 | |
| 27 | |
| 28 | # Blank-Unblank video to get rid of Samsung BootLogo, but turn off backlight before to hide these things :) |
| 29 | echo -n "0" > /sys/devices/platform/afe.0/bli |
| 30 | echo -n "1" > /sys/class/graphics/fb0/blank |
| 31 | echo -n "0" >> /sys/class/graphics/fb0/blank |
| 32 | |
| 33 | amixer sset 'Soft Mute' 0 |
| 34 | amixer sset 'Master' 85% |
| 35 | |
| 36 | # We set-up various settings for the cpu governor: default are |
| 37 | # Every 1,5 s the kernel evaluates if it's the case to down/up clocking the cpu |
| 38 | echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
| 39 | echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load |
| 40 | echo "150000" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate |
| 41 | echo "95" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold |
| 42 | |
| 43 | # bind these two to the root so that they're writable |
| 44 | mount --bind /mnt/media0/.rockbox /.rockbox |
| 45 | mount --bind /mnt/media0/Playlists /Playlists |
| 46 | |
| 47 | MAINFILE="/mnt/media0/.rockbox/rockbox" |
Thomas Martitz | bf021e3 | 2011-12-24 23:13:27 +0000 | [diff] [blame] | 48 | MAINFILE_ARGV='' |
| 49 | MAINFILE_REDIRECT='>/dev/null 2>&1' |