[HOW-TO] Build your own kernel package from source

Jerry Hildenbrand

Space Cowboy
Staff member
Oct 11, 2009
5,569
2,797
113
Visit site
i dont have an htc but in my search for an answer has led me to you and this place of knowledge....


trying to do the repo init and instead of going to ~/droid folder it keeps trying to go to my /home/jarvis. any idea on how to change which folder the repo tries to go to. im running 9.10 so if you dont know thats ok nobody has seemed to have the answer. thanks for reading.

Code:
jarvis@jarvis:~$ cd ~
jarvis@jarvis:~$ mkdir mydroid
jarvis@jarvis:~$ cd mydroid
[COLOR="Red"]mkdir bin
curl http://android.git.kernel.org/repo > ~/bin/repo
chmod a+x ~/bin/repo

~/bin/repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair
~/bin/repo sync[/COLOR]

jarvis@jarvis:~/mydroid$ repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair

Your Name  []:
Your Email [@gmail.com]:

Your identity is:  <>
is this correct [yes/no]? yes

[B][I]repo initialized in /home/jarvis[/I][/B]<---- the issue
jarvis@jarvis:~/mydroid$

Have a look at what I added in red in your code. Are you grabbing the repo script from android.git.kernel.org and putting it in ~/bin, then using that script in your sync?
 
  • Like
Reactions: bigsupersquid

dougpiston

Active member
Jan 4, 2010
31
8
0
Visit site
HowTo: Set up For Development in Ubuntu 9.1 (thanks denkai) - ModMyMoto - Software Modding Forums and Updates for Motorola Phones

i was following that tutorial. so i was making the bin before this and there is a a bin dir in my home that has repo in it. someone on a git google group mention i should try

rm -rf ~/.repo

thinks i may have install repo to my home file at one point.

really appreciate your help here. thanks a ton. just someone looking at it is awesome. i was also thinking of just reinstalling 8.0.4 and starting fresh
 

Jerry Hildenbrand

Space Cowboy
Staff member
Oct 11, 2009
5,569
2,797
113
Visit site
HowTo: Set up For Development in Ubuntu 9.1 (thanks denkai) - ModMyMoto - Software Modding Forums and Updates for Motorola Phones

i was following that tutorial. so i was making the bin before this and there is a a bin dir in my home that has repo in it. someone on a git google group mention i should try

rm -rf ~/.repo

thinks i may have install repo to my home file at one point.

really appreciate your help here. thanks a ton. just someone looking at it is awesome. i was also thinking of just reinstalling 8.0.4 and starting fresh

rm -rf ~/.repo

just so you all know this fixed my issue... im now stuck elsewhere but i will fix it

SO to clarify, you may have mistakenly placed the repo script in ~/, and just had to delete that entry and add it in the correct place? (~/bin)

Knowing what mistakes look like and what fixes them is handy info.;)
 

dougpiston

Active member
Jan 4, 2010
31
8
0
Visit site
SO to clarify, you may have mistakenly placed the repo script in ~/, and just had to delete that entry and add it in the correct place? (~/bin)

Knowing what mistakes look like and what fixes them is handy info.;)

thats exactly right. now just getting hung up on a command after you dl'd a vendor tree..
 

Robchaos_

Well-known member
Feb 18, 2010
141
50
0
Visit site
I'd like to give a great big thanks to gbhil. Using this guide I have made my own custom kernel based off of gumbo 1.5c to include the overclock modification posted in XDA forums!
 

srkmagnus

