[LG Optimus 2x] Stefan Gündhör:
Ohai, everypwny!​

Wanna impress your girlfriend without spending any money? Show her your love through compiling her your own O2X stock kernel! :D​

Requirements: A PC capable of running a virtual Linux machine -- if your PC isn't much older than 5-6 years there shouldn't be a problem. Just make sure you have enough RAM (at least 1,5 - 2 GB recommended) -- no programming - or special linux knowledge required!

## Info: The VMWare image has been created by Jonas Hendrickx for XDA (I just altered/modified it for my needs).

5 simple steps to success: -- EVERYONE can do that!

Download and install Vmware Player (Freeware): http://www.vmware.com/go/get-player (VirtualBox will work too if you like this app better)

Download the file "guestekrnL_doItYourself_developer.rar" (http://guendhoer.com:9000/guestekrnL_doItYourself_developer.rar or https://docs.google.com/open?id=0B5HJ_FpcC9ymM3ZCS0l5RFJtZnc , 1.5GB) and unpack it (using WinRar or 7Zip or...) to any folder of your choice, and afterwards double-click the file "Android Developer.vmx" -- or alternatively open VMware Player first and then import the virtual machine located in the unpacked .rar contents

Click "I copied it" and wait until virtual machine starts up, login with password "root"

Open folder "kernel_source" (on Desktop), double-click file "buildkernel" and click "run in terminal"

Wait until terminal window closes, and start using your new kernel located in folder Desktop/kernel_source/guestekrnL_BUILDS

After this an exact copy of current guestekrnL "SR99R100.1PI.1337-GoodBye" has been built and packaged to a flashable CWM-Zip.

Possible things you can easily change yourself for making your own different/improved kernel versions:

Use a different compilation toolchain

(p.ex. http://releases.linaro.org/<choose a release version>/components/android/toolchain/<choose a gcc version>/)

download the file "android-toolchain-eabi-linaro-..." and replace the folder "android-toolchain-eabi" on Desktop of virtual machine with the unpacked content of the downloaded file

There are many different builds of linaro toolchains available, resulting in different smoothness, battery life and stability of the built kernel. Important:

[*]After toolchain change you have to edit the file "buildkernel" (rightclick -> open with gedit) and change the gcc version number to the one of your new toolchain (you find it here: Desktop/android-toolchain-eabi/lib/gcc/arm-eabi/<gcc version number>), save the file afterwards

Attention: if you switch to a toolchain newer than september 2011, you MUST change

to

in file Desktop/kernel_source/arch/arm/configs/gueste_defconfig -- otherwise kernel won't boot!

Only use toolchains with a number up to "4.6" in name, the newer ones ("4.7") are for ICS and not Gingerbread!

NOT every new toolchain will work with O2X stock kernels -> p.ex. 4.6.4 might not work while 4.6.2 works. Every toolchain older or equal to september 2011 should work BUT maybe you will have to remove some of the build flags not recognized by the older chain.

Always check Desktop/kernel_source/guestekrnL_BUILDS/build.log for errors after you made a new kernel build, especially at the bottom of the file. (Warnings don't matter.)

Use a different version-name for the built kernel

right-click file "buildkernel" in kernel_source folder -> open with gedit -> change kernelVersion there

Use a different general name for the built kernel (other than "guestekrnL")

double-click file "Makefile" in kernel_source folder -> click "Display" -> change kernel name there (change ".9-guestekrnL" to ".9-<yourKernelName>")

Attention: the Android app GuesteOC won't work if it doesn't find the String "guestekrnL" in kernel name! You then have to use the function-reduced version of the OC app by TrymHansen available for all kernels!

Use different build optimization flags

double-click file "Makefile" in kernel_source folder -> click "Display" -> search "CFLAGS_GUESTE" -> edit the build flags there

you find a good overview + explainations of available build flags here http://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/Optimize-Options.html

and an interesting article on which flags the toolchain guys use here: http://www.linaro.org/linaro-blog/2...aro-android-2011-10-and-future-optimizations/

it is completely up to YOU which flags to use and not to use!

Stock standard would be:

while the flags of current guestekrnL are:

if you have many flags like above, make line-breaks using slashes like above and only put 2-3 flags in one line!

Use different basic kernel configuration values

open folder "kernel_source", click the search-icon, search for "gueste"

edit the 2 files "guestekrnl.c" and "guestekrnl.h" of the result set according to your needs

guestekrnl.c and guestekrnl.h contain many default voltage/speed/... values, you can change them easily there

if you change MAX_OVERCLOCK to a higher value, you might need to change MAX_VOLTAGE as well and have to alter the whole cpu voltage and frequency table (see next point)

Help & explainations here: http://xdaforums.com/showpost.php?p=26696158&postcount=25

Change CPU scaling voltages and speed steps

Edit the file Desktop/kernel_source/arch/arm/mach-tegra/nvrm/core/common/nvrm_clocks_limits.c and alter the two arrays "FakeShmooVoltages[]" and "FakepScaledCpuLimits"

the difference from one voltage step to another one needs to be lower or equal than 100mV;; too low voltages for a step results in freezes !!

the values for MAX_VOLTAGE and MAX_OVERCLOCK are located in file guestekrnL.h!

Help & explainations here: http://xdaforums.com/showpost.php?p=26696158&postcount=25

Example of creating a kernel overclockable to 1.5 GHz: http://xdaforums.com/showpost.php?p=26759653&postcount=58

Enable/Disable kernel features you want to use or don't want to use

open folder "kernel_source", click the search-icon, search for "gueste", edit the file "gueste_defconfig" according to your needs

"<featureName>=y" means the feature is enabled

"#<featureName> is not set" means the feature is disabled

Google for more information about what the different kernel features do, just past the kernel feature name in Google and you will find a description for most of them

Change the text shown to user on CWM installation of kernel

Edit the file Desktop/kernel_source/zipstructure/META-INF/com/google/android/updater-script according to your needs

If you are completely bad-ass you can also compile the compilation toolchain from the official sources yourself instead of using a prebuilt one (even if the prebuilt ones tend to be much more stable than the self-compiled ones) :D

Useful & important additional tipps/hints: Check this out

Info: If you ever stop the compilation progress before finishing, you have to edit the file "Makefile" in kernel folder and remove the version number from the version string (so only .9-guestekrnL should remain), otherwise you will have double version number in next kernel build.

Start being a kernel developer for XDA right now, today!

Advantages:

- U can impress many users by presenting them your hard work

- You will be acknowledged

- You will be able to easily express your creativity to the world wide web

- And much much more ,,, Sign up today! Oh, wait, no signup needed :D

If you think you have created an extremely good version of guestekrnL or maybe a completely new kernel, think about posting it here in the thread (I will link the posted kernels here in first posting) or open your own thread for your new kernel, it is up to you :)

As always I'm not responsible for any harm you might do to your system ;)

Wanna build other stock sources than the ones of guestekrnL? Check this out