This workflow allows you to quickly build/deploy Chromium for any Chromium OS device, without a Chromium OS checkout, and without a Chromium OS chroot.
At its core is the
First off make sure all preconditions are met:
Secondly, think about whether you need access to Google APIs from the executable you are building. If the answer is yes, you will need to have your keys (see http://www.chromium.org/developers/how-tos/api-keys) either in your include.gypi, or in a file in your home directory called ".googleapikeys".
Run this from within your Chromium checkout (outside the chroot):
NOTE: When prompted for a project ID, enter 134157665460 as your project ID (this is the Chrome OS project ID).
Replace <board> with a Chromium OS board name
The necessary environment variables needed to build Chrome (i.e.,
If you are making changes to Chromium OS and have a Chromium OS build inside a chroot that you want to build against, run
cros chrome-sdk --board=<board> --chroot=/path/to/chroot
gclient runhooks # Or 'git crup' for the submodule workflow.
Congratulations, you've now built Chromium for Chromium OS!
Once you've built Chromium the first time, you can build incrementally just
Tip: The default extensions will be installed by the test image you use below.
Before you can deploy your build of Chromium to the device, it needs to have a test image loaded on it.
Easiest way to get test image is "Image Search" link on http://chromeos-images/
You can get a Chromium OS test image by going to https://storage.cloud.google.com/chromeos-image-archive/<board>-release/<version>/chromiumos_test_image.tar.xz, where <board> is the board you're working on and <version> is the version of the Chromium SDK that is shown on the SDK prompt (i.e., '
If you don't have a Chromium OS checkout yet, follow these instructions (where
You will need a 4GB USB stick (you can get one at the ChromeStop where you picked up your Chromebook). Once you download and unpack the image, run the
Follow the device-specific instructions to put your device into dev mode and enable booting from USB.
Now that you are in dev mode and have enabled booting from USB, plug the USB stick into the machine and reboot. At the dev-mode warning screen, press Ctrl-U to boot from the usb. Once you've booted from the USB, login as a guest user and press Ctrl-Alt-T to get a terminal and run
IMPORTANT NOTE: Installing Chromium OS onto your hard disk will WIPE YOUR HARD DISK CLEAN.
To do this you will need a USB-to-ethernet dongle (you can find these at the techstop).
To deploy the build to a device, you can either rsync (install) the artifacts onto the target device's rootfs, or directly mount your host build directory from the target device using sshfs. Using sshfs provides for slightly faster incremental cycle time, as no files need to be transferred, but requires the device to be able to connect to the host (not required for rsync), and a consistent network connection.
Just type deploy_chrome from with your chrome-sdk shell. It will use rsync to incrementally deploy to the device.
Specify the build output directory to deploy from using
Tip: Specify the
On the target machine, open up a port for the gdb server to listen on, and attach the gdb server to the running chrome process.
On your host machine (inside the chrome-sdk shell), run gdb and start the Python interpreter:
Note: These instructions are for targeting an x86_64 device. For now, to target an ARM device, you need to run the cross-compiled gdb from within a chroot.
Then from within the Python interpreter, run these commands:
If you wish, after you connect, you can Ctrl-D out of the Python shell.
Extra debugging instructions are located at http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/debugging-tips.
When you invoke
IMPORTANT NOTE: Every time that you update Chrome or the Chrome OS SDK, it is possible that Chrome may start depending on new features from a new Chrome OS image. This can cause unexpected problems, so it is important to update your image regularly. The instructions for updating your Chrome OS image are in Step 4.
You can specify a version of Chrome OS to build against. This is handy for tracking down when a particular bug was introduced.
Once you are finished testing the old version of the chrome-sdk, you can always start a new shell with the latest version again. Here's an example:
Tip: If you update Chrome inside the
Then run these commands to build with make, where
Note that Make files are spread through the source tree, and not concentrated in the out_<board> directory, so you can only have one Make config running at a time.
Since the gyp files don't define which targets get installed, that information is maintained in the chromite repo as part of Chromium OS. That repo is also integrated into the Chromium source tree via the DEPS file.
In order to add/remove a file from the installed list: