-------------Loading Android OS----------------
We have followed the instructions on the http://source.android.com/source/
website with steps:
initializing.html (We used gingerbread)
downloading.html
building.html
After seemingly successful building the android system from source
we've had some difficulty loading it in the emulator, it seems that
the 'emulator' command has not been placed in our path, as a debuging
step I tried:
`source build/envsetup.sh`
which output
including device/htc/passion/vendorsetup.sh
including device/samsung/crespo4g/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
but `which emulator` still returned nothing.
We then decided to try and build the sdk, and then use the sdk tools
that it creates (including emulator) which should presumably be able
to run the android operating system image we just built. We issued
`make sdk`.
After which we could find the SDK in:
WORKING_DIRECTORY/out/host/linux-x86/sdk/android-
sdk_eng.voorhees_linux-x86/
running ./tools/android from this directory brings up the android tool
- however if we try and create an AVD from this tool, no target is
available despite the fact that there appears to be a valid target
under the platforms sub-directory.
ls platforms/
android-2.3.7
In fact copying the android-2.3.7 folder into the platforms directory
of the android-sdk downloaded from http://developer.android.com/sdk/index.html
(ensuring that no other platforms exist in this directory)
does work! and we where able to use this image to create an AVD which
we could run in the emulator. If any help could be provided in how to
do this from the SDK we've built, or some clarity as to how else we
should be loading in the android system image that would be
appreciated.
---------Building Android Kernel---------------
As I'm sure you know the android source build environment does not
actually build a kernel from source, instead it includes a pre-built
kernel. Since we're attempting to perform modifications to the kernel
it is necessary for us to build it from source, and boot it with the
image created above in an android emulator.
In order to accomplish this goal we download the android kernel source
from:
https://android.googlesource.com/kernel/common.git
using the 3.0 branch and the 2.6.39 branch.
This ended up not working for the same reasons specified bellow, but
we thought that it might be because those kernel versions seem to be
newer than the kernel that shipped with gingerbread, So we also
tracked down a git repo containing the older branches (no longer
visible in the git repo above)
https://github.com/android/kernel_common.git
In particular we checked out the branch android-gldfish-2.6.29
We needed an appropriate .config for the kernel, we acquired one from
the android system built above by issuing the command
'adb pull /proc/config.gz'
After unziping and renaming the file to .config, we updated the config
to include any new kernel options with the command
export CROSS_COMPILER=WORKING_DIRECTORY/prebuilt/linux-x86/toolchain/
arm-eabi-4.3.1/bin/arm-eabi-
make ARCH=arm CROSS_COMPILER=$CCOMPILER oldconfig
and then built the kernel with
make ARCH=arm CROSS_COMPILER=$CCOMPILER -j8
It appears to have built correctly.
-----------Loading The newly compiled kernel into the Android
Emulator----
It appears that there may be a couple of ways to load in a custom
compiled kernel into the android emulator.
First we tried running the emulator command with the avd created above
with -kernel pointing to the just built kernel. The emulator crashes
on boot.
Then we tried replacing the WORKING_DIRECTORY/prebuilt/android-arm/
kernel/kernel-qemu-armv7 with the kernel we just built, rerunning make/
make sdk and then using the files listed under platforms as described
under the
'Loading Android OS' heading. Unfortunately this also did not work.
---------Questions--------
How should we be loading the Android Image above into the emulator?
Does the method we derived work properly?
How can we get a custom compiled kernel to run in one of these images?
source build/envsetup/sh
lunch full-eng
make
emulator&
As for building custom emulator kernels, you'll need to work from
https://android.googlesource.com/kernel/goldfish as the common android
kernel code doesn't include emulator support. Check
external/qemu/docs/ANDROID-KERNEL.txt for more info.
JBQ
> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.
Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.
It's very possible however that you'll need to go back in the history
of the kernel source tree to the point that was used to build the
gingerbread kernel, as it's possible that the ICS kernel (which is the
one you're building) might not be compatible with gingerbread.
JBQ