[How-To] compile the Nexus S kernel from source

dirtmike

New member
Jan 13, 2011
3
0
0
Visit site
sorry guys. Google has changed the entire procedure, and while I can hack my way through it and make it work, I'm waiting on them to update their page with the new requirements and method.

In the meantime, anyone interested should subscribe to the android-kernel mailing list and the android-building mailing list to take part in the discussion.

It's likely going to be as easy as installing Sun-Java-6 and using the same methods --
pull config from /proc
make menuconfig
make

but I can;t say for sure what the recommended methods will be until we get them :)

The config file does not exist in proc. See https://groups.google.com/d/topic/android-building/fRjYHrpg8zM/discussion to how to build. My problem is I get a access denied error when it tries to use the toolchain.
 

dirtmike

New member
Jan 13, 2011
3
0
0
Visit site
Just in case it helps - apparently they have added the requirement of building on a 64 bit environ and Sun java 6. I created my set up on a 64 bit 10.04 which
apparently is Google'w own build environment.

Thanks for all the help.

Gingerbread requires a 64 bit environment and sun-java 6 as you noted above.

So in short

2.2 = 32 bit and sun java 5
2.3 = 64 bit and sun java 6

It's unreal how out of date their documentation is. Talking about costing a lot of people time and/or money.
 

muasif80

New member
Jan 19, 2011
2
0
0
Visit site
This is something I am stuck for last 10 days. That is the source not compiling for gingerbread. This is all on 64 bit Ubuntu with Java 6.
 

muasif80

New member
Jan 19, 2011
2
0
0
Visit site
I have at last successfully build gingerbread. I had followed the
instructions at source.android.com and I was never able to compile the
source.

The reason was that I had the master branch as I did not mention -b
gingerbread when I initialized repo using repo init.

Then today I came across the post at
Gingerbread is baked - Android Building | Google Groups
by Jean-Baptiste M. "JBQ" Queru

It gives the details about how you can switch from on branch to
another. After I followed these instructions to switch to gingerbread
then my make command worked like charm.

Also you should follow find: `frameworks/base/frameworks/base/docs': No such file or directory - Android Building | Google Groups
before running make command.

Now the next step is using the result. Which is still something I
don't know. So if someone can tell how to use the result of the
compile then I will be very thankful to him.

I believe I have to use system.img in some way. Also note that I want
to use it in emulator I don't have an android phone with me.

Regards,
Asif
 

virgilm

New member
Jan 28, 2011
1
0
0
Visit site
Thanks for all the detailed tutorials, google's docs are a complete mess when it comes to kernel recompilation!

Everything went well, however, my WiFi does not work anymore, even if I restore the original kernel, and do a factory restore... any ideas?

Thanks in advance.
 

Jerry Hildenbrand

Space Cowboy
Staff member
Oct 11, 2009
5,569
2,797
113
Visit site
Thanks for all the detailed tutorials, google's docs are a complete mess when it comes to kernel recompilation!

Everything went well, however, my WiFi does not work anymore, even if I restore the original kernel, and do a factory restore... any ideas?

Thanks in advance.

You need to make sure the kernel modules you're using match the kernel you're running. Open the ROM file you're using, and copy everything from /system/modules/ back over to your phone.

This should do it.
 

deckardd

New member
Jan 31, 2011
1
0
0
Visit site
Error building

So what do I do about "make: *** No rule to make target `run-java-tool', needed by `out/target/common/docs/doc-comment-check-timestamp'. Stop."

The tool appears to be there:

which run-java-rool
which: no run-java-rool in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4:/usr/games/bin:/home/jason/bin)
 

crowxp

New member
Jan 28, 2011
1
0
0
Visit site
Hi all,
Thanks to gbhil's post, it helps me to build Nexus S kernel successfully. But I have a problem after apply the new kernel(without any modification).

If I unplug the usb cable, press the power button(made the phone went into suspend mode, the screen will turn off), and press the power button again to made screen turn on(resume). After I did it three/four times, the resume process will delay significantly about 2 seconds(screen keeps off) which bothers me a lot. Did anyone meet the same problem?

I've tried the compile optimize option -o2, it went worse. What options should I use when I want to compile a kernel? Just make -j4 ARCH=arm CROSS_COMPILE=arm-eabi- ?
Thanks.
 

sinatosk

New member
Mar 8, 2011
1
0
0
Visit site
after compiling the kernel based what is said here...

at the end I used the command

fastboot boot boot.img

and it sits there at the google logo, padlock unlocked bewlow with a message overlapping it saying

FASTBOOT STATUS - OKAY

and thats it... nothing happens after that.

If I use

fastboot boot ./kernel ./initramfs.cpio.gz

same thing happens except the message "FASTBOOT STATUS - OKAY" is not showing...

any suggestions?

the scripts I use are these

build_kernel
#!/bin/sh

export ARCH=arm
export CROSS_COMPILE=/home/sinatosk/android_manifest/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-

cd samsung/

make clean
make -j4

cp arch/arm/boot/zImage ./kernel

cd ..

exit 0

build_initramfs
#!/bin/sh

cd herring_initramfs/
find | fakeroot cpio -o -H newc | gzip -9 > ../initramfs.cpio.gz
cd ..

build_boot
#!/bin/sh

./mkbootimg \
--kernel ./kernel \
--ramdisk ./initramfs.cpio.gz \
--base 0x30000000 \
--pagesize 4096 \
-o ./boot.img

thanks
 

ursa#AC

New member
Feb 13, 2011
1
0
0
Visit site
Hi, I have the same problem. Did you find any solution?

Thanks.

after compiling the kernel based what is said here...

at the end I used the command



and it sits there at the google logo, padlock unlocked bewlow with a message overlapping it saying



and thats it... nothing happens after that.

If I use



same thing happens except the message "FASTBOOT STATUS - OKAY" is not showing...

any suggestions?

the scripts I use are these

build_kernel


build_initramfs


build_boot


thanks
 

arun_satya3

New member
Jun 1, 2011
2
0
0
Visit site
attachment disabled

Hi,
I am building kernel for samsung nexus S and am following the instructions mentioned here.
I am new to this forum and the attachment is disabled. Is it possible to find the corresponding script and other file else where.

Thanks,
Arun