[DEV][KER] Ultimate Kernel for XW build with CWM 5.0.2.8 and voodoo sound [REV 1.3a]
Features :
- Wifi and accelerometer should works fine for XW ROM owner
- Faster speed based on better code generation (will work on OC in next release)
- Voodoo sound and super user will be automatically dropped upon restart, so that even you have deleted them by accident, the kernel will always get them back for you 
- Does automatically install busybox in /system/bin, so that you can start messing with bash script
'
- Lifespan tweak (avoid frequent read / write to disk) and network tweak via sysctl.conf (since ver 1.2c)
- Performance tweak and battery life tweak as well via default.prop (since ver 1.3). To understand what I have done, check below for the copy default.prop with explanation.
- Automatically adds bravia engine to the system (since ver 1.3a) (there was a bug in ver 1.3 that makes bravia engine didn't work)
- Added 3 IO scheduler at the moment, sio, bfq and vr. SIO is selected by kernel by default. (You may override it with your init.d script) (since ver 1.3a)
- Automatically zipalign and perform database optimization with sqlite3 (thanks to ius in CM dev team to provide his statically linked binary) (since ver 1.3a)
- Perform a load of IO improvement when booting the device (since ver 1.3a)
Since too many people bitched about the error while the kernel is running safe on my phone, I decided to make this kernel into dev release now. And may become private one in the future.
btw, if you want to use this kernel, please remove all those SetCPU or blahblahblah program for setting CPU frequency. Because setting CPU frequency simply doesn't work on my kernel (only 1.0Ghz max). And my kernel only works best with stock ROM, please let me know if you have any problem. In you have found any force close problem, and the problem persists after you have wiped the dalvik cache in CWM, that means you /data partition is doomed as having corruption made by the heat generated from other OC'ed kernels, and stop complaining about it in my thread. Just stick to the original kernel if you do not want the speed boost caused by dalvik int:jit mode. (The reason that I need to wipe dalvik-cache during installation)
For ROM developer :
- If you want to write something to /proc/sys/blah/blah/blah, you no longer need to use echo to input value to there. You just need to place a sysctl.cfg under /etc and then call 'sysctl -p' in the init.d script. Look below for an example of sysctl.cfg.
Credits goes to supercurio for his voodoo sound patch, xlm13x for testing, ius @ CM dev team for providing statically linked sqlite3 binary, utkanos for providing guide in make CWM, Turl for providing a guideline for making BroadConfig.mk (for the errata patch

), each IO scheduler author for their kind support for Linux community.
Change log in version 1.3a :
- Makes bravia engine works again
- Removed the problematic prop from default.prop so that the camera recording works again
- Added 3 IO schedulers : sio, bfq, vr (automatically select sio on all mmcblk partition by default)
- Sqlite3 and zipalign optimization upon boot
- Deleted the part for wiping dalvik-cache and cache on every boot (so this will do less damage to disk as well as faster boot speed)
(btw if you experience any force close, please boot to CWM and select 'Advanced' -> 'Wipe dalvik-cache'.)
- Since this build, there will be 2 versions because there is a IO optimization performed on /efs that may brick your device. Please always use CWM to flash both as I have finally made a backup script in the updater that automatically back up your /efs upon installation
- Since this build, the way to flash the kernel via odin is deprecated and un-recommended since it does not backup your /efs folder upon installation
- Since this build, service iq and user stats data will get disabled and no longer get sent to any user stat server
- Finally it is a stable release 
Differences between dangerous build and normal build : dangerous build means it modify the mount option of /efs to disable ext4 journalism to gain IO performance which could compromise the integrity of the /efs partition (which means your phone can be bricked), normal build means that it doesn't do anything for disable ext4 journalism on /efs.
However the dangerous build should be safe if you flash it via my CWM flashable zip because it does automatically backup your /efs upon installation (and allow you to restore later). Just backup the efs_backup.img in the internal sdcard or external sdcard and you are good to go. (I have made the backup on both sdcard, and even if you install my kernel multiple time via CWM, the oldest version of efs partition is still be saved because the script does not overwrite the efs_backup.img by itself. If efs_backup.img exists, efs.img is created instead.) But it does really take you time when you need to restore the efs partition. (You have to repack it for flashing in odin or flashing via CWM, will make a guide for it later) If you really afraid of using the dangerous build, use safe build instead.
Change log in version 1.3 :
- Added bravia engine
- Moved those apk files aways from /sbin to /tmp
- More tweaks made via default.prop now
- Fixed a typo in the post init script that made init.d script stops working and stops dropping su and other stuff into the system automatically
btw since ver 1.3, the boot time will take longer as the system has to wipe and re-generate the dalvik cache everytime it boots. This is due to I have set the dalvik vm mode to int:jit and the dalvik cache has to be wiped. But don't worry, it will still boot.
Change log in version 1.2c2 :
- Major update that fixed the 'accident' (was too busying in development, sry)
- Added more useful binary into /sbin for normal boot condition and /system/bin, such as tune2fs and makee2fs
- A minor update in the post-init script that drops voodoo sound only when the string 'org.projectvoodoo.controlapp' in not found in /system/app package list (instead of totally matching the string)
Change log in version 1.2c1 (minor update that can ensure that voodoo sound is automatically installed + an accident :x ) :
- Automatically installs voodoo sound without any problem (If you find that voodoo sound is bitching about mod developer is lame, just restart once and everything should work)
- Accidentally rolled out a development ramdisk for CWM in this release
Change log in version 1.2c (all the changes are made in ramdisk only, no kernel improvement yet) :
- Supports init.d script initialization now (Credit goes to ardatdat for original post-init.sh method)
- Using busybox instead of the crappy samsung stock toolbox binary (should be more useful if you use adbd for debug frequently) which has following 2 benefits
- Using busybox binary could also increase the performance as all the binaries are compiled with optimization (I am not totally sure about this at the moment, but it seems like the OS works faster now)
- A fully functional working bash script in /system/bin

- Network speed tweak by increasing memory buffer size for network connection (via sysctl.cfg placed in the root directory of the ramdisk)
- Has enabled many config that can avoid frequent read write to the NAND (disk) to further expand the lifespan of your device
Change log in version 1.2b :
- Added voodoo support to stock XW kernel
- Added CWM 5.0.2.8
- Modification on makefile that generates optimized code for our device
To-do list (for next major version release) :
- Add OC capability
- Installing busybox on boot.img by default <----- finished
- Add a version number in the build number <----- finished as well
Timeline :
Phase 1 : Boost performance and network speed boost by using the property I have set via default.prop and sysctl.conf (so it will work on any rom if the ROM developer doesn't override them, work best for stock ROM) <- finished, made in ver 1.3
Phase 2 : Removing those sysctl setting from the init script so that no duplicate entry is made in the ramdisk
Phase 3 : Enabling overclock in the kernel (yes 1200mhz by default but no longer 1000mhz) <----- will be the ver 1.4
Phase 4 : Patch out CWM to support backup to external sd, as well as supporting installing zip from external sd
Phase 5 : Properly adding zipalign to the kernel such that files will get zipalign-ed by default
Phase 6 : Add IO scheduler <---- Finished by half, still lots of scheduler can be added
Phase 7 : Allow the user to set CPU frequency for different CPU separately
Phase 8 : Investigate the wifi disconnect problem
Credit goes to supercurio for his old voodoo sound kernel patches made on Galaxy tab 10.1, which I have ported to this device using cherry pick method.
Kernel rev 1.3a download link (for odin) (Safe version) (without messing with /efs) (totally un-recommended as you need to wipe dalvik cache for using my kernel, CWM version does it automatically) :
http://www.mediafire.com/?206q94b2f25ouh4
Kernel rev 1.3a download link which can be flashed with CWM (Safe version) (Without messing with /efs) :
http://www.mediafire.com/?fcpea3c8an3k325
Kernel rev 1.3a download link (for odin) (Dangerous version) (totally un-recommended as you need to wipe dalvik cache for using my kernel, CWM version does it automatically) :
http://www.mediafire.com/?vapkb382fyaj6nu
Kernel rev 1.3a download link which can be flashed with CWM (Dangerous version) :
http://www.mediafire.com/?1ii2sdz1qode012
To install it (without CWM from stock firmware) :
1. Download the zip file from here and unpack it :
http://www.mediafire.com/?cf6ah2cfzvcko
2. Download odin 1.8.5 from the sticky post
3. Flash the extracted .tar.md5 file with odin (just place it in PDA tab and press start after your phone has got into download mode and connected to your PC)
4. Then follow the guide below
To install it (with CWM from version other than 1.2c1) (recommended way) :
1. Download the CWM flashable zip file and then put it on your phone
internal SD card (external sd card is not supported for installation at the moment, will get it supported in next build)
2. Start the phone in recovery mode with 3 buttons combo (Press the power button, and after the phone started, immediately press the volume up + home button)
2.1 If the phone is switched on, just power off it
2.2 After the phone powered off, press power button to switch it on again, after the boot logo is shown, immediately press Volume up + home button. CWM recovery mode will be shown.
3. Install the package via CWM (Install zip from sdcard)
Then reboot and restart the system twice to make sure that voodoo sound library is properly dropped.
Warning : If you are trying to update from Ultimate kernel ver 1.2c1, follow the following guide instead. I know this may be painful for you, however I am here to help you to fix the problem that I accidentally introduced in ver 1.2c1 without getting download counter increased. I apologize for any inconvenience caused. In general, if adbd is enabled on a device and if dd binary is presented, you can always use the following method to flash a kernel / CWM.
Guide post :
http://forum.xda-developers.com/show...&postcount=102
To recover (uninstall my kernel) (for any errors) :
1. First open up this folder : http://www.mediafire.com/?cf6ah2cfzvcko
2. Select the target that you want (they are all flashable via CWM) :
ardatdat kernel v1.7b1 CWM -> means ardatdat kernel v1.7b1 with stock recovery ZCLA1 image (these are the images that used by ardatdat kernel by default)
ardatdat kernel v1.7b2 CWM -> means ardatdat kernel v1.7b2 with stock recovery XWLA4 image (these are the images that used by ardatdat kernel by default)
stock boot and CWM 5.0.2.8 (XWLA4) -> means stock kernel XWLA4 but with my CWM
stock boot and CWM 5.0.2.8 (ZCLA1) -> means stock kernel ZCLA1 but with my CWM
Stock boot and recovery (XWLA4) CWM -> means stock kernel and recovery image (DO NOT select this unless you want no CWM recovery and revert to default)
Stock boot and recovery (ZCLA1) CWM -> means stock kernel and recovery image (DO NOT select this unless you want no CWM recovery and revert to default)
3. Boot your phone in CWM recovery mode, select 'mounts and storage' -> 'mount USB device', copy the downloaded file to the internal sd that mounted to your PC
4. Then just flash it via CWM (Install zip from sdcard)
5. Wipe dalvik cache and cache via CWM menu
6. Reboot
And since ver 1.2c1, you no longer need to install superuser, su binary and voodoo sound seperatedly on your own now.
The full src code change can be viewed here :
https://github.com/UnknownzD/I9103_X...commits/master
The ramdisk folder for boot.img can be viewed here :
https://github.com/UnknownzD/I9103_X...boot_initramfs
The ramdisk folder for recovery.img can be viewed here :
https://github.com/UnknownzD/I9103_X...very_initramfs
Example of sysctl.cfg
https://github.com/UnknownzD/I9103_X...er/sysctl.conf
Copy of default.prop (ver 1.3a) :
https://github.com/UnknownzD/I9103_X...r/default.prop
btw I hope that the same patch can be made to I9103_CHN_Kernel very soon. I have too much things to do atm, still a ROM and 3 exams to be finished atm.