booting up the emulator with custom kernel build

226 views
Skip to first unread message

rk

unread,
Aug 12, 2009, 8:48:42 AM8/12/09
to Android Linux Kernel Development
HI,

I am trying to build the custom kernel from the kernel source which is
inside the Android source dir. To build the kernel I just followed the
steps given in the following thread

http://groups.google.com/group/android-platform/browse_thread/thread/e24eb299383e9103/34e8c50b2b50efa3?q=How+to+build+kernel+for+emulator+%2B+android#34e8c50b2b50efa3

In that they mentioned that we can start the emulator with the
following command.


out/host/linux-x86/bin/emulator -kernel kernel/arch/arm/boot/zImage -
system out/target/product/generic/ &

But when I try to boot upi with that I got few errors. at the end I
end up with the following command to start the ematulor with the
prebuilt kernel,

$ ~/android_cupcake_old/out/host/linux-x86/bin/emulator -ramdisk
ramdisk.img -sysdir . -system system.img -initdata userdata.img -data
userdata.image -kernel ~/android_cupcake_old/prebuilt/android-arm/
kernel/kernel-qemu

So now the above command launching the emulator fine with the pre-
built the kernel.

So now I changed the command to launch the emulator with the new built
kernel. Here is the command.

$ ~/android_cupcake_old/out/host/linux-x86/bin/emulator -ramdisk
ramdisk.img -sysdir . -system system.img -initdata userdata.img -data
userdata.image -kernel ~/android_cupcake_old/kernel/arch/arm/boot/
zImage


So here I am not able to see anything. The terminal looks like it's
booting the emulator. But there is nothing coming up. and also there
is no messages.

Please give me some pointers and suggestions to make my own build of
the kernel and launch the emulator using the custom kernel not with
the prebuilt.

Thanks
Raj







Juan Lang

unread,
Aug 12, 2009, 4:05:18 PM8/12/09
to android...@googlegroups.com
The kernel in the android source dir isn't of much use. You'll want
to check out the kernel tree separately. I did the following:

$ git clone git://android.git.kernel.org/kernel/common.git
$ git checkout -t origin/android-goldfish-2.6.27 -b goldfish
$ cd common # the kernel source is now in here
$ make goldfish_defconfig

Then build it and run it.

If that doesn't work for you, you may need to get the config from a
running kernel, rather than using the goldfish_defconfig. Use
something like 'adp pull /proc/config.gz', decompress config.gz, and
rename it .config in the kernel source directory. Then build and run
it.

Good luck,
--Juan

rk

unread,
Aug 13, 2009, 12:14:42 AM8/13/09
to Android Linux Kernel Development
hi Juan Lang,

Thanks for the reply. I will just try this and let you know. and also
i just want to know one thing. I am behind the proxy so I am not able
to sync with the repo. is there any possible way to get the goldfish
kernel through http.


thanks
raj


On Aug 13, 1:05 am, Juan Lang <juan.l...@gmail.com> wrote:
> The kernel in the android source dir isn't of much use.  You'll want
> to check out the kernel tree separately.  I did the following:
>
> $ git clone git://android.git.kernel.org/kernel/common.git
> $ git checkout -t origin/android-goldfish-2.6.27 -b goldfish
> $ cd common # the kernel source is now in here
> $ make goldfish_defconfig
>
> Then build it and run it.
>
> If that doesn't work for you, you may need to get the config from a
> running kernel, rather than using the goldfish_defconfig.  Use
> something like 'adp pull /proc/config.gz', decompress config.gz, and
> rename it .config in the kernel source directory.  Then build and run
> it.
>
> Good luck,
> --Juan
>
>
>
> On Wed, Aug 12, 2009 at 5:48 AM, rk<raj.10...@gmail.com> wrote:
>
> > HI,
>
> > I am trying to build the custom kernel from the kernel source which is
> > inside the Android source dir. To build the kernel I just followed the
> > steps given in the following thread
>
> >http://groups.google.com/group/android-platform/browse_thread/thread/...
> > Raj- Hide quoted text -
>
> - Show quoted text -

Juan Lang

unread,
Aug 13, 2009, 2:09:31 PM8/13/09
to android...@googlegroups.com
I don't know any way to get it via http. I'm also normally behind a
proxy, and I temporarily connected to a public wireless access point
to get the goldfish kernel.
--Juan

rk

unread,
Aug 18, 2009, 2:03:38 AM8/18/09
to Android Linux Kernel Development
Juan,

THanks for your reply. I will try to get it and let you know the
status.

thanks
Rk
> > raj- Hide quoted text -

rk

unread,
Aug 19, 2009, 10:10:04 AM8/19/09
to Android Linux Kernel Development
Juan,

AS you said I downloaded the common kernel to a directory.
After this when I say
$ git checkout -t origin/android-goldfish-2.6.27 -b goldfish
fatal: Not a git repository


This above error I am getting, So where I went wrong.

Note : I clone that into a separate dir which is outside the mydroid
directory.


thanks
rk

rk

unread,
Aug 19, 2009, 10:43:00 AM8/19/09
to Android Linux Kernel Development
Juan,

AS you said I downloaded the common kernel to a directory.

After this when I say
$ git checkout -t origin/android-goldfish-2.6.27 -b goldfish
fatal: Not a git repository


This above error I am getting, So where I went wrong.

Note : I clone that into a separate dir which is outside the mydroid
directory.


thanks
rk


On Aug 18, 11:03 am, rk <raj.10...@gmail.com> wrote:

rk

unread,
Aug 19, 2009, 10:44:16 AM8/19/09
to Android Linux Kernel Development
Hi,

That problem I fixed,

I came here with new problem.

android@android-desktop:~/goldfish/common$ make goldfish_defconfig
#
# configuration written to .config
#
android@android-desktop:~/goldfish/common$ make
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CC kernel/bounds.s
cc1: error: unrecognized command line option "-mlittle-endian"
cc1: error: unrecognized command line option "-mapcs"
cc1: error: unrecognized command line option "-mno-sched-prolog"
cc1: error: unrecognized command line option "-mabi=aapcs-linux"
cc1: error: unrecognized command line option "-mno-thumb-interwork"
kernel/bounds.c:1: error: bad value (armv4t) for -march= switch
kernel/bounds.c:1: error: bad value (arm9tdmi) for -mtune= switch
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
android@android-desktop:~/goldfish/common$


The above error I am getting where I am doing wrong? Can you please
correct me?

rk

unread,
Aug 20, 2009, 6:46:33 AM8/20/09
to Android Linux Kernel Development
Hi Guys,

I got the problem solved. The actual problem is the kernel is not
properly downloaded. So I downloaded again and build that.


mkdir ~/android-kernel
cd ~/android-kernel


> >> git clone git://android.git.kernel.org/kernel/common kernel-common
> >> cd kernel-common
> >> git branch goldfish origin/android-goldfish-2.6.27
> >> git checkout goldfish


make goldfish_defconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

Thanks
Rk

Harish

unread,
Aug 20, 2009, 6:20:12 AM8/20/09
to Android Linux Kernel Development
hi,
Use $make ARCH=arm CROSS_COMPILE=arm-eabi-
should solve the compilation issue

Regards
harish

On Aug 19, 7:44 pm, rk <raj.10...@gmail.com> wrote:
> > > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages