tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame^] | 1 | # ChromeOS Build Instructions (Chromium OS on Linux) |
| 2 | |
| 3 | Chromium on Chromium OS is built on a mix of code sourced from Chromium |
| 4 | on Linux and Chromium on Windows. Much of the user interface code is |
| 5 | shared with Chromium on Windows. As such, if you make a change to |
| 6 | Chromium on Windows you may find your changes affect Chromium on |
| 7 | Chromium OS. Fortunately to test the effect of your changes you don't |
| 8 | have to build all of Chromium OS, you can just build Chromium for |
| 9 | Chromium OS directly on Linux. |
| 10 | |
| 11 | First, follow the [normal Linux build |
| 12 | instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md) |
| 13 | as usual to get a Chromium checkout. |
| 14 | |
| 15 | ## Running Chromium on your local machine |
| 16 | |
| 17 | If you plan to test the Chromium build on your dev machine and not a |
| 18 | Chromium OS device run: |
| 19 | |
| 20 | ```shell |
| 21 | export GYP_DEFINES="chromeos=1" |
| 22 | gclient runhooks |
| 23 | ``` |
| 24 | |
| 25 | Now, once you build, you will build with Chromium OS features turned on. |
| 26 | |
| 27 | ### Notes |
| 28 | |
| 29 | When you build Chromium OS Chromium, you'll be using the TOOLKIT\_VIEWS |
| 30 | front-end just like Windows, so the files you'll probably want are in |
| 31 | src/ui/views and src/chrome/browser/ui/views. |
| 32 | |
| 33 | If chromeos=1 is specified, then toolkit\_views=0 must not be specified. |
| 34 | |
| 35 | The Chromium OS build requires a functioning GL so if you plan on |
| 36 | testing it through Chromium Remote Desktop you might face drawing |
| 37 | problems (e.g. Aura window not painting anything). Possible remedies: |
| 38 | |
| 39 | * --ui-enable-software-compositing --ui-disable-threaded-compositing |
| 40 | * --use-gl=osmesa, but it's ultra slow, and you'll have to build |
| 41 | osmesa yourself. |
| 42 | * ... or just don't use Remote Desktop. :) |
| 43 | |
| 44 | Note the underscore in the GYP_DEFINES variable name, as people |
| 45 | sometimes mistakenly write it GYPDEFINES. |
| 46 | |
| 47 | To more closely match the UI used on devices, you can install fonts used |
| 48 | by Chrome OS, such as Roboto, on your Linux distro. |
| 49 | |
| 50 | To specify a logged in user: |
| 51 | |
| 52 | * For first run, add the following options to the command line: |
| 53 | **--user-data-dir=/tmp/chrome --login-manager** |
| 54 | * Go through the out-of-the-box UX and sign in as |
| 55 | **username@gmail.com** |
| 56 | * For subsequent runs, add the following to the command line: |
| 57 | **--user-data-dir=/tmp/chrome --login-user=username@gmail.com**. |
| 58 | * To run in guest mode instantly, you can run add the arguments |
| 59 | **--user-data-dir=/tmp/chrome --bwsi --incognito |
| 60 | --login-user='$guest' --login-profile=user** |
| 61 | |
| 62 | Signing in as a specific user is useful for debugging features like sync |
| 63 | that require a logged in user. |
| 64 | |
| 65 | ### Compile Testing Chromium with the Chromium OS SDK (quick version) |
| 66 | |
| 67 | Note: These instructions are intended for Chromium developers trying to |
| 68 | diagnose compile issues on Chromium OS, which can block changes in the |
| 69 | CQ. See the [full |
| 70 | documentation](http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/building-chromium-browser) |
| 71 | for more information about building & testing chromium for Chromium OS. |
| 72 | |
| 73 | To do a build of Chromium that can run on Chromium OS itself, the Chromium OS |
| 74 | SDK must be used. The SDK provides all of chromium's dependencies as they are |
| 75 | distributed with Chromium OS (as opposed to other distributions such as Ubuntu). |
| 76 | |
| 77 | To enter the SDK build environment, run the following command (replace the value |
| 78 | of the `--board` flag with the name of the configuration you want to test). |
| 79 | |
| 80 | ```shell |
| 81 | cros chrome-sdk --board=amd64-generic --use-external-config |
| 82 | ``` |
| 83 | |
| 84 | Once in the SDK build environment, build using the normal linux workflow (except |
| 85 | for a different build directory): |
| 86 | |
| 87 | ```shell |
| 88 | gclient runhooks |
| 89 | ninja -C out_amd64-generic/Release chromium_builder_tests |
| 90 | ``` |
| 91 | |
| 92 | The current configurations verified by the CQ are: |
| 93 | |
| 94 | Board Flag | Build Directory | CPU architecture |
| 95 | --- | --- | --- |
| 96 | amd64-generic | out_amd64-generic | 64-bit Intel |
| 97 | x86-generic | out_x86-generic | 32-bit Intel |
| 98 | daisy | out_daisy | 32-bit ARM |
| 99 | |
| 100 | ## Running Chromium on a Chromium OS device |
| 101 | |
| 102 | Look at the [Chromium OS |
| 103 | documentation](http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/building-chromium-browser) |
| 104 | for the official flow for doing this. |