Using a local linux machine
Info
This step is only relevant if you are not using the remote server but a local build environment (your own one or the one provided by inovex on SSDs).
For this training we provide a Dockerfile that installs the necessary tools and packages.
The Dockerfile can be found in the github repository for this training.
# Build the container docker build -t aosp . # Run it and change into the interactive environment with: docker run --rm -it --user=ubuntu aosp
Tip
You can also use podman instead of docker, just replace docker ... commands with podman ....
For the podman run command, you need to add an additional option --userns=keep-id. This assigns the local user's uid to the user inside the container, and allows that user to access /src/aosp from inside the container.
Setup git
In case you have not done so already, set up git with your personal information:
git config --global user.mail your_mailaddress@example.com git config --global user.name "Your Name"
Install repo
To download the Android source code, you must install the command repo first. It's a tool developed by Google to maintain the Android source tree.
export REPO=$(mktemp /tmp/repo.XXXXXXXXX) curl -o ${REPO} https://storage.googleapis.com/git-repo-downloads/repo gpg --recv-keys 8BB9AD793E8E6153AF0F9A4416530D5E920F5C65 curl -s https://storage.googleapis.com/git-repo-downloads/repo.asc | gpg --verify - ${REPO} && install -m 755 ${REPO} ~/bin/repo
This will install the repo command into your home directory in the folder ~/bin/`. You may also have to add this path to your ``PATH environment variable.
Info
We also already installed repo in the docker container if you don't want to install it in your system.