blob: 4704750b79c9d14414e0e5b7f4bb5ec414b96ea8 [file] [log] [blame] [view]
derat817105082017-02-22 17:57:551# Chrome OS Build Instructions (Chromium OS on Linux)
tfarina5b373372016-03-27 08:06:212
James Cook4dca0792018-01-24 22:57:343Chromium on Chromium OS uses Linux Chromium as a base, but adds a large number
4of features to the code. For example, the login UI, window manager and system UI
5are part of the Chromium code base and built into the chrome binary.
stevenjb89ee24b2016-04-19 19:26:426
James Cook4dca0792018-01-24 22:57:347Fortunately, most Chromium changes that affect Chromium OS can be built and
8tested on a Linux workstation. This build is called "linux-chromeos". In this
9configuration most system services (like the power manager, bluetooth daemon,
10etc.) are stubbed out. The entire system UI runs in a single X11 window on your
11desktop.
tfarina5b373372016-03-27 08:06:2112
13First, follow the [normal Linux build
14instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md)
15as usual to get a Chromium checkout.
16
stevenjbec7b4e3c2016-04-18 22:52:0217## Building and running Chromium with Chromium OS UI on your local machine
tfarina5b373372016-03-27 08:06:2118
James Cook4dca0792018-01-24 22:57:3419Run the following in your chromium checkout:
tfarina5b373372016-03-27 08:06:2120
stevenjbec7b4e3c2016-04-18 22:52:0221 $ gn gen out/Default --args='target_os="chromeos"'
James Cook4dca0792018-01-24 22:57:3422 $ autoninja -C out/Default chrome
23 $ out/Default/chrome
stevenjbec7b4e3c2016-04-18 22:52:0224
Matt Giucad8cebe42018-01-09 04:37:4625Some additional options you may wish to set by passing in `--args` to `gn gen`
26or running `gn args out/Default`:
stevenjb89ee24b2016-04-19 19:26:4227
James Cook4dca0792018-01-24 22:57:3428 use_goma = true # Googlers: Use build farm, compiles faster.
29 is_component_build = true # Links faster.
30 is_debug = false # Release build, runs faster.
31 dcheck_always_on = true # Enables DCHECK despite release build.
32 enable_nacl = false # Skips native client build, compiles faster.
Jacob Dufaultbfef58b2018-01-12 22:39:4833
34 # Set the following true to create a Chrome (instead of Chromium) build.
James Cook4dca0792018-01-24 22:57:3435 # This requires a src-internal checkout.
36 is_chrome_branded = false # Adds internal features and branded art assets.
37 is_official_build = false # Turns on many optimizations, slower build.
tfarina5b373372016-03-27 08:06:2138
James Cook4dca0792018-01-24 22:57:3439NOTE: You may wish to replace 'Default' with something like 'Cros' if
40you switch back and forth between Linux and Chromium OS builds, or 'Debug'
41if you want to differentiate between Debug and Release builds (see below).
42
43See [GN Build Configuration](https://www.chromium.org/developers/gn-build-configuration)
44for more information about configuring your build.
45
46You can also build and run test targets like `unit_tests`, `browser_tests`, etc.
47
48## Login notes
49
50By default this build signs in with a stub user. To specify a real user:
51
52* For first run, add the following options to chrome's command line:
53 `--user-data-dir=/tmp/chrome --login-manager`
54* Go through the out-of-the-box UX and sign in with a real Gmail account.
55* For subsequent runs, add:
56 `--user-data-dir=/tmp/chrome [email protected]`
57* To run in guest mode instantly, add:
58 `--user-data-dir=/tmp/chrome --bwsi --incognito --login-user='$guest'
59 --login-profile=user`
60
61Signing in as a specific user is useful for debugging features like sync
62that require a logged in user.
63
64## Graphics notes
tfarina5b373372016-03-27 08:06:2165
tfarina5b373372016-03-27 08:06:2166The Chromium OS build requires a functioning GL so if you plan on
67testing it through Chromium Remote Desktop you might face drawing
68problems (e.g. Aura window not painting anything). Possible remedies:
69
Matt Giucad8cebe42018-01-09 04:37:4670* `--ui-enable-software-compositing --ui-disable-threaded-compositing`
71* `--use-gl=osmesa`, but it's ultra slow, and you'll have to build osmesa
72 yourself.
tfarina5b373372016-03-27 08:06:2173
tfarina5b373372016-03-27 08:06:2174To more closely match the UI used on devices, you can install fonts used
75by Chrome OS, such as Roboto, on your Linux distro.
76
James Cook4dca0792018-01-24 22:57:3477## Compile Chromium for a Chromium OS device
tfarina5b373372016-03-27 08:06:2178
James Cook4dca0792018-01-24 22:57:3479See [Building Chromium for a Chromium OS device](https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md)
80for information about building and testing Chromium for Chromium OS.