blob: 2638b2ac3fc3601439d341fa342015472637d35a [file] [log] [blame] [view]
tfarina5b373372016-03-27 08:06:211# ChromeOS Build Instructions (Chromium OS on Linux)
2
3Chromium on Chromium OS is built on a mix of code sourced from Chromium
4on Linux and Chromium on Windows. Much of the user interface code is
5shared with Chromium on Windows. As such, if you make a change to
6Chromium on Windows you may find your changes affect Chromium on
7Chromium OS. Fortunately to test the effect of your changes you don't
8have to build all of Chromium OS, you can just build Chromium for
9Chromium OS directly on Linux.
10
11First, follow the [normal Linux build
12instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md)
13as usual to get a Chromium checkout.
14
15## Running Chromium on your local machine
16
17If you plan to test the Chromium build on your dev machine and not a
18Chromium OS device run:
19
20```shell
21export GYP_DEFINES="chromeos=1"
22gclient runhooks
23```
24
25Now, once you build, you will build with Chromium OS features turned on.
26
27### Notes
28
29When you build Chromium OS Chromium, you'll be using the TOOLKIT\_VIEWS
30front-end just like Windows, so the files you'll probably want are in
31src/ui/views and src/chrome/browser/ui/views.
32
33If chromeos=1 is specified, then toolkit\_views=0 must not be specified.
34
35The Chromium OS build requires a functioning GL so if you plan on
36testing it through Chromium Remote Desktop you might face drawing
37problems (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
44Note the underscore in the GYP_DEFINES variable name, as people
45sometimes mistakenly write it GYPDEFINES.
46
47To more closely match the UI used on devices, you can install fonts used
48by Chrome OS, such as Roboto, on your Linux distro.
49
50To 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
62Signing in as a specific user is useful for debugging features like sync
63that require a logged in user.
64
65### Compile Testing Chromium with the Chromium OS SDK (quick version)
66
67Note: These instructions are intended for Chromium developers trying to
68diagnose compile issues on Chromium OS, which can block changes in the
69CQ. See the [full
70documentation](http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/building-chromium-browser)
71for more information about building & testing chromium for Chromium OS.
72
73To do a build of Chromium that can run on Chromium OS itself, the Chromium OS
74SDK must be used. The SDK provides all of chromium's dependencies as they are
75distributed with Chromium OS (as opposed to other distributions such as Ubuntu).
76
77To enter the SDK build environment, run the following command (replace the value
78of the `--board` flag with the name of the configuration you want to test).
79
80```shell
81cros chrome-sdk --board=amd64-generic --use-external-config
82```
83
84Once in the SDK build environment, build using the normal linux workflow (except
85for a different build directory):
86
87```shell
88gclient runhooks
89ninja -C out_amd64-generic/Release chromium_builder_tests
90```
91
92The 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
102Look at the [Chromium OS
103documentation](http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/building-chromium-browser)
104for the official flow for doing this.
close