You must have sudo setup and allow for the user account used to perform the build to be able to execute applications as root (via sudo). DO NOT directly use the root account to actually perform the build, it must be done on a normal user account with the ability to execute binaries via sudo.
You will need to install several packages on your build system to build ChromiumOS. On Ubuntu, this can all be done by running the following commands.
sudo apt get update sudo apt get upgrade sudo apt install -y git gitk git-gui curl lvm2 thin-provisioning-tools python-pkg-resources python3-virtualenv python3-oauth2client nano screen sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils
Ubuntu or your Linux distribution of choice will also automatically download and install any dependencies that the applications above will need.
You will need to add yourself to the KVM group to allow you to run virtual machines in order to test your distribution once built. This can be done by running the following command.
sudo usermod -a -G kvm $USER
Now you will need to install the ChromiumOS Depot Tools Package which includes repo, cros_sdk and several other tool that are used to build ChromiumOS from source. Run the following commands
cd ~ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
Next you will need to modify a script that is automatically ran when you open a new terminal. Run the following commands to append your .bashrc file.
echo 'export PATH="$HOME/depot_tools:$PATH"' >> ~/.bashrc echo 'umask 022' >> ~/.bashrc
Reboot your machine for the changes to take effect.
If you have never used git on the build machine, you will need to perform a one time configuration of git to set your name and email address. In most cases you will not be pushing code upstream, many git functions will throw errors if these values are not set. You can set your name an email address by running the commands below.
git config --global user.name "Your Name" git config --global user.email "Your Email Address"