[Xperia Play Android Development] paxChristos:
Cont'd from post 1

15) Building the Kernel

E1) Save your defconfig file, you'll need it now.

E2) naviage to <name_of_kernel> folder (in terminal)

E3) Type in "ARCH=arm CROSS_COMPILE=<path_to_cross_compiler_i'll_use_min e_for_example>/home/paxchristos/Android_Source/doom_ndk/arm-eabi-4.4.3//bin/arm-eabi- make <what_you_put_here>_zeus_defconfig

E4) Type in "ARCH=arm CROSS_COMPILE=<path_to_cross_compiler_from_above>/arm-eabi- make

E5) Sit back and relax (assuming it doesn't throw any errors, if it does, post here & I'll try to help you through them)

16) Getting the ramdisk

F1) Download a working copy of FXP's kernel (either through my zips or fxp zips)

F2) Goto here: http://xdaforums.com/showthread.php?t=1477845, download the xperiaboottools.zip that's attached.

F3) Now what I did (you don't have to) is chmod 755 mkbootimg & split_bootimg.pl & (sudo) cp to /bin for easy calling.

F4) Navagiate in terminal to where you downloaded fxp kernel

F5) mkdir <working_folder>

F6) cp <fxp_kernel> <working_folder>

F7) cd <working folder>

F8) split_bootimg.pl <fxp_kernel>

F9) mkdir ramdisk

F10) cd ramdisk

F11) gzip -dc ../<fxp_kernel>.img-ramdisk.gz | cpio -i

F12) Now you have the ramdisk, let's futz with it.

F13) First (easiest step) is to goto default.prop & change ro.secure=1 to ro.secure=0

F14) That's mainly what we want to do with it, if you want to change the boot image, go here: http://xdaforums.com/showthread.php?t=1494076 for how to do it manually, or here: http://xdaforums.com/showthread.php?t=1513146 for the automatic way.

F15) now that we're done with the ramdisk, we'll go back to terminal

F16) find . | cpio -o -H newc | gzip > ../ramdisk.img

F17) cd ../

17) Putting the ramdisk & kernel together

G1) By now (hopefully) the kernel is done compiling. (time for terminal, you should still be in folder you were above)

G2) cp ~/<folder_you_put_the_kernel_source_in>/arch/arm/boot/zImage ./

G3) mkbootimg --base 0x00200000 --kernel zImage --ramdisk ramdisk.img -o <what_you_want_to_name_your_kernel>.img

18) Flashing it for testing.

H1) Keep your copy of FXP's kernel around, just in case any issues happen

H2) fastboot boot <your_kernel>.img

H3) If it boots & works, SUCCESS!! you modified your own custom kernel!

H4) If it doesn't boot (at all, just a vibrate & blank screen for 10-20 seconds) there's a problem with the ramdisk, sometimes it's bad, sometimes is needs filler, overall, it's just a pain in the butt to figure out.

H5) If it boots & bootloops the splash screen, well, that's an issue with the ramdisk again, that possibly, your ramdisk does not match you rom. Recovery, reflash rom & try again.

Courtesy of Atarii reminding me :D

19) Adding your wifi modules (they get built when you build the kernel) into the ramdisk

I1) Let's pretend that you haven't gotten through step F16, we're gonna add the wifi modules in.

I2) The wifi modules are located in <name_of_kernel_source_folder>/drivers/net/wireless/

I3) Copy bcm4329.ko to ~/ramdisk/working/modules/

I4) Add in the following lines to init.semc.rc

#load bcm4329 module
insmod /modules/bcm4329.ko

I5) Now your modules will autoload on boot!

Pax