blob: 164f5deb8cdbb95ed9e14725aee0e89fc09c2b50 [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
Ken Rockota21ef762018-05-02 04:02:3717## Updating your gclient config
18
19Chromium OS builds of Chromium require some additional build dependencies which
20can be synced by adding `'chromeos'` to the `target_os` list in your `.gclient`
21configuration. This file is located one level up from your Chromium checkout's
22`src`.
23
24If you don't already have a `target_os` line present, simply add this to the
25end of the `.gclient` file:
26
27 target_os = ['chromeos']
28
29If you already have a `target_os` line present in your `.gclient file`, you can
30simply append `'chromeos'` to the existing list there. For example:
31
32 target_os = ['android', 'chromeos']
33
34Once your `.gclient` file is updated, you will need to run `gclient sync` once
35before proceeding with the rest of these instructions.
36
stevenjbec7b4e3c2016-04-18 22:52:0237## Building and running Chromium with Chromium OS UI on your local machine
tfarina5b373372016-03-27 08:06:2138
James Cook4dca0792018-01-24 22:57:3439Run the following in your chromium checkout:
tfarina5b373372016-03-27 08:06:2140
stevenjbec7b4e3c2016-04-18 22:52:0241 $ gn gen out/Default --args='target_os="chromeos"'
James Cook4dca0792018-01-24 22:57:3442 $ autoninja -C out/Default chrome
43 $ out/Default/chrome
stevenjbec7b4e3c2016-04-18 22:52:0244
Dirk Pranke8bd55f22018-10-24 21:22:1045(`autoninja` is a wrapper that automatically provides optimal values for the
46arguments passed to `ninja`).
47
Matt Giucad8cebe42018-01-09 04:37:4648Some additional options you may wish to set by passing in `--args` to `gn gen`
49or running `gn args out/Default`:
stevenjb89ee24b2016-04-19 19:26:4250
James Cook4dca0792018-01-24 22:57:3451 use_goma = true # Googlers: Use build farm, compiles faster.
52 is_component_build = true # Links faster.
53 is_debug = false # Release build, runs faster.
54 dcheck_always_on = true # Enables DCHECK despite release build.
55 enable_nacl = false # Skips native client build, compiles faster.
Jacob Dufaultbfef58b2018-01-12 22:39:4856
57 # Set the following true to create a Chrome (instead of Chromium) build.
James Cook4dca0792018-01-24 22:57:3458 # This requires a src-internal checkout.
59 is_chrome_branded = false # Adds internal features and branded art assets.
60 is_official_build = false # Turns on many optimizations, slower build.
tfarina5b373372016-03-27 08:06:2161
James Cook4dca0792018-01-24 22:57:3462NOTE: You may wish to replace 'Default' with something like 'Cros' if
63you switch back and forth between Linux and Chromium OS builds, or 'Debug'
64if you want to differentiate between Debug and Release builds (see below).
65
66See [GN Build Configuration](https://www.chromium.org/developers/gn-build-configuration)
67for more information about configuring your build.
68
69You can also build and run test targets like `unit_tests`, `browser_tests`, etc.
70
71## Login notes
72
73By default this build signs in with a stub user. To specify a real user:
74
75* For first run, add the following options to chrome's command line:
76 `--user-data-dir=/tmp/chrome --login-manager`
77* Go through the out-of-the-box UX and sign in with a real Gmail account.
78* For subsequent runs, add:
79 `--user-data-dir=/tmp/chrome [email protected]`
80* To run in guest mode instantly, add:
81 `--user-data-dir=/tmp/chrome --bwsi --incognito --login-user='$guest'
82 --login-profile=user`
83
84Signing in as a specific user is useful for debugging features like sync
85that require a logged in user.
86
87## Graphics notes
tfarina5b373372016-03-27 08:06:2188
tfarina5b373372016-03-27 08:06:2189The Chromium OS build requires a functioning GL so if you plan on
90testing it through Chromium Remote Desktop you might face drawing
91problems (e.g. Aura window not painting anything). Possible remedies:
92
Matt Giucad8cebe42018-01-09 04:37:4693* `--ui-enable-software-compositing --ui-disable-threaded-compositing`
Alexis Hetu3384f062018-08-27 18:30:4494* `--use-gl=swiftshader`, but it's slow.
tfarina5b373372016-03-27 08:06:2195
tfarina5b373372016-03-27 08:06:2196To more closely match the UI used on devices, you can install fonts used
97by Chrome OS, such as Roboto, on your Linux distro.
98
James Cook4dca0792018-01-24 22:57:3499## Compile Chromium for a Chromium OS device
tfarina5b373372016-03-27 08:06:21100
James Cook4dca0792018-01-24 22:57:34101See [Building Chromium for a Chromium OS device](https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md)
102for information about building and testing Chromium for Chromium OS.