This page explains the prerequisites and steps to set up your environment, download source code, and build Celadon from source.
- A 64-bit development workstation running the Ubuntu* 16.04 (Xenial Xerus) operating system.
- At least 150GB of free disk space on your workstation to checkout the source code and to store the build artifacts.
Although Android* is typically built with a GNU/Linux* or macOS* operating system, we recommend you build Celadon images on Ubuntu* 16.04. For setup instructions using other operating systems, refer to the Establishing a Build Environment section on the AOSP website.
Celadon and Android source code consist of multiple Git* repositories. The repo tool makes it easier to work with those repositories.
Create a local bin/ directory, download the repo tool to that directory, and make the binary executable with the following commands:
$ mkdir -p ~/bin $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ export PATH=~/bin:$PATH
Install the following required packages on your 64-bit Ubuntu 16.04 LTS development workstation prior to starting the build:
$ sudo apt-get update $ sudo apt-get install openjdk-8-jdk git ccache automake \ lzop bison gperf build-essential zip curl \ zlib1g-dev g++-multilib python-networkx \ libxml2-utils bzip2 libbz2-dev libbz2-1.0 \ libghc-bzlib-dev squashfs-tools pngcrush \ schedtool dpkg-dev liblz4-tool make optipng maven \ libssl-dev bc bsdmainutils gettext python-mako \ libelf-dev sbsigntool dosfstools mtools efitools \ python-pystache git-lfs python3
Celadon as a Service (CaaS) and Celadon in Container (CIC) require Docker to build the images.
Install the following packages before performing the CaaS or CIC build:
$ sudo apt-get install apt-transport-https ca-certificates curl
Execute the following commands to add the Docker’s official GPG key, set up the repository, and install the Docker Engine - Community from the repository:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" $ sudo apt-get update $ sudo apt-get install -y docker-ce docker-ce-cli containerd.io
You may use Docker as a non-root user by adding your user ID to the docker group. For more information, refer to the Get Docker Engine - Community for Ubuntu installation guide.
$ sudo usermod -aG docker $USER
Enter the following commands to create an empty directory to hold the Celadon source files and serve as the working directory, and to bring down the latest version of repo tool, including its most recent fixes.
The URL specifies the manifest that refers to various repositories used by Celadon, which are placed within the working directory. For now, a .repo folder is created to store the manifest and the metadata of the source repositories.
$ mkdir celadon $ cd celadon $ repo init -u https://github.com/projectceladon/manifest.git
$ repo init -u https://github.com/projectceladon/manifest -b celadon/p/mr0/master -m default.xml
Enter the following command to pull down the Celadon Android source tree to your working directory. The repo sync operation might take time depending on your Internet download speed. Refer to the Downloading the Source section of the AOSP website for tips to download the source behind a proxy.
$ repo sync
Optionally, delete existing output of any previous build with the following command in the top-most Celadon source directory:
$ make clobber
Enter the following command to initialize the build variables with the envsetup.sh script:
$ source build/envsetup.sh
Specify your Celadon lunch target using the lunch command. You can run lunch with no arguments to choose different build variants, and select a lunch target from a list of available options. For example, the following command configures the build system for Android 9 Pie with the traditional tablet UI:
$ lunch celadon-userdebug
The following command selects celadon_ivi-userdebug as the lunch target for building the Android 10 Pre-Production Release image with IVI UI:
$ lunch celadon_ivi-userdebug
Alternatively, you can Run Project Celadon on Intel® architectures; use either caas-userdebug or cic-userdebug lunch targets as shown below:
$ lunch caas-userdebug
$ lunch cic-userdebug
Build the Celadon installer files with the command shown below.
$ make SPARSE_IMG=true flashfiles -j $(nproc)
The -j $(nproc) argument instructs the builder to compile the source code with parallel tasks. The generated kernelflinger executables .ZIP file (out/target/product/celadon/celadon.flashfiles.eng.$USER.zip) is available after the build. You can follow Run Celadon on Intel® NUC of this guide to flash the installer image to a removable USB drive and install Celadon on a Intel NUC.
For the CIC build, the generated image is packaged at the following location: out/target/product/celadon/cic-$USER.tar.gz