Retired Moderator
May 23, 2010
13,434
210
0
Visit site
Man, too bad I don't have Linux and really dont' want to risk messing up my Mac by running Linux alongside osx :( Good write-up Gbhil, hopefully I can get around to incporating this and get deeper with Android.
 
Last edited:

David Fisher

New member
Nov 19, 2010
2
0
0
Visit site
Thanks for your info very much!

I followed you with my HTC Desire. I tied to compile this kernel but get the following build error.

Code:

CC drivers/mtd/nand/nand_ids.o
LD drivers/mtd/nand/built-in.o
LD drivers/mtd/onenand/built-in.o
LD drivers/mtd/tests/built-in.o
LD drivers/mtd/built-in.o
CC drivers/net/mii.o
make[2]: *** No rule to make target `drivers/net/kineto_gan.o', needed by `drivers/net/built-in.o'. Stop.
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

However,after I
change
[*] Networking support --->
to
[ ] Networking support --->
I successed.But,this is not a good idea.Because the Networking is not supported.Do you have any good resolution?
 

David Fisher

New member
Nov 19, 2010
2
0
0
Visit site
I've tried to compile this kernel but get the following build error. Has anyone else had this?

Code:

CC drivers/mtd/nand/nand_ids.o
LD drivers/mtd/nand/built-in.o
LD drivers/mtd/onenand/built-in.o
LD drivers/mtd/tests/built-in.o
LD drivers/mtd/built-in.o
CC drivers/net/mii.o
make[2]: *** No rule to make target `drivers/net/kineto_gan.o', needed by `drivers/net/built-in.o'. Stop.
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2
 

Joeseph Mother

Well-known member
Nov 30, 2010
80
22
0
Visit site
Trying to use this to create my first kernel for the optimus T, I know I probably shouldn't use an htc guide for an lg device, but this is the best tutorial I've seen (blatant ass kissing). So I'm using Ubuntu 9.10, because in the LG source it says 9.10 compile environment, and I downloaded java6 to match it, everything seems to go fine until putting the zimage in the boot.img, if I try to use flash_image boot /sdcard/zImage with the kernel it created, I get stuck in fastboot. If I follow the tutorial straight through and use flash_image boot /sdcard/myBoot.img, I get about 25 memory errors and a non-booting phone. So are the scripts to extract the kernel & ramdisk for the Hero only, or am I doing something (probably several things) wrong?
 

Joeseph Mother

Well-known member
Nov 30, 2010
80
22
0
Visit site
Decided to start over, now I get the same error every time I run make. Any ideas?

In file included from arch/arm/kernel/../mach-msm/lge/lge_errorhandler.h:15,
from arch/arm/kernel/traps.c:37:
arch/arm/kernel/../mach-msm/lge/../smd_private.h:82:2: error: #error No SMD Package Specified; aborting
arch/arm/kernel/traps.c: In function 'dump_backtrace_entry':
arch/arm/kernel/traps.c:65: warning: too few arguments for format
arch/arm/kernel/traps.c: In function '__die':
arch/arm/kernel/traps.c:277: error: 'hidden_reset_enable' undeclared (first use in this function)
arch/arm/kernel/traps.c:277: error: (Each undeclared identifier is reported only once
arch/arm/kernel/traps.c:277: error: for each function it appears in.)
make[1]: *** [arch/arm/kernel/traps.o] Error 1
make: *** [arch/arm/kernel] Error 2
 

Jerry Hildenbrand

Space Cowboy
Staff member
Oct 11, 2009
5,569
2,797
113
Visit site
Trying to use this to create my first kernel for the optimus T, I know I probably shouldn't use an htc guide for an lg device, but this is the best tutorial I've seen (blatant ass kissing). So I'm using Ubuntu 9.10, because in the LG source it says 9.10 compile environment, and I downloaded java6 to match it, everything seems to go fine until putting the zimage in the boot.img, if I try to use flash_image boot /sdcard/zImage with the kernel it created, I get stuck in fastboot. If I follow the tutorial straight through and use flash_image boot /sdcard/myBoot.img, I get about 25 memory errors and a non-booting phone. So are the scripts to extract the kernel & ramdisk for the Hero only, or am I doing something (probably several things) wrong?

when you repack the boot image, you need to correct memory space address (the base -- XXXXXXXXXX number) for the phone your working on. Get the right base address and the rest of the script should be just fine. Look in the kernel source here:
Code:
arch\arm\mach-msm\include\mach\memory.h
and find the section
Code:
 /* physical offset of RAM */
You should see a number for define PHYS_OFFSET, thats your base address.

Decided to start over, now I get the same error every time I run make. Any ideas?

In file included from arch/arm/kernel/../mach-msm/lge/lge_errorhandler.h:15,
from arch/arm/kernel/traps.c:37:
arch/arm/kernel/../mach-msm/lge/../smd_private.h:82:2: error: #error No SMD Package Specified; aborting
arch/arm/kernel/traps.c: In function 'dump_backtrace_entry':
arch/arm/kernel/traps.c:65: warning: too few arguments for format
arch/arm/kernel/traps.c: In function '__die':
arch/arm/kernel/traps.c:277: error: 'hidden_reset_enable' undeclared (first use in this function)
arch/arm/kernel/traps.c:277: error: (Each undeclared identifier is reported only once
arch/arm/kernel/traps.c:277: error: for each function it appears in.)
make[1]: *** [arch/arm/kernel/traps.o] Error 1
make: *** [arch/arm/kernel] Error 2

Try a "make clean" again
 

Joeseph Mother

Well-known member
Nov 30, 2010
80
22
0
Visit site
when you repack the boot image, you need to correct memory space address (the base -- XXXXXXXXXX number) for the phone your working on. Get the right base address and the rest of the script should be just fine. Look in the kernel source here:
Code:
arch\arm\mach-msm\include\mach\memory.h
and find the section
Code:
 /* physical offset of RAM */
You should see a number for define PHYS_OFFSET, thats your base address.

Try a "make clean" again

In memory.h, no number is present, I have:

/* physical offset of RAM */
#define PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
#define MAX_PHYSMEM_BITS 32
#define SECTION_SIZE_BITS 25
#define HAS_ARCH_IO_REMAP_PFN_RANGE
#ifndef __ASSEMBLY__

On my current setup everything is back to where it was last time (had to specify cross compile, toolchain, eabi path before clean), so I just need someone a lot smarter than me to figure out how to get my zimage loaded into the boot image. I know the zimage is good, because when I put it in the update.zip that drellidee put out, it boots fine. Thanks a lot for the help, I know idiots like me asking stupid questions can get irritating.
 
Last edited:

xandout

New member
Dec 19, 2010
2
0
0
Visit site
adb pull /proc/config.gz Not Found

Hey all im trying to follow this tutorial and when i run the adb pull /proc/config.gz command it returns 'not found'. ive tried this on aospMOD_0.9.9.2 and the stock 2.27.651.5 from htc.

is this needed and if so how can i get it?

thanks in advance
 

asadullah

Well-known member
Oct 23, 2010
480
182
0
Visit site
I just downloaded the source for the lg optimus m from their site so that I could find the base address. I unzipped it but there wasn't a PHYS_OFFSET in there. Any clues do I have to do something else

nevermind it's
Code:
CONFIG_PHYS_OFFSET=0x12200000

@josephmother in your output where you put,"#define PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)" the words in parenthesis tell you where the PHYS_OFFSET is. So look in your config that you pulled and your base address will be
 
Last edited:

asadullah

Well-known member
Oct 23, 2010
480
182
0
Visit site
Hey all im trying to follow this tutorial and when i run the adb pull /proc/config.gz command it returns 'not found'. ive tried this on aospMOD_0.9.9.2 and the stock 2.27.651.5 from htc.

is this needed and if so how can i get it?

thanks in advance

I just tried it on a sprint hero running a custom version of 2.27.651.5 (only things different is it's been flashed to metro pcs and has a custom boot image and kernel) I typed this into terminal
Code:
adb remount
adb pull /proc/config.gz
it pulled it fine. The changes I made wouldn't affect whether it was there or not
 

RevolutionMaster

New member
Feb 6, 2011
1
0
0
Visit site
I'm having some problems following this for my Huawei U8150 running Froyo.

Problem 1: I'm unable to extract the ramdisk from the boot.img file. It complains about it not being gzipped.
Problem 2: I'm not really sure if I'm using the right wlan.ko file for this. My phone doesn't appear to have one, but it does have a system folder in the ROM that includes a wifi folder and a "ar6000.ko" file. Should I rip that out of my existing ROM?
 

Forum statistics

Threads
943,135
Messages
6,917,452
Members
3,158,834
Latest member
Nikoczzzz