Checkout Chromium
Some development tasks may require working in the chromium repository, the
chromiumos repository, or both. If you only need to work in the chromiumos
repository, you can jump ahead to the ChromiumOS Developer
Guide
page.
This page details the steps to create the initial checkout of the chromium
repository, including configuring the checkout and providing authentication if
you are syncing from the internal repository.
Create a directory to host the Chromium checkout
$ mkdir chromium && cd chromium
All commands relevant to the Chromium checkout from here assume the present working directory is the directory you created above and have this prefix:
chromium$ <command>
Checkout the chromium repository
fetch is a binary provided by depot_tools. --nohooks tells fetch not to run
any post-fetch executions steps which are not necessary at this stage. This step
can take around 30 minutes depending on your connection speed.
chromium$ fetch --nohooks chromium
Checkout the chrome-internal repository
If you have access to the chrome-internal repository (e.g., Googlers and
other authorized partners) in order to build a ChromeOS-branded binary, follow
the steps below to configure the checkout and provide authentication.
Configure gclient args
gclient is the tool used to download code and resources from
the various repositories (e.g., the chromium Git repository) necessary to build ChromiumOS.
The .gclient configuration file provides variables which affect which
repositories are synced and how they are set up.
To configure your gclient checkout to include the chrome-internal repository,
edit your chromium/.gclient file to include the checkout_src_internal
variable. The cros_boards variable pulls down board-specific code. Finally,
the target_os variable pulls down ChromeOS-specific code.
solutions = [
{
"url": "https://chromium.googlesource.com/chromium/src.git",
"managed": False,
"name": "src",
"custom_deps": {},
"custom_vars": {
"checkout_src_internal": True,
"cros_boards": "eve:puff:scarlet",
},
},
]
target_os = ['chromeos']
Note that in this example we've specified the boards eve, puff, and
scarlet separated by colons. Whenever you get a new test device be sure to add
or set the board name here and re-sync.
Initial gclient sync
gclient sync downloads the external dependencies that chromium (public and
internal) need but don't host (e.g., external libraries like Abseil). These
external dependencies are hosted in third_party/.
The first gclient sync command you'll run uses the --nohooks flag; you
shouldn't need this flag for subsequent uses of gclient sync. You'll need to run
gclient sync again each time you pull down from the chromium main git branch
(because new dependencies will have been introduced). Read more about this
subsequent gclient sync usage in the (Development workflow with git page -
TODO(jhawkins)).
chromium$ gclient sync --nohooks
The initial sync of a checkout can take a significant amount of time (up to an hour).
Up next
Now that you have the code, the next step is to build the Chromium binary.