Please read the whole thing before deciding or asking any questions !!
This is a little script written by me to tweak the default cpu governer (hotplug) for MT6582 devices, currently tested only on A120, this script is actually programmed to set cpu power saving bias, number of cores online, and some more more attributes of our hotplug governer
Warning - flash on your own risk, i'm not responsible for any bad thing !!
Warning - this is only tested on A120 right now !!
Warning - only works on stock kitkat and cleankat for A120 !!
Warning - do give me credits if you include this in your rom !!
There are 7 different levels of power saving from 1 - 7 !!
Code:
Lvl BIAS CORES
1 150 4
2 250 4
3 150 3
4 250 3
5 100 2
6 250 2
You just have to flash any level and reboot !!
The higher level you flash, the more battery you save !!
Flash level 0 to get max perfomance with no battery saving !!
Well done brother. Now i can flash levels according to my need. There's a hell loads of difference in battery after flashing higher levels. Keep up the good work. You always come up with something remarkable.
Let us collaborate
Hi Mate,
I will message you on FB and will give you an update.
Update on script
Hi @umangleekha,
Again nice job :good:
But I have a suggestion (you can opt to take it or not). As you have mentioned the Level 0 is the stock value so you recommend us to install it whenever we want to revert. However there are a few of us who have already tweaked the values of what your script intends to change. And curious people like me would want to try your script as well. So to make things a little bit flexible and friendly, I did a little modification on your script and an uninstaller so that people can revert back to their previous settings.
I Pm'd you the scripts so you can decide if you want to update your set of installers. The uninstaller will can be applied to any of the Level installer they used.
Here's a little bit explanation of how it works, I am taking Level 6 for example:
Updated scipt
Code:
#!/system/bin/sh
#hotplug governer tweaks_umangleekha
#variables
up_threshold=/sys/devices/system/cpu/cpufreq/hotplug/up_threshold
cpu_up_threshold=/sys/devices/system/cpu/cpufreq/hotplug/cpu_up_threshold
sampling_rate=/sys/devices/system/cpu/cpufreq/hotplug/sampling_rate
cpu_down_differential=/sys/devices/system/cpu/cpufreq/hotplug/cpu_down_differential
down_differential=/sys/devices/system/cpu/cpufreq/hotplug/down_differential
powersave_bias=/sys/devices/system/cpu/cpufreq/hotplug/powersave_bias
sampling_rate_min=/sys/devices/system/cpu/cpufreq/hotplug/sampling_rate_min
cpu_num_limit=/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit
hotplugbak=/data/hotplug
hotpluglog=/data/hotplug.log
rm -f $hotpluglog
touch $hotpluglog
if [ -s $hotplugbak ] ; then
echo "hotplug original values were stored." | tee -a $hotpluglog;
else
touch $hotplugbak;
echo "#!/system/bin/sh" | tee -a $hotplugbak;
echo "# This contains the original values" | tee -a $hotpluglog;
echo "" | tee -a $hotplugbak;
echo "hotplug will run the first time..." | tee -a $hotpluglog;
#creating a backup first
echo "echo $( cat $up_threshold ) > $up_threshold" | tee -a $hotplugbak;
echo "echo $( cat $cpu_up_threshold ) > $cpu_up_threshold" | tee -a $hotplugbak;
echo "echo $( cat $sampling_rate ) > $sampling_rate" | tee -a $hotplugbak;
echo "echo $( cat $cpu_down_differential ) > $cpu_down_differential" | tee -a $hotplugbak;
echo "echo $( cat $down_differential ) > $down_differential" | tee -a $hotplugbak;
echo "echo $( cat $powersave_bias ) > $powersave_bias" | tee -a $hotplugbak;
echo "echo $( cat $sampling_rate_min ) > $sampling_rate_min" | tee -a $hotplugbak;
echo "echo $( cat $cpu_num_limit ) > $sampling_rate_min" | tee -a $hotplugbak;
fi;
# applying hotplug now
echo 95 > $up_threshold
echo 95 > $cpu_up_threshold
echo 40000 > $sampling_rate
echo 1 > $cpu_down_differential
echo 1 > $down_differential
echo 250 > $powersave_bias
echo 40000 > $sampling_rate_min
echo 2 > $cpu_num_limit
What it does is it will create a backup named "hotplug" inside /data directory. And this will not be changed and will be done once (check the IF statement). And if the backup is already there, the first IF will be bypassed and it will proceed to the changes you need. If the backup is not there, it will create the backup first. Basically that's going to be your installer.
For the Uninstaller
So the script is pretty straightforward, it will delete the existing hotplug from the init.d and then execute the shell script which was previously backed up from the installer.
Code:
#!/system/bin/sh
#
# This will revert all the changes made by the battery tweak from Umang Leekha
##################################################################################
# Let us start
#mounting /system
mount -o rw,remount /system
mount -o rw,remount /data
# Deleting the hotplug
rm -rf /system/etc/init.d/hotplug;
/system/bin/sh /data/hotplug;
# Updating the correct permission
chmod 777 /system/etc/init.d/*
I hope this helps and more power!
Thanks, i'll consider your ideas in V2
Here are the results, using my Lvl5 Super battery tweak, i'm a modeate user, brightness 22%, wifi on almost everytime when screen is on, crome and whatsapp, also one football app, played piano tiles for 15mins, it's just my first test with my tweaks, i'll release level 7 and will reach 6hrs screen time soon
umang bro, put them all inside another zip and upload it. It's annoying to download one tweak at a time. thanks !
Results after moderate usage. thanks brother, i got around 7 hours on screen. [emoji6]
Hey dev i flashed the level7 zip on my unite2 with ur cleankat v2.9 rom bt after flasbibg when i chekedout the battery stat i was shocked.it was 89% charged bt saying only 6 mins backup left why so bro tell me whats the problem.! Help
Sent from my Micromax A106 using xda app-developers app
I think you will need to recalibrate your battery dude. There are apps in Google Playstore which you can use.
Hey Umang,
So you have now Level 7 with powersave_bias=0, cpu_num_limit=2 and assigned scaling_max_freq=1040000 for all the cores, what's the effect of these changes?
scaling_max_freq path is incorrect Level7
Hey Bro,
I just checked your script for Level7, where did you checked this hotplug? I checked on my MT6582 KK version and it seems your last 4 lines' path does not exist. I checked it via ADB.
Can this work on Gionee M2?
Sent from my Gionee M2 using XDA Free mobile app
After installing on my Gionee M2, i was stuck at the Gionee Boot logo... Bootloop had to restore my backup
Sent from my Gionee M2 using XDA Free mobile app
very nice share
Related
I had an Idea for a script that would run at bootup, and if a certain variable had a "value" of NOT 1.
then the script would change the CHMOD of a userinit.sh located in the sd-ext from 050 or 777 to 750 then it would change the variable "value" to 0 were it would stay untill another script that runs at shut down or reboot setts the variable to 1 and changes CHMOD back to 050 or 777 so that the userinit.sh is not run.
That way if a change is made during operating the phone that causes the phone to crash with out shutting down properly the script runs which causes the userinit.sh to run and "resets" userinit.sh values to a "default". Otherwise if shut down properly nothing happens.
This could be expanded on to include repairing the EXT or clearing some special cache or other stuff I am unfamiliar with but that you might want to run after a crash.(like logcat?)
any way what do you think? any promise?
I think, for overclocking purposes anyway, making the userinit.sh unrunnable would make the phone break immediately, as I think it would go to the highest available frequency. However, I like the idea, though I'm not sure how to run scripts on shutdown. I think for overclocking, it would check if the shutdown was clean on startup, and if not change the applicable line to the next lowest number, which it would get either from a seperate file or maybe it could be stuffed in the script itself. (Just my somewhat uneducated thoughts)
TheNewGuy said:
I had an Idea for a script that would run at bootup, and if a certain variable had a "value" of NOT 1.
then the script would change the CHMOD of a userinit.sh located in the sd-ext from 050 or 777 to 750 then it would change the variable "value" to 0 were it would stay untill another script that runs at shut down or reboot setts the variable to 1 and changes CHMOD back to 050 or 777 so that the userinit.sh is not run.
That way if a change is made during operating the phone that causes the phone to crash with out shutting down properly the script runs which causes the userinit.sh to run and "resets" userinit.sh values to a "default". Otherwise if shut down properly nothing happens.
This could be expanded on to include repairing the EXT or clearing some special cache or other stuff I am unfamiliar with but that you might want to run after a crash.(like logcat?)
any way what do you think? any promise?
Click to expand...
Click to collapse
Keep it simple. If a change in userinit.sh breaks your system, reboot to recovery and edit it and reboot again.
TheNewGuy said:
I had an Idea for a script that would run at bootup, and if a certain variable had a "value" of NOT 1.
then the script would change the CHMOD of a userinit.sh located in the sd-ext from 050 or 777 to 750 then it would change the variable "value" to 0 were it would stay untill another script that runs at shut down or reboot setts the variable to 1 and changes CHMOD back to 050 or 777 so that the userinit.sh is not run.
That way if a change is made during operating the phone that causes the phone to crash with out shutting down properly the script runs which causes the userinit.sh to run and "resets" userinit.sh values to a "default". Otherwise if shut down properly nothing happens.
This could be expanded on to include repairing the EXT or clearing some special cache or other stuff I am unfamiliar with but that you might want to run after a crash.(like logcat?)
any way what do you think? any promise?
Click to expand...
Click to collapse
most rom devs/tweakers launch userinit.sh by calling it with a sh
e.g.
/system/bin/sh /system/sd/userinit.sh
so it will still run !! ( as init doesn't care about permissions, it is god )
don't believe me?
Code:
echo "echo I ran" > /data/test.sh
chmod 000 /data/test.sh
sh /data/test.sh
Keep it simple. If a change in userinit.sh breaks your system, reboot to recovery and edit it and reboot again.
Click to expand...
Click to collapse
Yea thats the easy way!...
(Seriously I'm not that good at Linux Command Line code,wording,but i'm getting there.)
I think, for overclocking purposes anyway, making the userinit.sh unrunnable would make the phone break immediately, as I think it would go to the highest available frequency. However, I like the idea, though I'm not sure how to run scripts on shutdown. I think for overclocking, it would check if the shutdown was clean on startup, and if not change the applicable line to the next lowest number, which it would get either from a seperate file or maybe it could be stuffed in the script itself. (Just my somewhat uneducated thoughts)
Reply With Quote
Click to expand...
Click to collapse
And I know that most roms now have a script called something like in /system/etc/init.d/20userinit that runs at startup and checks to see if a userinit.sh is present in sd-ext,if so it runs it.Also I noticed that the script can be there but if it is CHMOD to 777 it wont run. This is the "Reset script" Set to restet to something you like and run other tasks to help Fix/Diagnose probs.
The OC changes would be made from a different script such as 86supersettings
Or a userinit located in system/sd maybe ?
The thing is making sure one is read before the other.
Any way I probably will just learn the language better and do it from recovery console.
Thanks again
TheNewGuy said:
Yea thats the easy way!...
(Seriously I'm not that good at Linux Command Line code,wording,but i'm getting there.)
And I know that most roms now have a script called something like in /system/etc/init.d/20userinit that runs at startup and checks to see if a userinit.sh is present in sd-ext,if so it runs it.Also I noticed that the script can be there but if it is CHMOD to 777 it wont run. This is the "Reset script" Set to restet to something you like and run other tasks to help Fix/Diagnose probs.
The OC changes would be made from a different script such as 86supersettings
Or a userinit located in system/sd maybe ?
The thing is making sure one is read before the other.
Any way I probably will just learn the language better and do it from recovery console.
Thanks again
Click to expand...
Click to collapse
chmod 777 makes it rw and executable by everyone!!!!!!!!
have a look here
http://www.comptechdoc.org/os/linux/usersguide/linux_ugfilesp.html
but as I mentioned above, init ( the initial progam runs as root and doesn't care about permissions, ( it wouldn't be very good at doing initialising the system if it had to seek permission )
Yea your right. Well I said I wasn't that good at this linux stuff! Now I Proved it.
Any way as you can see this is more of a request..... I still think it's a good Idea.
Thanks for your help FireRat.
Keep it simple. If a change in userinit.sh breaks your system, reboot to recovery and edit it and reboot again.
Click to expand...
Click to collapse
I understand how I could manualy Replace the modified script with a default one that was on my sdcard from within recovery after a faild OC change...but..
Are you saying I could actualy modify the original script from recover? Do you have any info on how? A link?
TheNewGuy said:
I understand how I could manualy Replace the modified script with a default one that was on my sdcard from within recovery after a faild OC change...but..
Are you saying I could actualy modify the original script from recover? Do you have any info on how? A link?
Click to expand...
Click to collapse
If you have RA-Recovery, adb works, so you can pull/push the userinit.sh script. You can also enter the terminal and use vi to edit it from recovery. You may have to mount the ext partition first, but that's pretty easy. "mount /system/sd" will do it, if /system/sd doesn't exist, "mkdir /system/sd".
Ok, Thanks that makes sense. I'm still learning adb though. And I tried vi once before with no luck. But now I know what to learn about.
Thanks a lot I appreciate it.
TheNewGuy said:
Ok, Thanks that makes sense. I'm still learning adb though. And I tried vi once before with no luck. But now I know what to learn about.
Thanks a lot I appreciate it.
Click to expand...
Click to collapse
ok, this would do what you want
/system/bin/shutdown
bold is new
Code:
#!/system/bin/sh
stop;
stop dhcpcd;
sleep 1;
[B]echo "1" > /data/cleanshutdown[/B]
for i in `cat /proc/mounts | cut -f 2 -d " "`;
do
busybox mount -o remount,ro $i 2>&1 > /dev/null;
done
sync;
if [ "$1" = "-r" ];
then
toolbox reboot -f;
else
toolbox reboot -fp;
fi
your script
Code:
#!/system/bin/sh
if [ "`cat /data/cleanshutdown`" != "1" ];
then
echo "shutdown was not clean"
[B]your tweaks[/B]
else
echo "shutdown was clean"
[B]your tweaks[/B]
fi
echo "0" > /data/cleanshutdown
I'm not sure you need it,
this is for education value, if you want to play ^^^ is where to start
Thank You!
That is perfect
I need to add all of this to the startup script right?
if [ "`cat /data/cleanshutdown`" != "1" ];
then
echo "shutdown was not clean"
your tweaks
else
echo "shutdown was clean"
your tweaks
fi
echo "0" > /data/cleanshutdown
Click to expand...
Click to collapse
I am going to use the beta boot up script from ZKX called 86Supersettings, but I could use a userinit/user.conf like most do. Correct?
TheNewGuy said:
Thank You!
That is perfect
I need to add all of this to the startup script right?
I am going to use the beta boot up script from ZKX called 86Supersettings, but I could use a userinit/user.conf like most do. Correct?
Click to expand...
Click to collapse
well, a .conf file should be just that
a file with configurations , not an executable script
well, a .conf file should be just that
a file with configurations , not an executable script
Click to expand...
Click to collapse
OK. I guess I meant both together. I would use the user.conf to make tweaks. Then have to modify the userinit.sh with the part you made. Something like.
#!/system/bin/sh--LEAVE THIS OUT. ITS ALL READY AT THE BEGINNING
if [ "`cat /data/cleanshutdown`" != "1" ];
then
echo "shutdown was not clean"
Dont run user.conf
and set cpu or other stuff to "default"
else
echo "shutdown was clean"
Run user.conf for tweaked settings
fi
echo "0" > /data/cleanshutdown
Click to expand...
Click to collapse
If I'm way off then I guess I need to re-read the Userinit thread.
TheNewGuy said:
OK. I guess I meant both together. I would use the user.conf to make tweaks. Then have to modify the userinit.sh with the part you made. Something like.
If I'm way off then I guess I need to re-read the Userinit thread.
Click to expand...
Click to collapse
well, in practise it doesn't matter
the file extension is only for use humans, if I'm looking in a directory and I see .conf I expect it to be a configuration file, I see .sh, its a shell script, .py python, pl perl .......
I see. Well Thanks again for your help. Your script does work. I tried it. crash on purpose.
I still have a lot to learn.
Folks;
1) If you're OC'ing via SetCPU, remember that this doesn't change the recovery kernel, and you can uninstall SetCPU from Recovery. From there, all you need is a "safe" userinit.sh.
3) If you're OC'ing via userinit.sh -- same deal. Your phone crashes on you and you just edit it to a safe config from recovery.
Tweak away.
This is what I ended up with
Thanks to
XxKolohexX
FireRat
Licknuts
Code:
#!/system/bin/sh
#
echo 255 >/sys/class/leds/blue/brightness;
echo "+++ Now entering the speedy madness of Z.X.D.!"
echo "----- let's clear that Cache first."
echo "----- Too much DBs make System go sloow..."
echo "----- Also be shure to check out CacheMate"
echo "----- It's in the Market. (Made by Android AppCritic)."
echo "----- It's way more powerfull than this script!"
echo "----- (Times 10 or 100... Clears everything :P)"
echo "----- And this script already took hours to build..."
echo "----- domenukk - 2010."
find /data/data -name app_admob_cache | while read line; do du -s $line/* | cut -f1; rm -Rf $line/*; done;
find /data/data -name cache | while read line; do du -s $line/* | cut -f1; rm -Rf $line/*; done;
find /data/data -name google_analytics.db | while read line; do du -s $line | cut -f1; rm -Rf $line; done;
find /data/data -name webviewCache.db | while read line; do du -s $line | cut -f1; rm -Rf $line; done;
rm -rf /data/data/com.facebook.katana/files
rm -rf /data/data/com.google.android.apps.genie.geniewidget/app_news_image_cache
rm -rf /data/data/com.code.i.music/app_admob_cache
rm -rf /data/data/fm.last.android/databases/google_analytics.db
echo "--- All the Cache has been cleared."
sleep 10
echo 0 >/sys/class/leds/blue/brightness;
####determin if shutdown was clean####
if [ "`cat /data/cleanshutdown`" != "1" ];
then
####RUN CLEAN SHUTDOWN SCRIPT####
echo 255 >/sys/class/leds/green/brightness;
####Turbo Script by [email protected]####
####Prioritize everyting ####
echo "----- Enabling Turbo."
dirty_writeback_centisecs=500
/system/bin/prior &
#
# Linux-SWAP
#
if [ -e /dev/block/mmcblk0p3 ];
then
if [ -n /dev/block/mmcblk0p3 ];
then
echo "+++ Set Linux Swap"
busybox mkswap /dev/block/mmcblk0p3;
fi;
if [ -e /dev/block/mmcblk0p3 ];
then
echo "+++ Set Swapiness"
echo 100 > /proc/sys/vm/swappiness;
echo "+++ Activate Swap"
busybox swapon /dev/block/mmcblk0p3;
fi;
fi;
####Better CPU Settings...####
echo "----- Speed up the CPU"
echo 633600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo 122800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo 95 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load;
echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias;
echo 0 >/sys/class/leds/green/brightness;
echo 255 >/sys/class/leds/blue/brightness;
else
####RUN DIRTY SHUTDOWN SCRIPT####
echo 255 >/sys/class/leds/red/brightness;
####Turbo Script by [email protected]####
####Prioritize everyting ####
echo "----- Enabling Turbo."
dirty_writeback_centisecs=500
/system/bin/prior &
#
# Linux-SWAP
#
if [ -e /dev/block/mmcblk0p3 ];
then
if [ -n /dev/block/mmcblk0p3 ];
then
echo "+++ Set Linux Swap"
busybox mkswap /dev/block/mmcblk0p3;
fi;
if [ -e /dev/block/mmcblk0p3 ];
then
echo "+++ Set Swapiness"
echo 83 > /proc/sys/vm/swappiness;
echo "+++ Activate Swap"
busybox swapon /dev/block/mmcblk0p3;
fi;
fi;
####Better CPU Settings...####
echo "----- Speed up the CPU"
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo 122800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo 45 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load;
echo 2000000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
echo 200 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias;
fi;
echo "0" > /data/cleanshutdown
echo "+++ continue on lame stock SuperD boot "
##Clearing Davlik-Cache##
for dc in dalvik-cache;
do
umount /cache/$dc;
rm -fr /cache/$dc;
mkdir /cache/$dc;
chown 1000:1000 /cache/$dc;
chmod 771 /cache/$dc;
mount -o bind /data/$dc /cache/$dc;
done;
Named 86supersettings so it runs after userinit.sh if one exists.
I put some Led indicators in so you can tell if it ran right at boot up. (about all I did besides copy and paste) Thinking about adding some other stuff like repair ext, or some kind of log to help me see what happed... any suggestions.
OK, here's another Idea for another safety feature...
I would like to "hard code" a temp fail-safe in to the code. I would like to get rid of SetCPU and when OC-ing it's nice to have a temp failsafe.SHUTDOWN!LOL
Any way I guess I would just add a few lines to some existing script in my phone?.... Any suggestions.
Thanks for your time.
Ok so the reason why I made this topic is because Coertmans asked me about virtual ram in android (2.3.6), which is available in CM9, so I went surfing on the interwebs to find about this zRam, first thing I found was this:
Site: http://code.google.com/p/compcache/ (ramzswap_32a.ko/ramzswap_32b.ko)
Instructions: http://code.google.com/p/compcache/wiki/CompilingAndUsingNew
This is the link to the zRam modules for linux kernels, as I'm not sure if it's able to import it into GB I continued searching and found a GB ROM (CM7) which has zRam. I downloaded the rom and searched for the files that possible could be the zRam. All ram/swap related items I got are these:
in /system/etc/init.d/07script
Code:
ZRAM=`ls -d /sys/block/zram*`;
for z in $ZRAM
do
echo 256 > $z/queue/read_ahead_kb;
echo 0 > $z/queue/iostats
done
if [ -e /sys/kernel/mm/ksm/run ]; then
echo "Kernel Samepage Merging support ON for RAM managment speedup."
echo 1 > /sys/kernel/mm/ksm/run
fi
ZRAM=`ls -d /sys/block/zram*`;
for z in $ZRAM
do
echo 256 > $z/queue/read_ahead_kb;
echo 0 > $z/queue/iostats
done
in /sdcard/gscript/swapon.sh
Code:
echo "Enabling SWAP Now! Please Wait."
echo "OFFLINE"
free | grep Swap
swapon -a
echo "ONLINE"
free | grep Swap
sleep 2
echo "DONE, Have a Nice Day!"
in /sdcard/gscript/swapoff.sh
Code:
echo "Disabling SWAP Now! Please Wait."
echo "ONLINE"
free | grep Swap
swapoff -a
echo "OFFLINE"
free | grep Swap
sleep 2
echo "DONE, Dont forget to turn it back ON"
in /sdcard/gscript/system-to-ram-off.sh
Code:
#!/system/bin/sh
#System unmount from ram by Dorimanx!
umount -l /system/app/ 2> /dev/null
umount -l /system/framework 2> /dev/null
echo "DONE. system is removed from RAM, do your changes now."
In /sdcard/gscript/ram-clean.sh
Code:
#!/system/bin/bash
#Created by Dorimanx for cron ram managment
CPULOAD=$(cat /proc/loadavg | cut -d " " -f1)
sleep 1
while [[ ! $CPULOAD < 2.00 ]]
do
echo "Waiting For CPU to cool down"
sleep 30
CPULOAD=$(cat /proc/loadavg | cut -d " " -f1)
sleep 1
done
#Boosting CPU
CHECKMAXFREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
CHECKMINFREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq`
echo 998400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 998400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
sync
ZRAMUSE=`cat /proc/swaps | grep -v /dev/block/mmcblk0p3 | grep -v /sd-ext/swap | grep -v /sdcard/mnt/swap | grep -v /sdcard/swap | grep -v Used | cut -s -f3`
if [[ $ZRAMUSE < 10000 ]]
then
echo "no need to clean zram"
else
if [ -e /dev/block/mmcblk0p3 ]
then
sysctl -w vm.drop_caches=3
swapoff /dev/block/zram0
sleep 2
swapon /dev/block/zram0
sleep 2
swapoff /dev/block/mmcblk0p3
sleep 2
swapon /dev/block/mmcblk0p3
elif [ -e /sdcard/swap ]
then
sysctl -w vm.drop_caches=3
swapoff /dev/block/zram0
sleep 2
swapon /dev/block/zram0
sleep 2
swapoff /sdcard/swap
sleep 2
swapon /sdcard/swap
elif [ -e /sd-ext/swap ]
then
sysctl -w vm.drop_caches=3
swapoff /dev/block/zram0
sleep 2
swapon /dev/block/zram0
sleep 2
swapoff /sd-ext/swap
sleep 2
swapon /sd-ext/swap
fi
fi
#In case no secondary SWAP detected and ZRAM use lower than 80MB then we can safely clean it.
ZRAMUSE=`cat /proc/swaps | grep -v /dev/block/mmcblk0p3 | grep -v /sd-ext/swap | grep -v /sdcard/mnt/swap | grep -v /sdcard/swap | grep -v Used | cut -s -f3`
if [[ $ZRAMUSE < 80000 ]]
then
swapoff /dev/block/zram0
sleep 2
swapon /dev/block/zram0
fi
sync
sysctl -w vm.drop_caches=3
date > /data/cron-clear-swap
echo "runing clear swap every 4:20AM" >> /data/cron-clear-swap
echo "ram and swap cleared"
#Restoring CPU
echo $CHECKMAXFREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo $CHECKMINFREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
developer comment on the files in gscripts
dorimanx said:
About SWAP!
ROM will activate 3 kind of swap
It's will turn ON (only if you have already created swap file on partition, or set partition for swap (the hard way) )
SD-EXT SWAP
SD-SWAP
EXT dedicated SWAP partition
***If you have SWAP already, or EXT or SD-SWAP/EXT-SWAP, no need to run the swap activation scripts.
***I have created 2 scripts for disabling SD swap before use of USB storage.
I have put them in your /sdcard/gscript
so you only need the app (gscript light or full)
then load this scripts, when you need usb storage run swapoff script. when done run swapon.
or you can install dual mount app. i can’t live without it so try it.
Click to expand...
Click to collapse
and
dorimanx said:
SD SWAP THE EASY WAY!
In Easy way Swap you don't need to reformat or even reboot your phone to create swap!
If you installed my ROM and you don't have swap but you want to stay on HIGH END ROM,
Then you can do this to enable SD swap
Download script sdswap200.sh or dataswap250.sh from my mirror.
Run in in GSCRIPT App or copy it to SDCARD root,
Click to expand...
Click to collapse
sdswap200.sh
Code:
#!/system/bin/sh
# Created by Dorimanx
echo "WORKING PLEASE WAIT A MINUTE"
echo "Remounting System to allow WRITE"
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
if [ -e /sdcard/swap ]; then
swapoff -a
rm -f /sdcard/swap
fi
if [ -d /mnt/sdcard ]; then
echo "Creating SWAP on SDCARD"
busybox dd if=/dev/zero of=/sdcard/swap bs=1k count=250000 > /dev/null
mkswap /sdcard/swap > /dev/null
echo "/sdcard/swap swap swap" >> /system/etc/fstab
echo 50 > /proc/sys/vm/swappiness
swapon -a
echo "DONE CREATING, ENJOY MORE RAM"
free
sleep 3
else
echo "Your SDCARD NOT MOUNTED, SWAP CANT BE CREATED"
fi
dataswap250.sh
Code:
#!/system/bin/sh
# Created by Dorimanx
echo "WORKING PLEASE WAIT A MINUTE"
echo "Remounting System to allow WRITE"
mount -o remount,rw /system
if [ -e /sd-ext/swap ]; then
swapoff -a
rm -f /sd-ext/swap
fi
if [ -d /sd-ext ]; then
echo "Creating SWAP on SD-EXT"
busybox dd if=/dev/zero of=/sd-ext/swap bs=1k count=250000 > /dev/null
mkswap /sd-ext/swap > /dev/null
echo "/sd-ext/swap swap swap" >> /system/etc/fstab
echo 50 > /proc/sys/vm/swappiness
swapon -a
echo "DONE CREATING, ENJOY MORE RAM"
free
sleep 3
else
echo "You do not have EXT partition!, Cant create SWAP"
fi
in /sdcard/gscripts/swaphard.sh
Code:
echo "Activating EXT SWAP Please Wait"
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mkswap /dev/block/mmcblk0p3
echo "/dev/block/mmcblk0p3 swap swap" >> /system/etc/fstab
swapon -a
echo "DONE"
free
sleep 3
So what do you guys think about it? It seems to me that this is really possible on GB
This is what I tried so far:
Code:
adb shell
su
mount -o remount rw /system
busybox dd if=/dev/zero of=/sdcard/swap bs=1k count=250000 > /dev/null
busybox mkswap /sdcard/swap > /dev/null
echo "/sdcard/swap swap swap" >> /system/etc/vold.fstab
echo 50 > /proc/sys/vm/swappiness
swapon -a
Now I don't get an error, but also nothing seems to happen, I'm going to try to make the sdcard "swappable ready" the manual way now
edit: Hmm I can only pick my internal sdcard for partitioning the sdcard, someone knows how to do that for external?
And how can I see if the virtual ram is actually working?
btw here is the mirror with the files I used: http://www.bourseanalyse.fr/dorimanx/
btw, totally of topic, but I saw 2 cars on fire so I made a video
broodplank1337 said:
And how can I see if the virtual ram is actually working?
Click to expand...
Click to collapse
The easiest and the only way i know of to check how ram, swap, and memory is used is by going into Terminal Emulator and typing in "free" and click enter... (without the quotations)
shahbaz5588 said:
The easiest and the only way i know of to check how ram, swap, and memory is used is by going into Terminal Emulator and typing in "free" and click enter... (without the quotations)
Click to expand...
Click to collapse
Ok thanks, used: "free | grep Swap" seems it's not working yet.
Hello
do you know the app swapper2 ?
it do the same what you try to do here !
But in the german forum there are some people who bricked their device with this app so i just want to say that you really have to pay attention with swapping
PortoBraso said:
Hello
do you know the app swapper2 ?
it do the same what you try to do here !
But in the german forum there are some people who bricked their device with this app so i just want to say that you really have to pay attention with swapping
Click to expand...
Click to collapse
they bricked it because of partition of internal sdcard If all of us will partition internal sdcard we have more than 50% chances to brick our device. It seems that partioning internal SD affects the 1-8 boot partitions (dunno how to explain it better) I`ve just woke up lol
Also we need a kernel that supports swap
And we don't have such a kernel
Sent from my GT-I9001 using XDA
broodplank1337 said:
Ok thanks, used: "free | grep Swap" seems it's not working yet.
Click to expand...
Click to collapse
if u are getting all 0's in swap then it is not working... i thik you can try going thru htc dream (G1) gingerbread roms.... they used swap and zramk a lot... well it was essential for the rom to run on that device
If it looks like this (with zeros in the swap line), you do not have swap/compcache:
total used free shared buffers
Mem: 97932 96640 1292 0 272
Swap: 0 0 0
Total: 97932 96640 1292
If it looks like this (with anything other than zeros in the swap line), you do have swap/compache:
total used free shared buffers
Mem: 97932 96004 1928 0 332
Swap: 24472 0 24472
Total: 122404 96004 26400
I had a swap partition on my galaxy 3 and i just wanted to say that it isnt fun...it makes the phone laggy cause you can never have a sd-card which is as fast as a ram module
Sent from my GT-I9001 using XDA
Yes! SDcards even class 10, ain't that stable. Anyhow what's the big deal ?
we never fall short of ram on our device.
Had tried ram swapping on my I9003 and i managed to screw up everything,made it a paper weight (Hard bricked it).
Had to get the board replaced from samsung, on the good side i got the latest latona board with 16gb onboard memory
but i no longer have the i9003
I tried swap while I had Galaxy 3 (it only has 256MB RAM) and I didn't like it. Also many other people reported that it was only slowing down system (even with class 10 cards) SD Cards just aren't fast enough to be used as a RAM...plus, Android is based on a though that free RAM is wasted RAM, right? 512MB for our phone is enough for me, and I've never fallen short of RAM..swap is not needed..but that's just my opinion
I'm not going to continue on this anyway, making your sdcard a swap drives really ****s it up, when I tried to install an app my phone shut down..
Hi to all!
Check for new kernel for Micromax A110 device.
Not a long description here.
Major features:
1. abyssplug, dancedance, smartassv2, intellidemand, hyper, ondemandx, lulzactiveq, minmax, pegasuq, wheatley, sakuractive, hotplug, nightmare, dyninteractive, intercative, conservative, hybrid, ondemand, userspace, powersave, lionheart, zzmove, performance CPU governors added.
2. noop, deadline, cfq, sio, bfq, fifo, fiops, row, vr, zen I/O scheduler added.
3. Changed LMK values for internal task manager means more free memory.
4. Changed to smartass2 and sio as default CPU governor and I/O scheduler (4.2.x).
5. Changed to zzmove and sio as default CPU governor and I/O scheduler (4.1.x).
6. NTFS OTG support added.
7. init.d support added.
8. Battery saver and performance MODs added.
9. Compressed with lmza means less size means more performance and less time to boot and more battery juice.
10. Compiled with linaro's latest toolchain.
11. lzo compression enabled.
12. Network/WiFi speed and connectivity improved.
13. Readahead set to 1024 KB.
14. All cores working on loaded with heavy process (hotplugging).
15. vfs reduced to 10 means more battery saving.
16. Camera capture quality improved.
17. Improved Multitasking.
18. Dynamic cache included (Thanks to @faux123).
Credits:
@tri_zet for all help and support.
Bruno Martins for repacker scripts.
@faux123 for dynamic cache.
aquila-dev and Acer for sources here and @khan_frd2002 for making aware of it..
To all my testers.
For More on CPU Governors and I/O schedulers and their performance, visit following thread:
http://forum.xda-developers.com/showthread.php?t=1507204
ROMs (Released) that are using my kernels:
Dark™ NeXuS 4.2.2 http://forum.xda-developers.com/showthread.php?t=2439632
LegoIce™ Project ROM 4.2.2 [LegoIce™ Galaxy S4] http://forum.xda-developers.com/showthread.php?t=2458879
LegoIce™Canvas 4 4.2.1 http://forum.xda-developers.com/showthread.php?t=2463118
Micromax Mega™ ROM 4.2.2 [Aroma] http://forum.xda-developers.com/showthread.php?t=2463987
Rayne™ Rom http://forum.xda-developers.com/showthread.php?t=2463118
BLACK PEARL ROM 4.1.1 http://forum.xda-developers.com/showthread.php?t=2447212
If anyone else want to include in one's ROM, kindly PM me. If anyone found using my kernel in one's ROM will be treated as per xda rules.
Disclaimer:
I or xda is not responsible for any kind of mess you do with your device after flashing this kernel and don't complain any, if done.
My Kernel sources:
https://github.com/ajaybhatia/canvas2-4.2.2
Mod Edit: Downloads removed as this is under investigation. Thanks for your patience.
How to change CPU governors and I/O schedulers
Guys. I created a cputuner script for all devices and not just for MMX. The code is given below. Just copy it in the file and name it cputuner. Run the script using SM. The settings will stick in every reboot.
Code:
#!/system/bin/sh
# CPU Tuner
# by andiroxu [user=934623]@xda 2[/user]013
# Copyright (C) andiroxu
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program.
# If not, see
busybox clear
busybox mount -o rw,remount rootfs /
busybox mount -o rw,remount /system
if [ ! -d "/sqlite_stmt_journals" ]; then
mkdir /sqlite_stmt_journals
chown 0.0 /sqlite_stmt_journals
chmod 777 /sqlite_stmt_journals
fi
busybox rm -f /system/etc/init.d/01cputuner
busybox touch /system/etc/init.d/01cputuner
busybox chmod -f 777 /system/etc/init.d/01cputuner
busybox chown -f 0.0 /system/etc/init.d/01cputuner
busybox echo ""
busybox echo "============================"
busybox echo "= Please select a governor ="
busybox echo "============================"
busybox echo ""
busybox sleep 1
SERIAL_NO=1
AVAIL_GOVS=(`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors`)
for GOVS in ${AVAIL_GOVS[@]}; do
busybox echo "$SERIAL_NO) $GOVS"
SERIAL_NO=$(($SERIAL_NO+1))
done
SERIAL_NO=$(($SERIAL_NO-1))
busybox echo ""
busybox echo -n "Select which governor you would like to use: [ 1 - $SERIAL_NO ]: "
read CHOICE
INDEX=$(($CHOICE-1))
SELECTED_GOV=${AVAIL_GOVS[${INDEX}]}
busybox echo ""
busybox echo "You selected '$SELECTED_GOV' governor..."
busybox sleep 1
for c in `ls -d /sys/devices/system/cpu/cpu?`; do
if [ -e ${c}/cpufreq/scaling_governor ]; then
busybox chmod -f 644 ${c}/cpufreq/*
busybox echo "${SELECTED_GOV}" >> ${c}/cpufreq/scaling_governor 2>/dev/null
fi 2>/dev/null
done 2>/dev/null
# Making all cores active
for c in `ls -d /sys/devices/system/cpu/cpu?`; do
if [ -e ${c}/online ]; then
busybox chmod -f 644 ${c}/online 2>/dev/null
fi 2>/dev/null
if [ -e ${c}/online ]; then
busybox echo "1" >> ${c}/online 2>/dev/null
fi 2>/dev/null
done 2>/dev/null
busybox echo ""
busybox echo "============================="
busybox echo "= Please select a scheduler ="
busybox echo "============================="
busybox echo ""
busybox sleep 1
SERIAL_NO=1
COUNT=`cat /sys/block/mmcblk0/queue/scheduler | wc -w`
busybox chmod -f 644 /sys/block/mmcblk0/queue/*
while [ $SERIAL_NO -le $COUNT ]; do
busybox echo "$SERIAL_NO) `cat /sys/block/mmcblk0/queue/scheduler | awk '{print $'$SERIAL_NO'}' | cut -d '[' -f 2 | cut -d ']' -f 1 `"
SERIAL_NO=$(($SERIAL_NO+1))
done
busybox echo ""
SERIAL_NO=$(($SERIAL_NO-1))
busybox echo -n "Select which scheduler you would like to use: [ 1 - $SERIAL_NO ]: "
read CHOICE
INDEX=$(($CHOICE))
SELECTED_SCHEDULER=`cat /sys/block/mmcblk0/queue/scheduler | awk '{print $'$INDEX'}' | cut -d '[' -f 2 | cut -d ']' -f 1 `
busybox echo ""
busybox echo "You selected '$SELECTED_SCHEDULER' scheduler..."
busybox sleep 1
m=/sys/block/dm-*
emmc=/sys/block/mmc*
loop=/sys/block/loop*
ram=/sys/block/ram*
zram=/sys/block/zram*
stl=/sys/block/stl*
bml=/sys/block/bml*
mtd=/sys/block/mtd*
for a in $dm $stl $bml $mtd $emmc $loop $ram $zram; do
if [ -e ${a}/queue ]; then
busybox chmod -f 644 ${a}/queue/*
busybox echo "${SELECTED_SCHEDULER}" >> ${a}/queue/scheduler
fi
done
busybox echo ""
busybox echo "============================="
busybox echo "= Please select a max freq ="
busybox echo "============================="
busybox echo ""
busybox sleep 1
SERIAL_NO=1
TRANS_RANGE=(`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | awk '{print $1}'`)
for AVAIL_FREQ in ${TRANS_RANGE[@]}; do
busybox echo "$SERIAL_NO) $AVAIL_FREQ KHz"
SERIAL_NO=$(($SERIAL_NO+1))
done
SERIAL_NO=$(($SERIAL_NO-1))
busybox echo ""
busybox echo -n "Select which max freq you would like to use: [ 1 - $SERIAL_NO ]: "
read CHOICE
INDEX=$(($CHOICE-1))
SELECTED_MAX_FREQ=${TRANS_RANGE[${INDEX}]}
busybox echo ""
busybox echo "You selected '$SELECTED_MAX_FREQ' max freq..."
busybox sleep 1
# Setting max frequency on active cores
for c in `ls -d /sys/devices/system/cpu/cpu?`; do
if [ -e ${c}/cpufreq ]; then
busybox chmod -f 644 ${c}/cpufreq/scaling_max_freq
fi
if [ -e ${c}/cpufreq ]; then
busybox echo "${SELECTED_MAX_FREQ}" >> ${c}/cpufreq/scaling_max_freq
fi
done
busybox echo ""
busybox echo "============================="
busybox echo "= Please select a min freq ="
busybox echo "============================="
busybox echo ""
busybox sleep 1
SERIAL_NO=1
TRANS_RANGE=(`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | awk '{print $1}'`)
for AVAIL_FREQ in ${TRANS_RANGE[@]}; do
busybox echo "$SERIAL_NO) $AVAIL_FREQ KHz"
SERIAL_NO=$(($SERIAL_NO+1))
done
SERIAL_NO=$(($SERIAL_NO-1))
busybox echo ""
busybox echo -n "Select which min freq you would like to use: [ 1 - $SERIAL_NO ]: "
read CHOICE
INDEX=$(($CHOICE-1))
SELECTED_MIN_FREQ=${TRANS_RANGE[${INDEX}]}
busybox echo ""
busybox echo "You selected '$SELECTED_MIN_FREQ' min freq..."
busybox sleep 1
# Setting min frequency on active cores
for c in `ls -d /sys/devices/system/cpu/cpu?`; do
if [ -e ${c}/cpufreq ]; then
busybox chmod -f 644 ${c}/cpufreq/scaling_min_freq
fi
if [ -e ${c}/cpufreq ]; then
busybox echo "${SELECTED_MIN_FREQ}" >> ${c}/cpufreq/scaling_min_freq
fi
done
busybox sleep 1
busybox echo ""
busybox echo "CPU Tuning has been done!!!"
busybox echo "These values will be stick on boot."
busybox echo ""
busybox echo "THANK YOU!!!"
busybox echo ""
busybox sleep 1
cat >> /system/etc/init.d/01cputuner \${c}/cpufreq/scaling_governor
fi
done
# Making all cores online
for c in \`ls -d /sys/devices/system/cpu/cpu?\`; do
if [ -e \${c}/online ]; then
busybox chmod -f 644 \${c}/online 2>/dev/null
fi 2>/dev/null
if [ -e \${c}/online ]; then
busybox echo "1" >> \${c}/online 2>/dev/null
fi 2>/dev/null
done 2>/dev/null
# Changing to the selected I/O Scheduler
m=/sys/block/dm-*
emmc=/sys/block/mmc*
loop=/sys/block/loop*
ram=/sys/block/ram*
zram=/sys/block/zram*
stl=/sys/block/stl*
bml=/sys/block/bml*
mtd=/sys/block/mtd*
for a in \$dm \$stl \$bml \$mtd \$emmc \$loop \$ram \$zram; do
if [ -e \${a}/queue ]; then
busybox chmod -f 644 \${a}/queue/*
busybox echo "${SELECTED_SCHEDULER}" >> \${a}/queue/scheduler
fi
done
# Changing max frequecy on all cores
for c in \`ls -d /sys/devices/system/cpu/cpu?\`; do
if [ -e \${c}/cpufreq ]; then
busybox chmod -f 644 \${c}/cpufreq/scaling_max_freq
fi
if [ -e \${c}/cpufreq ]; then
busybox echo "${SELECTED_MAX_FREQ}" >> \${c}/cpufreq/scaling_max_freq
fi
done
# Changing min frequecy on all cores
for c in \`ls -d /sys/devices/system/cpu/cpu?\`; do
if [ -e \${c}/cpufreq ]; then
busybox chmod -f 644 \${c}/cpufreq/scaling_min_freq
fi
if [ -e \${c}/cpufreq ]; then
busybox echo "${SELECTED_MIN_FREQ}" >> \${c}/cpufreq/scaling_min_freq
fi
done
EOF
rm -r /sqlite_stmt_journals 2>/dev/null
busybox chown 0.0 /system/etc/init.d/01cputuner
busybox chmod 777 /system/etc/init.d/01cputuner
exit 0
Note: This is 100% genuine work and don't try to reproduce it any way or no one is allowed to use it their ROM with prior permission.
After all I'm a coder and real developer and love coding and this is known to many of you
Now feeling good with mmx a110 coz of talented devs engaged with it :good::good::good:
Reserved 1
Reserved 1
proseray said:
Now feeling good with mmx a110 coz of talented devs engaged with it :good::good::good:
Click to expand...
Click to collapse
Ah you are so quick. I was just making the thread ready and was reserving some post for future use. But never mind I will manage somehow.
Thanks
andiroxu said:
Ah you are so quick. I was just making the thread ready and was reserving some post for future use. But never mind I will manage somehow.
Thanks
Click to expand...
Click to collapse
My Bad Extremely Sry for that
andiroxu said:
Hi to all!
Check for new kernel for Micromax A110 device. No Bugs at all.
Not a long description here.
Major features:
1. Swap support added.
2. init.d support added.
3. interactive and conservative CPU governors added.
4. ondemand and noop as default CPU governor and I/O scheduler.
5. Battery saver and performer.
P.S. No OC added due to fast draining of battery but you will enjoy equal performance as if it would OC.
Working on other governors and schedulers like zzmoove, smartassv2, interactiveX, ondemandX, lulzactive, hotplug, sio, zen, bfq etc.
Credits:
@tri_zet for all help and support.
Bruno Martin for repacker scripts.
Wiko King for sources.
Download as an attachment
Click to expand...
Click to collapse
Kindly add Over clocking feature bro so that we can enable or disable when we need.
Thx in advance.
Sent from my A110 using xda app-developers app
showstopper1 said:
Kindly add Over clocking feature bro so that we can enable or disable when we need.
Thx in advance.
Sent from my A110 using xda app-developers app
Click to expand...
Click to collapse
Alright. Soon. But it will eat your battery.
andiroxu said:
Alright. Soon. But it will eat your battery.
Click to expand...
Click to collapse
and please provide oc till 1.4ghz....and i don't mind if it eats battery....its just the feature every one will use accordingly what they
Sent from my MICROMAX A110 using xda app-developers app
andiroxu said:
Alright. Soon. But it will eat your battery.
Click to expand...
Click to collapse
bro @andiroxu
please try to add overclocking! many of us use that a lot! it really is a ver useful feature after all!
and with battery.. we'll manage..
thanks a lot again for this kernel!
Good work!
Have you added cifs?
Also add native NTFS support for USB OTG for connecting HDD
Hit Thanks If U Like.....
Sent from MMX A110 By XDA App
LFC-YNWA said:
Have you added cifs?
Click to expand...
Click to collapse
No cifs yet.
venu007 said:
Also add native NTFS support for USB OTG for connecting HDD
Hit Thanks If U Like.....
Sent from MMX A110 By XDA App
Click to expand...
Click to collapse
Will try.
Sent from my GT-I9500 using xda app-developers app
Can you give all features that varun chitre gives in her thunderzap kernal
Sent from my Micromax A110 using Tapatalk 4
akashvfx said:
Can you give all features that varun chitre gives in her thunderzap kernal
Sent from my Micromax A110 using Tapatalk 4
Click to expand...
Click to collapse
Why you are comparing each others works? BTW I'm on adding new features and will release new updated kernel soon with OC, NTFS support for OTG, etc.
andiroxu said:
Why you are comparing each others works? BTW I'm on adding new features and will release new updated kernel soon with OC, NTFS support for OTG, etc.
Click to expand...
Click to collapse
Dont forget to add Cifs
Kernel Source?
nolinuxnoparty said:
Kernel Source?
Click to expand...
Click to collapse
Check OP.
Sent from my GT-I9500 using xda app-developers app
LFC-YNWA said:
Dont forget to add Cifs
Click to expand...
Click to collapse
I'm ready with cifs enabled kernel. More features NTFS support for OTG, now interactive as default CPU governor.
More coming soon: other CPU govs and I/O schedulers, OCing.
Sent from my GT-I9500 using xda app-developers app
Edit : deleted
Sent from my A110 using xda app-developers app
---------- Post added at 06:41 PM ---------- Previous post was at 06:32 PM ----------
andiroxu said:
I'm ready with cifs enabled kernel. More features NTFS support for OTG, now interactive as default CPU governor.
More coming soon: other CPU govs and I/O schedulers, OCing.
Sent from my GT-I9500 using xda app-developers app
Click to expand...
Click to collapse
Bro can you upload your sources to guthub and is it possible to build cyanogenmod from your kernel build.
You ve done something very great dont think im asking again n again juz upload your siurces to github which is your modified sourcr used to build this kernel it will be very useful for most of the mt6577 who are missing something in the sources...
Sent from my A110 using xda app-developers app
Hello everyone, i just wanted help with my Bash script!
I usually flash nightlies and when ever i flash them, i lose my tweaks
So i decided creating a bash script for myself,
Here's how it is....
Code:
#!/system/bin/sh
## personal file
tweaks=/sdcard/tweaks
build=/system/build.prop
## loop trough $tweak
sed -r '/(#.*|^ *$)/d;/.*=.*/!d;$a' $tweak | while read line
do
## get entry from $tweak
entry=$(echo $line | sed "s/=.*//")
## if variable already present in $build
if cat $build | grep -q $entry
then
## override value in $build if different
if ! cat $build | grep -q $(cat $tweak | grep $entry)
then
sed -i "s/^${entry}=.*$/${line}/g" $build
fi
else
echo $line >> $build
fi
done
Everything works but i wanted to keep this process running (For testing purposes),
I mean after my tweaks/values get replaced, i want the same thing to happen with other values!
Eg:- /sdcard/tweak= Contains line= ro.build.model=Nexus 5,
Same file contains ro.build.model=Xperia Z,
now what i want my script to do is, First replace my phone model with Nexus 5 and after some time change it with Xperia Z without starting/stopping any other script!
But i aint too good at this!
So i require a helping hand!
I hope you get my point.
DeveDroid said:
Hello everyone, i just wanted help with my Bash script!
I usually flash nightlies and when ever i flash them, i lose my tweaks
So i decided creating a bash script for myself,
Here's how it is....
Code:
#!/system/bin/sh
## personal file
tweaks=/sdcard/tweaks
build=/system/build.prop
## loop trough $tweak
sed -r '/(#.*|^ *$)/d;/.*=.*/!d;$a' $tweak | while read line
do
## get entry from $tweak
entry=$(echo $line | sed "s/=.*//")
## if variable already present in $build
if cat $build | grep -q $entry
then
## override value in $build if different
if ! cat $build | grep -q $(cat $tweak | grep $entry)
then
sed -i "s/^${entry}=.*$/${line}/g" $build
fi
else
echo $line >> $build
fi
done
Everything works but i wanted to keep this process running (For testing purposes),
I mean after my tweaks/values get replaced, i want the same thing to happen with other values!
Eg:- /sdcard/tweak= Contains line= ro.build.model=Nexus 5,
Same file contains ro.build.model=Xperia Z,
now what i want my script to do is, First replace my phone model with Nexus 5 and after some time change it with Xperia Z without starting/stopping any other script!
But i aint too good at this!
So i require a helping hand!
I hope you get my point.
Click to expand...
Click to collapse
i caught a typo:
tweaks -> tweak
and,
First replace my phone model with Nexus 5 and after some time change it with Xperia Z without starting/stopping any other script!
why dont you try something called 'sleep' command? its very very convenient
for example:
Code:
sleep 60 #will make the script suspend for a minute
Tweakprop can handle build.proo tweaks. It grap the new build.prob against the tweaks file you created and add this to the new one. This is flasable under cwm/twrp and works quite good.
INTRODUCTION
I am using MTK6582 device Agua Rio (close relative of Wiko Rainbow, Explay Fresh, Blu) for 4 months now and to be honest I really enjoyed using this Android phone and so I began searching for effective init.d tweaks that will be compatible for my phone. No offense to the other developers who worked hard on building a set of tweak scripts but most of them are not compatible with my phone. It is simply because the declarations of the path is not present in my device or sometimes they are just supported by MTK6582. So I started recreating my own scripts and have been using it for weeks and works as expected.
This is still in Alpha version so I am not expecting a 360-degree change in performance but if there's one thing I can guarantee you, they are working for the devices I've mentioned above and to prove that there are log files from where you can verify if the scripts were properly executed or not.
DISCLAIMER
I will not be held liable or responsible if you brick your device after flashing this tweak. ALWAYS HAVE YOUR BACKUP READY!
FLASH AT YOUR OWN RISK!!!
FEATURES
- Battery Tweaks (a lot of things going on here like battery re-calibration which will be done every 7 days, centisecs flushing interval, WiFi Sleep from Gaurav, Entropy tweak for battery, pm.sleep_mode)
- updated Loopysmoothness for MTK (I modified the declaration of variables so that the script can be a little more flexible - Credits to [email protected])
- VM Tweaks (experimental - modified scripts to work for MTK6582 credits to [email protected] and [email protected] of Fly-on)
- GPU Rendering (Enable GPU rendering for 2D operations)
- DHCPd script to clean the DHCP leases before starting
- SDboost - (modded script to work with MTK - credits to [email protected] of Fly-on and V6 Supercharger - SD Card read-ahead cache to 2048 KB)
- IOTweaks for responsiveness
- Network tweaks - (my own mix with a touch of [email protected] network tweaks)
- Zipalign - (modded script that will zipalign any new apps in /system/app, /system/framework, /data/app every reboot)
11-DEC-2014 ALPHA 3B UPDATES
- Remount - to make your device more responsive
- zRAM - utlizing ZRAM to increase performance - http://forum.xda-developers.com/showthread.php?t=2320734
- LagBuster - Credits to [email protected] for giving me an idea to incorporate RNGD Entropy
- Props - Adding more useful prop parameters
- Looping scripts (stored in /data/Tweaks/scripts)
-- Lagfix - will run every 60min and will execute fstrim Due to bad effects in the long run I have removed this (ref: http://man7.org/linux/man-pages/man8/fstrim.8.html)
-- Defrag - will run every 12hours to execute VACUUM and REINDEX to optimize the database - credits to [email protected] of Fly-on
-- CPU Hotplug - another battery tweak which I have modified which will run specific set of hotplug depending on the needs of your device and also depending on the current capacity of your battery. Credits to [email protected]
-- Xposed Log cleaner - this is one of the scripts I initially released to temporarily fix the logging problem of the latest Xposed Installer. If you don't have the app, the script will exit - http://forum.xda-developers.com/showpost.php?p=56439074
- Added host file to block annoying phishing and ad-serving websites
- Added resolv.conf to use Google's public DNS for faster browsing
11-DEC-2014 ALPHA 3B UPDATES
- lowmemorykiller - Another rotational script that will check and update your lowmemorykiller parameters - Won't really add much value since LMK resets its value from time to time.. Thanks again bro @kermage !
- 3G Booster - I have now added in the flashable installer the 3G hack from [email protected]
- Added an uninstaller in case you don't like the tweaks. Thank you for using.
WHAT'S INSIDE
/system/etc/init.d/
- 01_BattTweaks
- 02_LoopySmoothness
- 03_VMTweaks
- 04_GPURender
- 05_DHCPD
- 06_SDBoost
- 07_IOTweaks
- 10_DONOTDELETE
- 11_Network
- 13_EXT4Remount
- 14_Zram
- 16_LagBuster
- 17_SetProps
- 51_Zipalign
/system/etc/
- hosts
- resolv.conf
/system/xbin/
- bash
- busybox
- rngd
- sqlite3
- zip
- zipalign
/data/Tweaks/scripts
- 08_LagFix.sh
- 09_Defrag.sh
- 12_CPUHotplug.sh
- 15_Mem_Tweaks
- 50_XposedCleanLog.sh
/data/Tweaks/logs
*** All logs from init.d scripts and rotational scripts (/data/Tweaks/scripts)
Click to expand...
Click to collapse
REQUIREMENTS
1. Rooted
2. Busybox
3. Kernel with init.d support
4. Custom recovery tool (CWMR, TWRP, Philz, CarlivTouch)
5. Presence of mind
6. Faith!
HOW TO INSTALL
1. Download the flashable zip file and save it to your SDcard (remember where you saved it)
2. Power off your phone
3. Press Power + Vol UP + Vol DOWN simultaneously
4. Choose Recovery mode
5. Select install from SDcard
6. Install the zip file
7. Wait until the installation is completed.
8. Reboot!
To manually Push the tweak
1. Download the zip file into your SDcard
2. Extract the files
3. Copy all the contents of init.d to your /system/etc/init.d
4. Change the permission to rwxr-xr-x or rwxrwxrwx
5. Copy all the content of net to /system/etc
6. Change the permission of "hosts" and "resolv.conf" to rw-rw-rw
7. Go to /data and add a new folder named "Tweaks"
8. Go to /data/Tweaks and add new 2 folders - "scripts" and "logs"
9. Copy all the contents from "scripts" (from the zip file) to /data/Tweaks/scripts
10. Change the permissions of all the files in /data/Tweaks/scripts to rwxr-xr-x or rwxrwxrwx
11. Reboot.
HOW TO VERIFY
With the use of Root Explorer or ES Explorer, go to /data/Tweaks/logs and you will see the log files generated by the scripts. Also if you have a Terminal Emulator, you can check that the rotational scripts are running in the background.
Oh by the way, sorry to disappoint the Antutu lovers but the scripts were not customized to satisfy your eyes with Antutu scores.
To manually Delete the Tweaks
1. Delete all the files mentioned above from your phone using Root Explorer (or any file manager like ES explorer)
2. You can leave the files added in /system/xbin/ as it may help you in the future... 'just a suggestion but you can delete it if you want.
FAQs
Q: Not working. How can I tell the scripts were actually working?
A: Check the logs stored in /data/Tweaks/logs and inspect if there are log files. And with the use of any text editor check one by one the log files for any errors.
Q: There are no files in /data/Tweaks/logs, what happened?
A: It is possible that your ROM does not have init.d support. You can try using [email protected]'s fix for that (http://forum.xda-developers.com/showthread.php?t=1933849). Then you can try using again the tweak
Q: After flashing the tweaks, I cannot connect to my VPN app like Psiphon. How to fix this?
A: To be honest, I am unsure yet why but you can try either the following:
1. Check again the permission of /system/etc/hosts, /system/etc/resolv.conf and make sure they are set to rw-rw-rw. Then reboot;
2. OR, move/delete /system/etc/init.d/11_Network, /system/etc/hosts, /system/etc/resolv.conf then reboot
Q: My Internet connection is slow.
A: You can try adding the 3G hack from [email protected] (http://forum.xda-developers.com/showpost.php?p=42185612&postcount=100)
Q: The tweak is actually useless, it is not working. Should this be the case?
A: If I was not able to help you in any way, thanks for testing and feedback. Google is our friend.
Thank you all!
Mix n Match ALPHA 3B is now available
CHANGES 11-DEC-2014:
Please refer to the notes above. for the updates .
The INSTALLER will backup your previous tweaks and any conflicting files with Mix n Match. I have also added now an UNINSTALLER in case you are not satisfied. The UNINSTALLER will revert all the changes made before you flashed the latest tweaks.
Again... Flash at your own risk!
Thank you very much
great job man.. :good:
what version of rio you're using?
mines s5501 and running on kitkat deodexed by edmhar, is your tweaks compatible with edmhar's deodexed stock rom?
Good, i'll write governer tweaks for hotplug and post link here, i'll make different versions for more battery and more responsiveness
Agua Rio
cheeze.keyk said:
great job man.. :good:
what version of rio you're using?
mines s5501 and running on kitkat deodexed by edmhar, is your tweaks compatible with edmhar's deodexed stock rom?
Click to expand...
Click to collapse
I am using Agua Rio V2
COOL!
umangleekha said:
Good, i'll write governer tweaks for hotplug and post link here, i'll make different versions for more battery and more responsiveness
Click to expand...
Click to collapse
Cool! And good JOB as well
updated the hotplug
umangleekha said:
Good, i'll write governer tweaks for hotplug and post link here, i'll make different versions for more battery and more responsiveness
Click to expand...
Click to collapse
Hey Bro, in this release I have modified your CPU hotplug and this is a rotational shell script
Code:
#!/system/bin/sh
# Name: 12_CPUHotplug.sh
# Date: 11/03/2014
# Author: Arsie Organo Jr. - [email protected]
# Link:
# About: This is additional tweaking for MT6582 devices
# to improve battery life
# You will need your device to be:
# 1. Rooted
# 2. Busybox is installed.
# 3. hotplug
# Credits: Fly-On, Medusa, and Umang Leekha hotplug
####################################################
# START
# Logging
datalog=/data/Tweaks/logs/12_CPUHotplug.log
# Check if your device supports Hotplug
HOTPLUG=/sys/devices/system/cpu/cpufreq/hotplug
if [ -d $HOTPLUG ] ; then
echo "This device supports hotplug." | tee -a $datalog;
else
echo "No hotplug support for this device. Exiting script now!" | tee -a $datalog;
exit 0
fi;
# If device is awake, it will check current battery level and also the %usr level of the CPU (all)
a=1
sleepme=10
while [ $a -ge 0 ]
do
busybox rm -f $datalog
busybox touch $datalog
BATTSTAT=`cat /sys/class/power_supply/battery/capacity`
MAXLVL=100
USRLVL=`busybox mpstat -P ALL | grep all | awk '{print $3}'`
USRLVL=${USRLVL%.*}
GAUGE=60
ANTUTU=`ps | grep com.antutu | wc -l`
ANTUTUUSE=`busybox top -b -n10 -d3 | grep com.antutu.ABenchMark | cut -c42-45 | awk '{sum+=$0}END{print sum*10}'`
if [ $ANTUTUUSE -gt 10 ] ; then
echo "Antutu Benchmark is still running. Unable to switch to Level 5 hotplug." | tee -a $datalog;
else
killall -9 com.antutu.ABenchMark
fi;
chmod 644 /sys/devices/system/cpu/cpufreq/hotplug/*
if [ $ANTUTU -gt 0 ] ; then
echo "Level Antutu Hotplug (Pro Performance) will be applied due to Antutu - $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $datalog;
echo "Battery Level: $BATTSTAT | MPSTAT Level: $USRLVL" | tee -a $datalog;
echo 85 > /sys/devices/system/cpu/cpufreq/hotplug/up_threshold;
echo 90 > /sys/devices/system/cpu/cpufreq/hotplug/cpu_up_threshold;
echo 50000 > /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate;
echo 10 > /sys/devices/system/cpu/cpufreq/hotplug/cpu_down_differential;
echo 15 > /sys/devices/system/cpu/cpufreq/hotplug/down_differential;
echo 0 > /sys/devices/system/cpu/cpufreq/hotplug/powersave_bias;
echo 50000 > /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate_min;
echo 4 > /sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit;
echo "up_threshold: $( cat /sys/devices/system/cpu/cpufreq/hotplug/up_threshold )" | tee -a $datalog;
echo "cpu_up_threshold: $( cat /sys/devices/system/cpu/cpufreq/hotplug/cpu_up_threshold )" | tee -a $datalog;
echo "sampling_rate: $( cat /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate )" | tee -a $datalog;
echo "cpu_down_differential: $( cat /sys/devices/system/cpu/cpufreq/hotplug/cpu_down_differential )" | tee -a $datalog;
echo "powersave_bias: $( cat /sys/devices/system/cpu/cpufreq/hotplug/powersave_bias )" | tee -a $datalog;
echo "sampling_rate_min: $( cat /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate_min )" | tee -a $datalog;
echo "cpu_num_limit: $( cat /sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit )" | tee -a $datalog;
echo "===== COMPLETED - $( date +"%m-%d-%Y %H:%M:%S" ) =====" | tee -a $datalog;
elif [ $USRLVL -lt $GAUGE ] || [ $BATTSTAT -lt $GAUGE ]; then
echo "Level 5 Hotplug (Battery Saver) will be applied - $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $datalog;
echo "Battery Level: $BATTSTAT | MPSTAT Level: $USRLVL" | tee -a $datalog;
echo 95 > /sys/devices/system/cpu/cpufreq/hotplug/up_threshold;
echo 95 > /sys/devices/system/cpu/cpufreq/hotplug/cpu_up_threshold;
echo 40000 > /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate;
echo 1 > /sys/devices/system/cpu/cpufreq/hotplug/cpu_down_differential;
echo 1 > /sys/devices/system/cpu/cpufreq/hotplug/down_differential;
echo 100 > /sys/devices/system/cpu/cpufreq/hotplug/powersave_bias;
echo 40000 > /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate_min;
echo 2 > /sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit;
echo "up_threshold: $( cat /sys/devices/system/cpu/cpufreq/hotplug/up_threshold )" | tee -a $datalog;
echo "cpu_up_threshold: $( cat /sys/devices/system/cpu/cpufreq/hotplug/cpu_up_threshold )" | tee -a $datalog;
echo "sampling_rate: $( cat /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate )" | tee -a $datalog;
echo "cpu_down_differential: $( cat /sys/devices/system/cpu/cpufreq/hotplug/cpu_down_differential )" | tee -a $datalog;
echo "powersave_bias: $( cat /sys/devices/system/cpu/cpufreq/hotplug/powersave_bias )" | tee -a $datalog;
echo "sampling_rate_min: $( cat /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate_min )" | tee -a $datalog;
echo "cpu_num_limit: $( cat /sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit )" | tee -a $datalog;
echo "===== COMPLETED - $( date +"%m-%d-%Y %H:%M:%S" ) =====" | tee -a $datalog;
elif [ $USRLVL -ge $GAUGE ] && [ $BATTSTAT -ge $GAUGE ] ; then
echo "Level 0 Hotplug (Pro Performance) will be applied - $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $datalog;
echo "Battery Level: $BATTSTAT | MPSTAT Level: $USRLVL" | tee -a $datalog;
echo 85 > /sys/devices/system/cpu/cpufreq/hotplug/up_threshold;
echo 85 > /sys/devices/system/cpu/cpufreq/hotplug/cpu_up_threshold;
echo 30000 > /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate;
echo 15 > /sys/devices/system/cpu/cpufreq/hotplug/cpu_down_differential;
echo 15 > /sys/devices/system/cpu/cpufreq/hotplug/down_differential;
echo 0 > /sys/devices/system/cpu/cpufreq/hotplug/powersave_bias;
echo 30000 > /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate_min;
echo 4 > /sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit;
echo "up_threshold: $( cat /sys/devices/system/cpu/cpufreq/hotplug/up_threshold )" | tee -a $datalog;
echo "cpu_up_threshold: $( cat /sys/devices/system/cpu/cpufreq/hotplug/cpu_up_threshold )" | tee -a $datalog;
echo "sampling_rate: $( cat /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate )" | tee -a $datalog;
echo "cpu_down_differential: $( cat /sys/devices/system/cpu/cpufreq/hotplug/cpu_down_differential )" | tee -a $datalog;
echo "powersave_bias: $( cat /sys/devices/system/cpu/cpufreq/hotplug/powersave_bias )" | tee -a $datalog;
echo "sampling_rate_min: $( cat /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate_min )" | tee -a $datalog;
echo "cpu_num_limit: $( cat /sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit )" | tee -a $datalog;
echo "===== COMPLETED - $( date +"%m-%d-%Y %H:%M:%S" ) =====" | tee -a $datalog;
fi;
sleep $sleepme
done
# END
Too interested in !
But I have to ask you how to uninstall if we did not use your special one, because of I have a sad experience before...
Good question, I always make sure that anything I install I create a document or uninstaller.. however, I was too busy at work and wanted to share this to my FB friends so I published it as Alpha version and wanted to get their feedback.
Give me a few minutes and I will update the doc on how to uninstall.
Hi dhampire,
I have updated the docs for you.. in the next release I will make an backup and uninstaller so that if someone does not want this tweaks they can go back from their previous set.
Good Job ser!
Next custom rom
LOL!
petiksmode said:
Next custom rom
Click to expand...
Click to collapse
hopefully I'd be able to cook one
Will this work on leagoo lead 3? mt6582, 512m of ram
init.d support
birdsilver said:
Will this work on leagoo lead 3? mt6582, 512m of ram
Click to expand...
Click to collapse
Please wait on my next release within this week and try on your phone. But please check first if your device supports init.d.
eyesfortech said:
Please wait on my next release within this week and try on your phone. But please check first if your device supports init.d.
Click to expand...
Click to collapse
Thank you very much for your response, I'll wait. I activated init.d thanks to Ryuinferno, via the terminal support.
:good:
The main page has been updated.. check out what's new
I have re-uploaded the MixnMatch_ALPHA_3b_Installer.zip installer today (12Dec2014) to fix the Bluetooth on/off bug.
Sorry for the inconvenience guys. It should be OK now.
Thanks your job! I'm trying now.
Hi.
Thanks your job! I'm trying now.
In my device, your log said that these scripts did not work.
- 09_Defrag.sh
- 12_CPUHotplug.sh
My device Lenovo s930 (MT6582) dual sim / Kitkat 4.4.2
Regards.
Problem (Sound)
Hi. I have a report for you master.
Sound problem.
1. Telephone.
In my case, I can't hear a voice (1st call), after hang up, I can hear a voice on 2nd call with big voice.
2. Alarm
I can't hear a sound.
Common is sound problem.
Regards.
Logs
dhampire said:
Hi.
Thanks your job! I'm trying now.
In my device, your log said that these scripts did not work.
- 09_Defrag.sh
- 12_CPUHotplug.sh
My device Lenovo s930 (MT6582) dual sim / Kitkat 4.4.2
Regards.
Click to expand...
Click to collapse
Can you send me the logs from /data/Tweaks/logs ?
Or please let me know if you are familiar with ADB Shell so that I can give you the commands to check.
Thanks.
17_SetProps
dhampire said:
Hi.
Thanks your job! I'm trying now.
In my device, your log said that these scripts did not work.
- 09_Defrag.sh
- 12_CPUHotplug.sh
My device Lenovo s930 (MT6582) dual sim / Kitkat 4.4.2
Regards.
Click to expand...
Click to collapse
dhampire said:
Hi. I have a report for you master.
Sound problem.
1. Telephone.
In my case, I can't hear a voice (1st call), after hang up, I can hear a voice on 2nd call with big voice.
2. Alarm
I can't hear a sound.
Common is sound problem.
Regards.
Click to expand...
Click to collapse
Hi,
Since we have a different device, can you delete 17_SetProps from /system/etc/init.d and then reboot?
Thanks.