[TOC]
The Chromium OS Developer Guide and README walk through the steps needed to fetch and build Chromium OS source. These steps can be followed to retrieve and build EC source as well. On the other hand, if your sole interest is building an EC image, the general developer guide contains some extra unneeded steps.
Here is a set of steps to set up a development environment to build EC images inside the Chromium OS chroot:
-
Create a folder for your chroot:
mkdir chromiumos; cd chromiumos
-
Initialize the checkout in the current directory:
repo init -u https://chromium.googlesource.com/chromiumos/manifest
-
Update the working tree to the latest version:
repo sync -j <number of cores on your workstatsion>
-
Enter the chroot (type your password for
sudo
if prompted):cros_sdk
-
Select a target board
export BOARD=<target board>
See previous section for recommendations.
-
Set up your board:
setup_board --board=${BOARD}
-
Build EC:
build_packages --board=${BOARD} chromeos-ec
-
Now, EC images for any board can be built with:
cd ~/chromiumos/src/platform/ec; make BOARD=${BOARD} -j