need help for compiling hammerhead and installing on nexus 5

1,054 views
Skip to first unread message

deng zhou

unread,
Feb 13, 2014, 12:36:39 AM2/13/14
to android-...@googlegroups.com
Hi guys,

I am compiling my own kernel for nexus 5.


with check both on the device and with command 
bzgrep -a 'Linux version' vmlinux.bz2
I find kernel version is: 3.4.0-gadb2201

git clone https://android.googlesource.com/kernel/msm.git
$export PATH=$PATH:~/nexus5/arm-eabi-4.7/bin
$ export ARCH=arm
$
export SUBARCH=arm
$
export CROSS_COMPILE=arm-eabi-
$ cd msm
$ git checkout
3.4.0-gadb2201
$ make hammerhead_defconfig
$make -j4
after compiling, I got zImage from the msm/arch/arm/boot/
Then I try to install it on my nexus 5. I have tried several ways, 
1) replace the zImage in AnyKernel.
2) make boot.img with AOSP project
3) unpackbootimg to get ramdisk and parameters from factory image, then mkbootimg to myboot.img and flash to devices

all the methods work well until the last step.

after I flash the boot.img to device. it fails to turn on or reboot. I have to enter the fast mode again and flash the factory image to recover it.

BTW, I have successfully tested kernel code with goldfish on the emulator, at that time I encounter the wrong defconfig at the beginning.
So I also tried the msm8974_defconfig as well but no success.

I have tested my flash method with downloaded boot.img and factory image, both no problem.

when testing, my zImage is just compiled from original code, so I guess there is nothing wrong with code, just configuration and parameter problems.

Can anyone help me to figure out which step I am wrong? 

I really need help for this, I am going to do some experiment on this environment. 
thanks very much.


Benoit Fouet

unread,
Feb 14, 2014, 4:47:54 AM2/14/14
to deng zhou, android-...@googlegroups.com
Hi,

On Wed, Feb 12, 2014 at 09:36:39PM -0800, deng zhou wrote:
> Hi guys,
>
> I am compiling my own kernel for nexus 5.
>
> I followed the google's guide
> http://source.android.com/source/building-kernels.html
> and a very good tutorial of kernel build:
> http://pete.akeo.ie/2013/10/compiling-and-running-your-own-android.html
>
> with check both on the device and with command
>
> bzgrep -a 'Linux version' vmlinux.bz2
>
> I find kernel version is: 3.4.0-gadb2201
>
> git clone https://android.googlesource.com/kernel/msm.git
>
> $export PATH=$PATH:~/nexus5/arm-eabi-4.7/bin
>
> $ export ARCH=arm
> $ export SUBARCH=arm
> $ export CROSS_COMPILE=arm-eabi-
> $ cd msm
> $ git checkout 3.4.0-gadb2201
> $ make hammerhead_defconfig
>
> $make -j4
>

The thing that is missing is that the Hammerhead kernel is using device
tree blob (dtb). You should be building that instead of just the zImage.
Try to make zImage-dtb instead, and use it instead of zImage.
(See device/lge/hammerhead/device.mk)

HTH,
--
Ben
Reply all
Reply to author
Forward
0 new messages