Thanks!
Hi!
To make changes permanent, you need to add the command "echo ..." to some init-script so that it gets executed automatically on startup.
STEP 1: MAKE A NANDROID BACKUP! (just to be on the safe side..)
STEP 2: Find an init-script, where to add the command.
I don't know which init-scripts are installed on other ROMs, so I can only speak for MoDaCo ROM. Here I have found the init-script "/system/init.d/ramzswap.sh" (which is normally used for enabling compcache). Take a look in "/system/init.d/" or "/system/etc/init.d/" what you find there. It depends on your ROM. In theory you can use any script which gets executed at startup. We just want to add one command to it.
STEP 3: add the command to your script
Code:
# Make the /system/ filesystem read-/writeable:
#
[B]adb remount[/B]
# Download the identified script to your computer
#
[B]adb pull /system/init.d/ramzswap.sh .[/B] # <-- don't forget the dot
# Now the script file should be in your local working directory on your
# computer. Open it with an editor ([B]do not use notepad.exe[/B] under windows,
# as it cannot display linux-style linebreaks correctly). Under Windows
# I can recommend notepad++ or use Wordpad if you don't have anything
# else. Under Linux every text editor should be ok.
#
# [B]Insert[/B] the "echo" command [B]at the end of the file![/B]
# For example:
[B]echo "1536,3072,4096,21000,23000,25000" > /sys/module/lowmemorykiller/parameters/minfree[/B]
# Save the file and copy it back to your device into the directory, where
# you pulled it from.
#
[B]adb push ramzswap.sh /system/init.d/[/B]
# Make it executable again:
#
[B]adb shell chmod a+x /system/init.d/ramzswap.sh[/B]
#
# Restart your phone.
# If you did everything right, and it boots normally, you can check
# if the script works by displaying the current settings:
#
[B]adb shell cat /sys/module/lowmemorykiller/parameters/minfree[/B]
# This should give you the 6 numbers you added in the echo command to
# the init-script.
Give us feedback how it worked.
Maybe everone could tell us, which init-script he used on a particular ROM. Or maybe the ROM-cooks are interested to add this tweak directly to their ROMs. Feel free to use this knowledge!
Thanks for the instructions provided, I am currently using MCCR 3.2 and the file system I have on my phone is
/system/init.d/teknologist.sh . file
Following your instructions I use the following commands..
adb remount
adb pull /system/init.d/teknologist.sh .
teknologist.sh .
adb push teknologist.sh /system/init.d/
adb shell chmod a+x /system/init.d/teknologist.sh
The question I wanted to ask was the file extracted was as follows:
/system/xbin/insmod /system/lib/modules/tun.ko
echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Do I add the command directly after, i.e
/system/xbin/insmod /system/lib/modules/tun.ko
echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governorecho "1536,3072,4096,21000,23000,25000" > /sys/module/lowmemorykiller/parameters/minfree
via notepad++ or do i place the command on a separate line
/system/xbin/insmod /system/lib/modules/tun.ko
echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "1536,3072,4096,21000,23000,25000" > /sys/module/lowmemorykiller/parameters/minfree