To simplify fetching sources and setting up the Yocto build environment we have decided to use the Google repo tool, which allows fetching sources from multiple location in a single command based on manifest files (xml).
Google repo is widely used within the Yocto community and we have simply adopted the “best practice” for Mender integrations.
The following is a one time installation of Google repo.
Create directory for repo
mkdir ${HOME}/bin
Fetch the repo
script
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ${HOME}/bin/repo
Set the executable bit
chmod a+x ${HOME}/bin/repo
You should also add the following to your .bashrc
or equivalent, for convenience.
PATH=${PATH}:~/bin
Troubleshooting
Git user configuration
The repo
tool is a wrapper for git
and it will print out an error if you have not setup your git
identity. You can do this by simply running:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
This will store the configuration globally ($HOME/.gitconfig
) and is only required to setup once.
missing python
The repo
tool depends on availability of python
on the system, e.g Ubuntu 18.04.2 LTS comes with python3 installed by default but not python; to install:
sudo apt install -y python
git color
It is also useful setting your git color preference, which avoids having git ask for your preference when running repo
for the first time:
git config --global color.ui false