Quantcast
Channel: xda-developers - Galaxy S II Android Development
Viewing all articles
Browse latest Browse all 397

[CWM UTIL] Kernel Wipe Script

$
0
0
GS2KernelWipe is a cleaning script that I have developed that is run through CWM Recovery. It prepares your GSII for flashing a new kernel. It removes much of the previous rubbish that you may have sitting on your phone from all your past kernels/tweaks etc. This left over rubbish can hinder the performance of your new kernel. GS2KernelWipe removes all old kernel files that I am so far aware of as well as removing Voltage Control and NSTools settings and certain known kernel startup scripts from the startup (/system/etc/init.d) folder. (provided you have saved these app's settings as init.d scripts) These app's settings are removed as it is better to be able to view what your new kernel's default settings are after the first flash so that you can tweak from there. Just in case, GS2KernelWipe will save all your current scripts into /sdcard/MyBackups/init.d prior to removing any of them.


GS2KernelWipe
[Does the following:
1. Saves all current startup scripts to /sdcard/MyBackups/init.d
2. Removes Voltage Control and NSTools startup scripts (only if saved as init.d, and not as a service) along with many other kernel-specific startup scripts from /system/etc/init.d
3. Removes ExTweaks, STweaks, Voltage Control, NSTools and SetCPU dalvik-cache areas.
4. Removes old kernel-specific files (currently Siyah, DorimanX, PhilZ, Jeboo, Void, Andoidmeda, NEAK and Abyss are cleared)
5. Removes /data/user.log

cache and dalvik-cache do not get fully wiped.
/cache and dalvik-cache areas are not directly used by kernels at all. However, dalvik-cache is used by applications (.apk files) and obviously certain applications can affect kernel parameters. Therefore GS2KernelWipe currently removes specific dalvik-cache files for:
1. STweaks
2. ExTweaks
3. NSTools
4. SetCPU
5. Voltage Control

Not removing the entire dalvik-cache will therefore speed up the first boot as all your application's dalvik areas will not need to be regenerated, particularly on ICS/JB handsets.


Restoring Scripts
You can restore any of your old init.d startup scripts manually by copying the files from the backup folder GS2KernelWipe creates, /sdcard/MyBackups/init.d. This can be done through Root Explorer or similar. All init.d scripts are saved into here before clearing. You will have to ensure the permissions are rwx r-x r-x (755) or rwx rwx rwx (777) after you have copied them back into /system/etc/init.d. Therefore if for any reason you want to retain your current Voltage Control or NSTools settings (save as init.d option only) for your new kernel, then you can copy /sdcard/MyBackups/init.d/S91voltctrl and/or /sdcard/MyBackups/init.d/99nstools back into /system/etc/init.d after flashing your new kernel. Make sure it has rwx permission throughout. You will need Root Explorer or similar to do this.


Test Mode
The script inside the zip files that does all the work is called GS2KernelWipe.sh. This can now be called via adb shell/Script Manager etc. in order to perform a test dummy-run. The Test Mode goes through all the motions as per a standard CWM Recovery run, but it does not remove any files/folders in any way, and merely shows the commands it would have done.
eg. extract GS2KernelWipe.sh from the zip using 7Zip or similar
adb shell
/bin/sh GS2KernelWipe.sh


Let me know if you have any other ideas as to files/folders that could also be removed so I can look into it for possible inclusion in the next release.


I would like to express my big thanks to ironass and THE RED BLUR for all their help and support.



Related Threads
Great guide by THE RED BLUR
GS2ROMWipe/Nuke
GS2KernelWipe thread on AndroidForums

Viewing all articles
Browse latest Browse all 397

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>