A cikket továbbiakban Angolul folytatom, mivel belinkelem külföldi fórumokra is.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The following modifications may VIOLATE YOUR PHONE'S WARRANTY or COMPLETELY BRICK IT. I DO NOT TAKE ANY GUARANTEES about methods described within this article.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
PURPOSE: Speed up the T-Mobile's Pulse phone, without applying a custom ROM on it. Also make some modifications to consume less power - extend on-battery runtime.
TO ACHIEVE IT: We need to root the phone, install busybox to have general linux shell commands, then replace the kernel with a smarter one (default kernel does not have swap support). Then we have to create an in-memory swap with SD card based backing swap function (to let more applications fit in phone's memory, e.g.: desktop does not have to completely reinitialize when exiting larger applications, etc.), addition with a method that lowers the wearing of our SD card (re-create it on another area of the card after every restart). Finally some variable tunings required to lower swappiness (from 60 to 10), set lower idle frequency for the CPU (from 240MHz to 120MHz - saves battery) and speed up CPU's frequency scalig when CPU usage increases (from 80% to 50% - faster responses).
Lets see...
I. Preparing
Format SD card in the phone. No ext2 or swap partitions will be needed.
Download the following files to a Windows XP (32bit) computer:
The rooting method propably wont work on 64bit OS'es...
- http://content.modaco.net/dropzone/1.1-pulse-superboot.zip
- http://content.modaco.net/dropzone/modacopatchedrecovery-1.0.zip
- http://www.anddev.org/download.php?id=449
- http://content.modaco.net/dropzone/busybox
- http://www.romraid.com/paul/pulse/1.1-update-pulse-mck-signed.zip
Extract the contents of the first archive to a folder like "c:\pulse\" (create it).
Extract the the second archives "Hero" folder contents also to "c:\pulse\".
Extract the android_usb_windows folders contents from the third archive to "c:\pulse\driver\" folder (create it).
Place the busybox file from the fourth link under "c:\pulse\busybox\" folder (create it).
Extract the contents of the fifth archive under "c:\pulse\kernel\" folder (create it).
Create the file "c:\pulse\busybox\start" with notepad, and put these lines in it:
#!/data/busybox/sh
MODULES=/data/system/modules
LOOPFILE=/dev/block/loop0
SWAPFILE=/sdcard/swapfile.swp
SWAPSIZE=49152
MEMLIMIT=12288
SWAPPY=10
CPUMIN=122880
CPUMAX=528000
CPUTHR=50
echo "[x] Loading kernel modules..."
for MODULE in tun lzo_decompress lzo_compress xvmalloc
do
if [ ! -r $MODULES/$MODULE.ko ]
then
echo " ! Failed to read: $MODULES/$MODULE.ko"
exit 1
fi
insmod $MODULES/$MODULE.ko 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
echo " ! Failed to load: $MODULES/$MODULE.ko"
exit 1
fi
echo " - Loaded: $MODULES/$MODULE.ko"
done
echo " Done."
echo "[x] Rotating swap to protect SD..."
if [ -f $SWAPFILE ]
then
mv $SWAPFILE $SWAPFILE.old 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
echo " ! Failed to move: $SWAPFILE to $SWAPFILE.old"
exit 1
fi
echo " - Moved: $SWAPFILE to $SWAPFILE.old"
fi
if [ ! -f $SWAPFILE ]
then
dd if=/dev/zero of=$SWAPFILE bs=1024 count=$SWAPSIZE 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
echo " ! Failed to create: $SWAPFILE"
exit 1
fi
echo " - Created: $SWAPFILE ($SWAPSIZE KB)"
mkswap $SWAPFILE 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
echo " ! Failed to format: $SWAPFILE"
exit 1
fi
echo " - Formatted: $SWAPFILE"
fi
if [ -f $SWAPFILE.old ]
then
rm $SWAPFILE.old 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
echo " ! Failed to delete: $SWAPFILE.old"
exit 1
fi
echo " - Deleted: $SWAPFILE.old"
fi
echo " Done."
echo "[x] Creating fake block device..."
losetup $LOOPFILE $SWAPFILE 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
echo " ! Failed to fake: $SWAPFILE to $LOOPFILE"
exit 1
fi
echo " - Faked: $SWAPFILE to $LOOPFILE"
echo " Done."
echo "[x] Setting up compcache..."
if [ ! -r $MODULES/ramzswap.ko ]
then
echo " ! Failed to read: $MODULES/ramzswap.ko"
exit 1
fi
insmod $MODULES/ramzswap.ko memlimit_kb=$MEMLIMIT backing_swap=$LOOPFILE 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
echo " ! Failed to load: $MODULES/ramzswap.ko"
exit 1
fi
echo " - Loaded: $MODULES/ramzswap.ko"
swapon /dev/block/ramzswap0 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]
then
echo " ! Failed to swapon: /dev/block/ramzswap0"
exit 1
fi
echo " - Swapon: /dev/block/ramzswap0"
echo " Memory limit: $MEMLIMIT KB"
echo " Backing swap: $SWAPSIZE KB"
echo " Done."
echo "[x] Setting variables..."
echo $SWAPPY > /proc/sys/vm/swappiness
echo " - Swappiness: $SWAPPY"
echo $CPUMIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo " - CPU min. frequency: $CPUMIN"
echo $CPUMAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo " - CPU max. frequency: $CPUMAX"
echo $CPUTHR > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo " - CPU up threshold: $CPUTHR"
echo " Done."
exit 0
Install a terminal emulator from the Market on the phone. I prefer "Better Terminal Emulator".
Now connect the phone to the computer as a flash drive via the bundled USB cable, or put the SD card in a card reader connected to the computer.
Copy the following files to the SD card's root directory:
c:\pulse\busybox\busybox
c:\pulse\busybox\start
c:\pulse\kernel\boot.img
c:\pulse\kernel\system\lib\modules\*
II. Rooting the phone
Turn off the phone, (re-)connect it with the computer using the bundled USB cable. Press volume down and call end buttons, then turn on the phone. After a blue screen appears on it release the volume down and call end buttons.
Now Windows will install some drivers, but there will be an unknown device called "Android 1.0". Install the driver for it from "c:\pulse\driver\".
Open a command prompt:
> cd c:\pulse\
> install-superboot-windows.bat
Thats all.
Disconnect the USB cable and restart the phone - just for sure.
III. Install busybox
Open the terminal on the phone, then:
# su (it will prompt to allow root access, click yes)
# mkdir /data/system/modules
# mkdir /data/busybox/
# cd /sdcard/
# cat busybox > /data/busybox/busybox
# cat start > /data/busybox/start
# rm busybox
# rm start
# cd /data/busybox/
# chmod 4755 busybox
# chmod 4755 start
# ./busybox --install -s /data/busybox/
# rm su
In the terminal application's settings set the PATH variable to include "/data/busybox/".
IV. Replace the kernel
Restart the terminal application, then:
# su
# cd /sdcard/
# ls
# cat <every>.ko > /data/system/modules/<every>.ko
# rm <every>.ko
# cat boot.img > /data/system/boot.img
# rm boot.img
# flash_image recovery /data/system/boot.img
Now exit the terminal application, and start the Quick Boot program (installed automaticly when we rooted the phone) and click on Recovery.
The phone will boot up with the new kernel. To verify it open te terminal application, then:
# uname -a
The kernel build date should be around Dec 9, the original kernel was built in September. Now try every device (wifi, bluetooth, etc.) and some applications to make sure everything works fine. If not, then simply restart the phone, it will boot up with the original kernel.
If everything looks fine, open the terminal application, then:
#su
# flash_image boot /data/system/boot.img
Exit from the terminal and restart the phone. Now the new kernel will start after every restart.
V. Create swap, tune variables, etc.
Open the terminal application, then:
# su
# start
The start script will do all the jobs. It will take a few seconds to rotate the swap file on the SD card (to lower its wearing time). If it exists immediately, then you propably do not su'ed or already executed the script.
Note that you have to run this script after every phone restart. There are many solutions on the net to "autostart" it - if you require.
We are done.
How to get some useful informations from the terminal:
# cat /proc/ramzswap
# cat /proc/meminfo
# cat /proc/swaps
# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
# free
Cheers!