How to compile your own kernel.

Would you mind posting what exactly to do to clock34xx.c??
 
First of all, thank you so much for this guide, and I manage to successfully compile a kernel for my Motorola Droid. The overclock instruction was pretty straight forward, and I manager to overclock to 1 ghz, but I was wondering where or what line in clock34xx.c to edit that allow slot 5 working. Forgive me for asking, since I'm visually impair, it took me so long to find it. Anyway, once again, thank you so much for this guide, and keep up the good work out there.
 
Exec format error

Hi all,
I'm trying to build the ext2.ko and unionfs.ko for my Milestone to able to use APP2SD ..
I followed the instructions to get the omap source and patch the unionfs source into the kernel source then build. It can be built without problem, then I try to put the ext2.ko and unionfs.ko to the phone and try to load them using "insmod", it gives me an error of "Exec format error"

Do I have change anything in the "make menuconfig" in order to build binary compatible with my Milestone? I already checked that it's ARM system type has set to "TI OMAP" and "OMAP34xx Based System" is selected.

Is there anything else to pay attention?

(I'm using stock OTA Milestone 2.1update1 ROM with root access)

Thanks a lot!!!
--Patrick
 
Last edited:
Would you mind posting what exactly to do to clock34xx.c??


Hey there. I missed this, but basically look for the section that disabled the overdrive and delete the "-1" there.
 
Here it is.

Change prcm = mpu_opps + MAX_VDD1_OPP -1;

to
prcm = mpu_opps + MAX_VDD1_OPP;
 
Hi all,
I'm trying to build the ext2.ko and unionfs.ko for my Milestone to able to use APP2SD ..
I followed the instructions to get the omap source and patch the unionfs source into the kernel source then build. It can be built without problem, then I try to put the ext2.ko and unionfs.ko to the phone and try to load them using "insmod", it gives me an error of "Exec format error"

Do I have change anything in the "make menuconfig" in order to build binary compatible with my Milestone? I already checked that it's ARM system type has set to "TI OMAP" and "OMAP34xx Based System" is selected.

Is there anything else to pay attention?

(I'm using stock OTA Milestone 2.1update1 ROM with root access)

Thanks a lot!!!
--Patrick

why are you adding unionFS as a module, cant you just merge the unionFS source code with the omap kernel then set it in menuconfig as "built-in" or if the option is not available in menuconfig then just add the config setting to enable it as built-in in the .config?

also ext2 support is built into the kernel from the start and should just be enabled in menuconfig as built-in
 
Thank you very much for your response!!
I want to build modules because I want to stick to the stock kernel instead of a custom one ... is there any method to do that?
Thanks!!


why are you adding unionFS as a module, cant you just merge the unionFS source code with the omap kernel then set it in menuconfig as "built-in" or if the option is not available in menuconfig then just add the config setting to enable it as built-in in the .config?

also ext2 support is built into the kernel from the start and should just be enabled in menuconfig as built-in
 
Thank you very much for your response!!
I want to build modules because I want to stick to the stock kernel instead of a custom one ... is there any method to do that?
Thanks!!


why are you adding unionFS as a module, cant you just merge the unionFS source code with the omap kernel then set it in menuconfig as "built-in" or if the option is not available in menuconfig then just add the config setting to enable it as built-in in the .config?

also ext2 support is built into the kernel from the start and should just be enabled in menuconfig as built-in
THIS WOULD ONLY WORK IF THE STOCK KERNEL HAS EXTERNEL MODULE SUPPORT ENABLED, CHECK THE DEFAULT MILESTONE DEFCONFIG

yea there is a way to build modules for the stock kernel, you would need the stock kernel EXACT version, check by doing:
Code:
adb shell uname -a

you would need to merge your sources if needed
then this will make the kernel with the local version you got from uname -a (replace -gf922713 with your version
) it also links the modules make to that local version so the stock kernel should accept them as their own.
Code:
$ make LOCALVERSION=-gf922713 #example use your local version though, ie. the hyphin and numbers after it

then try loading those modules, let me know if it works:)
 
Last edited:
Thanks a lot!
Yes, the stock kernel do support module loading, cause I managed to download an ext2.ko on the web and got it loaded on my phone.
I will try to build my own with your hints and upload the results here!

Cheers!

THIS WOULD ONLY WORK IF THE STOCK KERNEL HAS EXTERNEL MODULE SUPPORT ENABLED, CHECK THE DEFAULT MILESTONE DEFCONFIG

yea there is a way to build modules for the stock kernel, you would need the stock kernel EXACT version, check by doing:
Code:
adb shell uname -a

you would need to merge your sources if needed
then this will make the kernel with the local version you got from uname -a (replace -gf922713 with your version
) it also links the modules make to that local version so the stock kernel should accept them as their own.
Code:
$ make LOCALVERSION=-gf922713 #example use your local version though, ie. the hyphin and numbers after it

then try loading those modules, let me know if it works:)
 
I did

git clone git://android.git.kernel.org/kernel/omap.git

Downloaded the entire thing.. and I do not have a sholes_defconfig.

Where is it? (Edit: It appears to have been removed from the 'Master' branch, but still resides in the other branches)

I would really like to learn how to do this without copying your attaching config zip.
 
Last edited:
Nevermind.. I skipped the 'checkout' step.. looks like it's compiling now.
 
Part 6
Flashing kernel and hosing your phone


You cannot do this from within Android, so reboot to recovery mode.
You will also need adb setup for this. In SPRecovery, go to mount options and mount the sd card.

Code:
adb shell
flash_image boot /sdcard/boot.img
Reboot.

Once back up (assuming you booted), install the wifi driver.
Code:
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
busybox cp /sdcard/tiwlan.ko /system/lib/modules/tiwlan.ko
sync
reboot
Thats the main meat of it. Many things can be added and modified that go beyond this tutorial. The sky is the limit.

Here is a sample kernel I made. Its not meant for regular use, just an example :)

Couldn't you just make an update.zip and put that on the root of the sd card and install it that way?
 
I'd just like to say thanks.. I just booted up my Droid running CyanogenMod 5.0.7.1 and MY KERNEL!!!

Also I used Koush's AnyKernel format which is WAY easier than the way you described it (no offense).

The AnyKernel format requires you to simply copy the kernel image and modules into folders, zip it up into update.zip and copy it to sd card, and viola.

AWESOME.. I'm very excited about the possibilities from here on.. thanks again!!!!
 
Last edited:
Can somebody comment on what checkout tag should be used for the 2.6.32 froyo kernel? Any other important things to note for using these instructions on a newer kernel version?

Also - is there a common location for information on various kernel hacks that become commonplace? I see overclocking listed in this thread, but are there other common tricks listed on a wiki somewhere?
 
Part 6
Flashing kernel and hosing your phone


You cannot do this from within Android, so reboot to recovery mode.
You will also need adb setup for this. In SPRecovery, go to mount options and mount the sd card.

Code:
adb shell
flash_image boot /sdcard/boot.img
Reboot.)
I reboot into recovery (SPRecovery) mount the sd card, open terminal and type adb shell:

I get back :
Code:
error:device not found

any advice?
 
Back
Top