Skip to content

Commit

Permalink
lkconfig: add MMC CRC setting and superuser check
Browse files Browse the repository at this point in the history
  • Loading branch information
imoseyon committed Nov 15, 2014
1 parent ef6fc62 commit 41617b8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lk.ramdisk/sbin/lk-post-boot.sh
Expand Up @@ -43,6 +43,12 @@ SFILE="/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
CFILE="/data/data/leankernel/gpu_governor"
SFILE="/sys/devices/fdb00000.qcom,kgsl-3d0/devfreq/fdb00000.qcom,kgsl-3d0/governor"
[ -f $CFILE ] && echo `cat $CFILE` > $SFILE
#
# MMC CRC
#
CFILE="/data/data/leankernel/use_spi_crc"
SFILE="/sys/module/mmc_core/parameters/use_spi_crc"
[ -f $CFILE ] && echo `cat $CFILE` > $SFILE

# daemonsu support - probably not needed
if [ -f "/system/xbin/daemonsu" ]; then
Expand Down
16 changes: 15 additions & 1 deletion lk.ramdisk/sbin/lkconfig
@@ -1,5 +1,8 @@
#!/system/bin/sh

detectsu=`ls /data/data`
[ -z "$detectsu" ] && echo "Must be superuser!" && exit

while true; do

echo
Expand All @@ -11,7 +14,9 @@ echo "2) panel color"
echo "3) set screen_off_maxfreq"
echo "4) set cpu max frequency"
echo "5) gpu governor"
echo "6) restart mpdecision (to fix stuck cores)"
echo "6) MMC CRC"
echo
echo "9) restart mpdecision (to fix stuck cores)"
echo
echo -n "please enter a number (or press enter to exit): "

Expand All @@ -32,6 +37,8 @@ case $option in
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo -n "5) gpu governor: "
cat /sys/devices/fdb00000.qcom,kgsl-3d0/devfreq/fdb00000.qcom,kgsl-3d0/governor
echo -n "6) MMC CRC: "
cat /sys/module/mmc_core/parameters/use_spi_crc
echo
;;
1)
Expand Down Expand Up @@ -88,6 +95,13 @@ case $option in
echo "Done! (also will persist at boot)"
;;
6)
echo -n "Enter Y to enable, N to disable MMC CRC: "
read value
echo $value > /data/data/leankernel/use_spi_crc
echo $value > /sys/module/mmc_core/parameters/use_spi_crc
echo "Done! (also will persist at boot)"
;;
9)
stop mpdecision
sleep 2
start mpdecision
Expand Down

0 comments on commit 41617b8

Please sign in to comment.