HOWTO: custom kernel on Samsung Galaxy S II I9100
2011-8-29 22:33:0 Author: arighi.blogspot.com(查看原文) 阅读量:5 收藏

Recently I've replaced my Bravo HTC Desire with a new Android phone: a Samsung Galaxy S II I-9100. I couldn't resist too much with the stock kernel, so finally I've found some spare time to cook a custom kernel starting from the original Samsung kernel source code GT-I9100_OpenSource_Update2.

In this post I report (for me to remember later and for those who are interested) all the steps that I did to setup the build environment, cross compile the custom kernel and flash it into the phone.

DISCLAIMER: I take no responsibility for anything that may go wrong by you following these instructions. Proceed at your own risk!

=== Requirements ===

- A Samsung Galaxy S II (not necessarily rooted! you'll get a root shell when you'll flash the new kernel)
- The latest android SDK
- The arm-none-eabi cross-compile toolchain (you can get it from the CodeSourcery website)

=== HOWTO ===

Download and install the arm toolchain from the CodeSourcery website: be sure that arm-none-eabi-gcc is in your $PATH.

Get the autobuild script:
 $ git clone git://github.com/arighi/gt-i9100.git

Run the script:
 $ ./build-kernel.sh

The script downloads the "-arighi" kernel source code, a initramfs template and builds a new kernel ready to be flashed into the device.

At the end of the autobuild process the file kernel-gt-i9100-arighi.tar can be used to flash the new kernel to the phone using Odin (search on the web or in the xda-developers forum, there are tons of howtos/tutorials for this).

=== Results ===

The score with Quadrant benchmark is not bad at all, I got always > 4000, but remember that we're cheating during the IO test, due to the fsync-disable patch.

Anyway overall result looks good enough.

== Additional notes ===

- All the custom *.ko files are included into the initramfs to avoid potential errors/problems with the original kernel modules (so it is always possible to flash back the original kernel later, all the old kernel modules are still there, untouched).

- After you've flashed the -arighi kernel the first time you will also have root access to your device. The initramfs template enables adb root shell (ro.secure == 0), so an adb shell will immediately drop you to a root shell. This means you can also re-flash your device from Linux directly using the flash-kernel.sh script.

- For the complete list of all the patches applied to this kernel have a look at the git log here.

- IMPORTANT: the fsync-disable patch (enabled in the kernel by default) can increase performance and battery life, but it is dangerous, because it might eat your data!! It makes the software no longer crash safe, so if you start to randomly kill your apps you may lose some data


[UPDATE: the fsync-disable patch is no more enabled by default in the kernel, to enable it just set CONFIG_FILE_SYNC_DISABLE=y in the kernel .config)]


文章来源: http://arighi.blogspot.com/2011/08/howto-custom-kernel-on-samsung-galaxy-s.html
如有侵权请联系:admin#unsafe.sh