1 ######################################################################
3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 # * Samsung YP-R0 Rockbox as an application loader *
10 # Lorenzo Miori (C) 2011
11 ######################################################################
13 # This is expected to be sourced by the shell, which is then
14 # expected to run $MAINFILE
16 # Check for menu button being pressed. Return immediately to launch the OF
17 var
=$
(dd if=/dev
/r0Btn bs
=4 count
=1)
18 # Here a workaround to detect the byte
19 var2
=$
(echo -e -n "\x07")
21 if [[ "$var" = "$var2" ]]
27 # Blank-Unblank video to get rid of Samsung BootLogo, but turn off backlight before to hide these things :)
28 echo -n "0" > /sys
/devices
/platform
/afe
.0/bli
29 echo -n "1" > /sys
/class
/graphics
/fb
0/blank
30 echo -n "0" >> /sys
/class
/graphics
/fb
0/blank
32 amixer sset
'Soft Mute' 0
33 amixer sset
'Master' 85%
35 # We set-up various settings for the cpu governor: default are
36 # Every 1,5 s the kernel evaluates if it's the case to down/up clocking the cpu
37 echo "ondemand" > /sys
/devices
/system
/cpu
/cpu
0/cpufreq
/scaling_governor
38 echo "1" > /sys
/devices
/system
/cpu
/cpu
0/cpufreq
/ondemand
/ignore_nice_load
39 echo "150000" > /sys
/devices
/system
/cpu
/cpu
0/cpufreq
/ondemand
/sampling_rate
40 echo "95" > /sys
/devices
/system
/cpu
/cpu
0/cpufreq
/ondemand
/up_threshold
42 # bind these two to the root so that they're writable
43 mount
--bind /mnt
/media
0/.rockbox
/.rockbox
44 mount
--bind /mnt
/media
0/Playlists
/Playlists
46 # replace Samsung's si470x.ko with our si4709.ko to support fm radio
47 if [ -e /lib
/modules
/si4709.ko
]
49 rmmod
/lib
/modules
/si470x.ko
50 insmod
/lib
/modules
/si4709.ko
53 MAINFILE
="/mnt/media0/.rockbox/rockbox"
55 MAINFILE_REDIRECT
='>/dev/null 2>&1'