More discussion about this can be found on
https://groups.google.com/forum/?fromgroups#!forum/renesas-emev-osp
Follow the generic steps described in:
http://source.android.com/source/downloading.html
A version of the AOSP manifest customized for our Renesas EMEV2 project can be found at:
https://github.com/Renesas-EMEV2/Renesas-manifest (branch emev-4.1)
so, the "repo init" step should be made using this manifest:
repo init -u git://github.com/Renesas-EMEV2/Renesas-manifest.git -b emev-4.1
to update the entire set projects to the Jingerbread (4.1) version, plus our customization.
In .repo/manifests/deafult.xml, our ROSP custom projects are linked to the corresponding repositories on our github organization (i.e. "Renesas-EMEV2"), while the rest are pulled off the standard google source repositories, as usual in AOSP.
Each custom project has a "emev-4.1" branch, to track ROSP changes for JB (the "MyPad" branch was used to track changes for GB instead).
NOTE - Consider waiting a few hours to downloading the full AOSP source, even on a fast connection, as the complete package is several Gigas.
This is the section hardest to describe in general, as it depends on the host system the build environment is based upon. Luckily, you need to fix this up only once (until at least you decide to migrate the project to a new host):
You need at least to install the AOSP prerequisite packages, as said in:
http://source.android.com/source/initializing.html
but sometimes that's not enough. For example, a basic Ubuntu setup might be missing the 'git' tool, which then needs to be installed with:
sudo apt-get install git
We need JDK version 6 to build JB. The Open-JDK is installed with:
sudo apt-get install openjdk-6-jdk
To develop other versions of Android, download and install the corresponding version of the Java JDK:
Java 7: for Lollipop Java 6: for Gingerbread through KitKat Java 5: for Cupcake through Froyo
If you have both Open-JDK and Oracle-JDK installed, or multiple versions, you can choose which one to use executing:
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config jar
sudo update-alternatives --config javah
sudo update-alternatives --config javadoc
and select the Open-JDK version for each of these packages.
Note - A build made using the Oracle-JDK failed to boot...
See also:
https://help.ubuntu.com/community/Java
Also, for an Ubuntu 12.04 host, even installing all the suggested packages, I got a couple of errors during make, so that I had to install these ones as well:
sudo apt-get install lib32ncurses5-dev
sudo apt-get install lib32z1-dev
I found these searching on Google for the error codes + "Ubuntu 12", so let me suggest to try this approach, if you encouter any error. The discussion group https://groups.google.com/forum/?fromgroups#!forum/renesas-emev-osp is always open for questions, of course.
I'm not sure what the aim of these steps is, or if they're actually required, but I did them following a tutorial I found about Android porting... (http://marakana.com/static/courseware/android/Remixing_Android/index.html):
SIGNER="/C=IT/ST=RM/L=Rome/O=ffxx68/OU=Android/CN=Android Platform Signer/[email protected]"
cd $AOSP
rm build/target/product/security/*.p*
echo | development/tools/make_key build/target/product/security/platform "$SIGNER"
echo | development/tools/make_key build/target/product/security/shared "$SIGNER"
echo | development/tools/make_key build/target/product/security/media "$SIGNER"
echo | development/tools/make_key build/target/product/security/testkey "$SIGNER"
This is the command to verify that all went fine:
ls -1 build/target/product/security/*.p*
openssl x509 -noout -subject -issuer -in build/target/product/security/platform.x509.pem
I guess these keys are something required to pass the official Android Google certification (though I can't tell for sure).
Altough it is definitely off topic to discuss here how to use git, or GitHub in general (or which you could find several better docs online), if you change anything, to push it back onto our GitHub repository you would do:
git add <whatever file you changed>
git commit -m "Leave your commit comments here"
git push -u github emev-4.1
This would require you to have an account registered on GitHub, where you may have forked the project to.
Find help oh GitHub, for admin and access details. E.g.
http://help.github.com/send-pull-requests/
A "Renesas-EMEV2" Organization:
https://github.com/organizations/Renesas-EMEV2
has been setup on GitHub, in order to allow collaborative development. Members taking part to this organization can "push" or "pull" commits on the various repositories.
Anyone interested in participating can use our ROSP Discussion Group on Google, to ask for membership:
https://groups.google.com/forum/#!forum/renesas-emev-osp
Use the same group if you think anything in the whole process may be improved. Suggestions are always welcome!
Once you have your code, you would build Android with:
cd $AOSP
. build/envsetup.sh
including device/asus/grouper/vendorsetup.sh
including device/generic/armv7-a-neon/vendorsetup.sh
...
including device/renesas/emev/vendorsetup.sh
...
lunch renesas_emev-eng
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.1.1
TARGET_PRODUCT=renesas_emev
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-2.6.38-15-generic-x86_64-with-Ubuntu-11.04-natty
HOST_BUILD_TYPE=release
BUILD_ID=JRO03L
OUT_DIR=out
============================================
time make -j2 showcommands 2>&1 | tee make.log
...
(took about 4 hours to make, on my 2x2.4GHz, 4 Gb RAM Ubuntu)
...
Installed file list: out/target/product/emev/installed-files.txt
Note - this error is given at the end (need a fix in partition size):
error: do_inode_allocate_extents: Failed to allocate 2006 blocks
but it doesn't prevent a succesful build.
Kernel source code is stored at
https://github.com/Renesas-EMEV2/Kernel
and the emev-4.1 branch should be used. Kernel image should be built before building SGX modules and final packaging steps.
See also the corrsponding documentation in
https://github.com/Renesas-EMEV2/Documentation/Kernel.md
The binaries and libraries managing:
- 3D and graphics accelerator (SGX)
- the video decoder (OMX)
are released only as pre-compiled libraries, source code being proprietary.
These are stored in the repository under
$AOSP/device/renesas/emev/sgx
$AOSP/device/renesas/emev/omf
and the build take care of deploying them to the target location.
Although the SGX driver kernel modules
emxxlfb.ko
pvrsrvkm.ko
are provided in the repository as pre-compiled binaries, source code is available and they could be recompiled too.
See how in
device/renesas/emev/sgx/SGX1.8_EMEV_KM/eurasia_km/compile.txt, or build.sh
(maybe, one day this step would be integrated within the main Android build).
The device/renesas/emev/um directory includes the "user modules" (a set of Android libraries) whose source code is proprietary and can't be shared publicly.
The kernel driver for the BCM4329 Wifi device (hardwired on the "Livall" tablet board and interfaced through the SDIO bus), is provided as a pre-compiled binary only:
device/emev/wifi/dhd.ko
Source code for this is proprietary to Livall and needs recompiling only in case of major changes to the kernel.
Other tablet manufacturers may provide different solutions, like for example a USB WiFi dongle, which may require a different kernel module.
I found this tutorial very useful to com, about the integration of a WiFi driver in Android:
http://blog.linuxconsulting.ro/2010/04/porting-wifi-drivers-to-android.html
In order to wrap up the final build and prepare it for delivery to the device, the script
$AOSP/device/renesas/emev/pack.sh <destination>
collects the complete Android file system and kernel image and put them into destination dir.
A script to prepare the SD card to be used to finally "flash" the newly built firmware is described in:
https://github.com/Renesas-EMEV2/Documentation/blob/emev-4.1/Bootloader.md
Check out "Preparing an SD card for device firmware update".
The (free) AOSP source is missing the most common Google Apps, like Play, GMail, Maps, etc. These are covered by license fees and so are installed on final devices only by manufacturers paying those fees, usually.
Nonetheless, packages can be found on the net. E.g.:
http://wiki.rootzwiki.com/Google_Apps
If you have downloaded them (but it isn't mandatory for the script to succeed!), the pack.sh script assumes that you have put the packages into a directory named "GoogleApps", under $AOSP/device/renesas/emev.