How to compile your own kernel.

jamezelle

Premium Member
Premium Member
Developer
Joined
Apr 11, 2010
Messages
620
Reaction score
0
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?

i use clockworkmod recovery, its more advanced in my opinion. you can install it with rom manager free from the market, ive had NO problems getting adb shell in recovery with clockworkmod
 

Drew408

New Member
Joined
May 11, 2010
Messages
18
Reaction score
0
I used clockworkmod and it worked but my recovery seems unstable. sometimes it wont mount the sd card. sometimes it reboots on its own back to normal.
I got an error just now

adb shell
error: protocol fault (no status)

then reboots
 
Last edited:

ljbaumer

Member
Joined
Apr 2, 2010
Messages
70
Reaction score
0
Location
Unicorn Land
Hey sorry to bump an old thread but I just have 2 quick questions...


1) Does this still work nowadays? I mean is all of the data still updated or should I download new kernel stuff or something? If so how?

2) When I try and do this command:
Code:
git checkout --track -b android-omap-2.6.29-eclair origin/android-omap-2.6.29-eclair
This always comes up:
Code:
ljbaumer@ubuntu:~/kernel/droid/ti$ git checkout --track -b android-omap-2.6.29-eclair origin/android-omap-2.6.29-eclair
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/android-omap-2.6.29-eclair' which can not be resolved as commit?
What should I do?


Thanks a bunch,
ljbaumer
 

teddyearp

Senior Member
Joined
Jan 13, 2010
Messages
1,816
Reaction score
12
Location
Pinetop, AZ
Current Phone Model
Motorola Razr 5g Rooted
Although I don't have a complete answer for you, I can say with a fair amount of confidence that this thread is too old and is in serious need of maintenance. The kernel has been updated from 2.6.29 to 2.6.32 and the newest version is gingerbread, though you _might_ be able to still pull froyo source independant of the gingerbread commits.

I personally gave up because the android gods just don't seem to want me to compile. Either my linux machine was always crashing and/or every time I asked a question it went unanswered.

good luck

edit: and the op hasn't even been signed into this site all year.
 
Last edited:

teddyearp

Senior Member
Joined
Jan 13, 2010
Messages
1,816
Reaction score
12
Location
Pinetop, AZ
Current Phone Model
Motorola Razr 5g Rooted
Well, I'm not sure how you would download the kernel only files for gingerbread; basically the kernel for gingerbread and froyo are the same as it was coming from eclair to froyo that the kernel version was changed, here's an educated guess:
Code:
git checkout --track -b android-omap-2.6.32-froyo origin/android-omap-2.6.32-froyo
Now that is a guess only. If you want to download the whole gingerbread source, that is another story and I am pretty sure I know where to find the proper command for that.

good luck
 

ljbaumer

Member
Joined
Apr 2, 2010
Messages
70
Reaction score
0
Location
Unicorn Land
Awesome, I'll try that when I get a chance, do you have instructions for getting all of the froyo stuff? Like just using the eclair commands but with froyo?


Thanks,
ljbaumer
 

n8loller

New Member
Joined
Apr 27, 2011
Messages
3
Reaction score
0
Solution

Code:
git checkout --track -b android-omap-2.6.32-froyo origin/android-omap-2.6.32-froyo
Now that is a guess only.

I do believe I have found the proper solution.

Froyo:

Code:
git checkout --track -b android-omap-2.6.32 origin/archive/android-omap-2.6.32

Eclair:

Code:
git checkout --track -b android-omap-2.6.29-eclair origin/archive/android-omap-2.6.29-eclair

To find what heads (branches) are being called at any point in time check the bottom of the page at android.git.kernel.org Git - kernel/omap.git/summary for the "heads" section. Today the 5th item down is "archive/android-omap-2.6.32", which made the branch we put in the "git checkout" command "origin/archive/android-omap-2.6.32".

I haven't pushed any further into the guide than this step yet, but I will post updates if/when I finish to let everyone know if it still works.
 

n8loller

New Member
Joined
Apr 27, 2011
Messages
3
Reaction score
0
So, I figured the other branches might be out of date as well. In general, it seems the way to make sure you are pulling the right branch is to go to the main web site (android.git.kernel.org Git) and find the '.git' that you want to check out. Then when you click on that package, go to the bottom of the page and check the heads (maybe tags as well?).

example - platform/system/wlan/ti:

android.git.kernel.org Git - platform/system/wlan/ti.git/summary

Active heads are:

  • froyo
  • froyo-plus-aosp
  • froyo-release
  • gingerbread
  • gingerbread-release
  • master
  • tools_r7
...

I left the end out because you should get the point.

Here is what I used for the other two packages:

Code:
git checkout --track -b froyo origin/froyo

I am trying to build froyo, of course. There were also froyo-release and froyo-plus-aosp, but I have no idea which one I should use.
 

n8loller

New Member
Joined
Apr 27, 2011
Messages
3
Reaction score
0
So, I made it further, but still some problems. I thought I'd document them in case others see the same thing later.

Code:
nate@my_comp:~/android/android-kernel/droid1/omap$ make
make: /home/nate/android/android-kernel/droid1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc: Command not found
...
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2

So this error arose when I tried to 'make' the kernel. Keep in mind that although the OP doesn't use it, you can still use "make -j<num>" where <num> is 1 or 2 times the number of threads your CPU has (or any other number). I have an Intel i7 980x, so my system is x86_64 and I use "-j24".

Anyways, I recently re-installed Ubuntu, and hadn't set up my development environment completely. I forgot to make sure that I had a proper 32-bit build environment set up.

Instructions on doing this are at http://source.android.com/source/initializing.html:

Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev

Especially:

Code:
sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386

I stopped on making the wifi driver because of this error:

Code:
make -C /home/nate/kernel/droid/omap M=`pwd` ARCH=arm CROSS_COMPILE=/home/nate/android/android-kernel/droid1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules
make: Entering an unknown directory
make: *** /home/nate/kernel/droid/omap: No such file or directory.  Stop.
make: Leaving an unknown directory
make[1]: *** [../../../stad/build/linux/libestadrv.a] Error 2
make[1]: Leaving directory `/home/nate/android/android-kernel/droid1/ti/wilink_6_1/stad/build/linux'
make: Entering an unknown directory

...and I'm back, and this error was because I put the source code in a different directory than this guide instructed us to... I guess I should keep that in mind when setting the environment variables, haha. I just needed to run:

Code:
export KERNEL_DIR=~/<path to omap directory>

then try make again
 
Last edited:

zoomy942

Member
Joined
Mar 3, 2011
Messages
305
Reaction score
1
So here is a question.

Can you work backwards?

What I mean is, I'm using a RZ 125/800 low volt kernel right now, but I want to change it to 125/600 low volt. basically the exact same, but max it at 600. Is there a way to do that?
 

davros

Premium Member
Premium Member
Developer
Joined
Jun 7, 2010
Messages
2,836
Reaction score
31
Location
Worcester MA
Website
www.twitter.com
Setcpu or build a kernel 125-600 lv using the correct voltages

Sent from my Droid using DroidForums
 

zoomy942

Member
Joined
Mar 3, 2011
Messages
305
Reaction score
1
Setcpu or build a kernel 125-600 lv using the correct voltages

Sent from my Droid using DroidForums

Will do. I'm trying to avoid using setcpu is possible so I'll dl Ubuntu and see how it goes.
 
Top