/tegra-android-builder

Sensics-customized docker image for building Android for Tegra

Primary LanguageShellMIT LicenseMIT

Sensics Android-on-Tegra Building Docker Image

This is a docker image and auxiliary files to ease building of Android for Tegra, without requiring that you run an old or very old linux distro (and permitting useful reproducibility of build environments).

Inspired by, and portions of this are based on, the AOSP docker build image from https://github.com/kylemanna/docker-aosp.

Quick start

  1. Make sure you have docker installed - use the official instructions to install the latest docker-ce. The specifics of this step vary by your Linux distro. You'll probably also want to add yourself to the docker group - I haven't tested running the launch script with sudo. (Not recommended to use Windows/Mac/boot-to-docker for this - VM file sharing would really slow the build and/or completely break it due to loss of case-sensitivity.)
  2. Create a root for all your android-source-building stuff - the default for this is /opt/android and it's recommended to stick with it unless you have a good reason. Make sure it's owned by your current user and group, or by a group that you're a part of (if it's a shared machine). (If yours is different, you'll need to configure things...)
  3. Run make in this directory to create the docker image.
  4. Run make run or ./android.sh in this directory to launch the docker image!

Makefile targets

  • all (default target)
    • Updates .gitignore then builds the docker image unconditionally (target docker)
  • docker
    • Builds the docker image unconditionally
  • docker-stamp
    • Only builds the docker image if we think it might have changed, due to changes in this directory.
  • clean
    • Removes generated files from this directory. (Does not affect the docker image itself)
  • run
    • Conditionally rebuilds the docker image (that is, depends on docker-stamp), then runs ./android.sh to launch the docker image with default options.
  • .gitignore
    • (Re-)Generates .gitignore based on the Makefile's knowledge of which files are generated.

Launch script

./android.sh

Will start up the Docker image - by default mapping the following directories:

  • /opt/android/tegra-android to /opt/tegra-android inside the image
  • /opt/android/ccache to /opt/ccache inside the image
  • /opt/android/tnspec-workspace to /opt/tnspec-workspace inside the image (used for storing per-device spec/config files by flashing scripts including tnspec.py)

Look at the top of the script to see easy overrides (like changing the source tree, etc).

If you don't pass any arguments, a bash shell will be started for you interactively (as the unprivileged android user created inside the docker image).

Otherwise, the arguments to this shell script will be run as the unprivileged android user in the image.

Feel free to make symlinks to this file in, e.g., your /opt/android directory.

Note that oh-my-git will be loaded in the shell if you do not pass any arguments (that is, you open an interactive session.) For best results, you may need to visit that utility's page and follow the font install instructions.

Configuration

Can place a file named gid in either this directory, or in a directory where you symlink the android.sh file to and run from, if you'd like to set the group ID (numeric) explicitly to something other than the current user's "main" group.

Other configuration is available, primarily by setting environment variables before running ./android.sh

License

Like the kylemanna/docker-aosp repo it is partially derived from, the main part of this repo is MIT-licensed.

The submodule, from https://github.com/arialdomartini/oh-my-git is also MIT licensed.