[Xperia Play Android Development] paxChristos:
Since We have such a fantastic tutorial on how to build your own CM9, I thought I'd add one for building a kernel.

Edit: updated kernel sources for jellybean

First off:

You NEED Linux. DO NOT TRY THIS ON WINDOWS, IT WON'T WORK.

Sources: https://github.com/CyanogenMod/semc-kernel-msm7x30

https://github.com/DarkforestGroup/sony-kernel-msm7x30-ics

https://github.com/DooMLoRD/Xperia-2011-Kernel-2.6.32.9

http://xdaforums.com/showthread.php?t=1556971

http://xdaforums.com/showthread.php?t=1477845

http://developer.sonymobile.com/wp/2011/05/06/how-to-build-a-linux-kernel/

DooMLoRD, KeiranFTW & Atarii.

Prepping:

1) Grab the toolchain I have here (Android NDK R5b), it's the only one I've been able to use that doesn't throw errors when compiling (stock based kernels): http://db.tt/hE3TmJJi Doom has provided a better toolchain https://github.com/DooMLoRD/android_prebuilt_toolchains[/QUOTE] you can get it using

git clone https://github.com/DooMLoRD/android_prebuilt_toolchains.git -b master <optional_folder_name_you_choose>

(thanks Doom!!)

Building a kernel from fxp sources

1) Terminal for any commands, file explorer for finding stuff & gedit for changes.

2) open up terminal, mkdir <name_you_want> (no spaces)

3) cd <name_you_want>

4) git clone https://github.com/freexperia/semc-kernel-msm-7x30-ics -b ics <optional_name_you_want_the_folder_to_be> (no spaces)

5) cd <optional_name_you_want_the_folder_to_be>/semc-kernel-msm-7x30-ics (if you didn't rename it)

6) (If this is after the first time, and lets say a week has past do this step, otherwise ignore) git pull (automatically updates any files)

7) First important step: Find the defconfig that fxp uses. They are located in arch/arm/config. fxp_zeus_defconfig is the name of theirs

8) copy fxp_zeus_defconfig & rename to <what_you_want_it_named>_zeus_defconfig (for example, mine will be pax_zeus_defconfig)

9) open up your defconfig & put it into another workspace, we'll mess with it later

10) Hop onto DooMLoRD's github, his we'll use for references.

11) Adding governors: https://github.com/DooMLoRD/Xperia-...mmit/bec19001ded34077d7776639834a1229b69e5f87

A1) Well, as I look into this, fxp has a ton of governors not used... (located in <name_of_kernel_folder>/drivers/cpufreq/

A2) Check the Kconfig file to see that they're all in there (they must just not be in the defconfig file)

A3) Edit the deconfig file you created in lines 467-474 removing "#" from any you want to add (and add in any you might've added by adding the line CONFIG_CPU_FREQ_GOV_<NAME_OF_GOVERNOR>=y

A4) If you want to add more governors, check out the Commits from DooMLoRD's build to add in when needed (anytime you see a "+" that means line added, "-" means line deleted)

12) Adding IO Schedulers: https://github.com/DooMLoRD/Xperia-...mmit/0ae625f7561c559d4933284f489733bf5eb66e96

B1) Navigate to <name_of_kernel>/block folder

B2) Once again, FXP has a ton of IO Schedulers added, but not used in Play kernel:

B3) Open up Kconfig.ioshced to make sure they're in there (and add any you want)

B4) Edit the defconfig file you created (lines 121-137) & fix it to your liking (same as above)

B5) If you want to add more, see Doom's commits to add 'em

13) Turning off ALS

C1) Navigate to <name_of_kernel>/arch/arm/mach-msm

C2) Open up board-semc_zeus.c

C3) Search for .als_connected (it on line 1349)

C4) Change the variable from 1 to 0

14) Overclocking

D1) open up arch/arm/mach-msm/acpuclock-7x30.c

D2) Lines 96 - 144 contain the PLL2 table, which is used to set clock speeds, note FXP can go all the way up to 2ghz, they just stop it short.

Continued in post 2 because all of this in one post 20% more awesome than XDA can handle ;)

Pax