TP 2: Android module

Instructions

  • Subject tag: TP2
  • Deadline: 08/07/2018 23h42

Subject objectives

  • Be able to use Android build system.
  • Be able to write an Android makefile for a given project.

Subject

Add abootimg tool to AOSP source tree.

Note

For parts 1. to 3., you are allowed to bypass the review system.

Documentation:

1. Android sources setup

CRI Android mirror:
git@git.cri.epita.net:sand/aosp/
Git repository name:
module-manifest-<login>

Normally, you should have synced Android sources from CRI mirror, pointing to android-8.1.0_r33. However, on gerrit, you have your own manifest repository module-manifest.

On the side:

  1. Clone your Gerrit manifest repository.
  2. Fix your manifest so that:
  • Your work must be based on android-8.1.0_r33 revision in a dedicated branch abootimg.
  • aosp remote must be set to CRI mirror. Do not forget the review URL.

In your sync directory:

  1. Reinitialize repo.
  2. Sync sources.

2. Add abootimg project in AOSP sources

Git repository name:
abootimg-<login>

From now on, you can work locally in your sync directory. In your manifest:

  1. Add a sand remote correctly pointing to gerrit.
  2. Add abootimg project.

Hint

Be careful where you put abootimg project in the source tree ! It does matter (at least, for me) !

3. Write a dummy Android makefile

The objective is to translate the local Makefile into a very simple Android makefile.

Your work must be available in a branch called aosp, bases on master.

  1. Create a version.h header file where the version must be aosp.
  2. Write the Android makefile:
  1. You must respect the original makefile.
  2. abootimg binary must be built only for host.
  3. Find which tag(s) you should apply to this Android module.

Hint

Do not forget to test abootimg binary: read the README file. You need a boot image. With lunch, choose a device and generated the image.

Question 1

What are the build commands you need for your development and tests ?

4. Write an advanced Android makefile

In the last part, I asked you to generate manually the version header. Now, the Android makefile must generate it by itself.

  1. Remove the version.h from abootimg sources.
  2. Take a look to LOCAL_GENERATED_SOURCES macro. It will be your best friend.

Use Gerrit pull request system to submit your patches.