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: You may be asked to set up a 'project-id', but this is unnecessary: you can skip the 'project-id' setup by just pressing 'Enter'.
Replace <board> with a ChromiumOS 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
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
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.
To install using rsync, use the
Specify the build output directory to deploy from using
Tip: Specify the
Tip: If you encounter error "Permission denied (publickey,keyboard-interactive).", you need to follow these steps to set up ssh identity file and authorized keys:
(1) Generate a pair of SSH public/private keys on the build system (e.g. ~/.ssh/test_id and ~/.ssh/test_id.pub);
(3) Copy ~/.ssh/test_id.pub to the target device and rename its path to "~/.ssh/authorized_keys" (e.g., by using a USB key).
For now, you will need to use cwolfe's experimental cros_chrome_mount (search for 'cros_chrome_mount' on the page) script to deploy to the device through an sshfs mount. Note you will need a chroot to use cros_chrome_mount.
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.
If you would like to use the deprecated emerge workflow for building Chromium, see the old documentation.