derat | 81710508 | 2017-02-22 17:57:55 | [diff] [blame] | 1 | # Chrome OS Build Instructions (Chromium OS on Linux) |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 2 | |
James Cook | 4dca079 | 2018-01-24 22:57:34 | [diff] [blame^] | 3 | Chromium on Chromium OS uses Linux Chromium as a base, but adds a large number |
| 4 | of features to the code. For example, the login UI, window manager and system UI |
| 5 | are part of the Chromium code base and built into the chrome binary. |
stevenjb | 89ee24b | 2016-04-19 19:26:42 | [diff] [blame] | 6 | |
James Cook | 4dca079 | 2018-01-24 22:57:34 | [diff] [blame^] | 7 | Fortunately, most Chromium changes that affect Chromium OS can be built and |
| 8 | tested on a Linux workstation. This build is called "linux-chromeos". In this |
| 9 | configuration most system services (like the power manager, bluetooth daemon, |
| 10 | etc.) are stubbed out. The entire system UI runs in a single X11 window on your |
| 11 | desktop. |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 12 | |
| 13 | First, follow the [normal Linux build |
| 14 | instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md) |
| 15 | as usual to get a Chromium checkout. |
| 16 | |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 17 | ## Building and running Chromium with Chromium OS UI on your local machine |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 18 | |
James Cook | 4dca079 | 2018-01-24 22:57:34 | [diff] [blame^] | 19 | Run the following in your chromium checkout: |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 20 | |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 21 | $ gn gen out/Default --args='target_os="chromeos"' |
James Cook | 4dca079 | 2018-01-24 22:57:34 | [diff] [blame^] | 22 | $ autoninja -C out/Default chrome |
| 23 | $ out/Default/chrome |
stevenjb | ec7b4e3c | 2016-04-18 22:52:02 | [diff] [blame] | 24 | |
Matt Giuca | d8cebe4 | 2018-01-09 04:37:46 | [diff] [blame] | 25 | Some additional options you may wish to set by passing in `--args` to `gn gen` |
| 26 | or running `gn args out/Default`: |
stevenjb | 89ee24b | 2016-04-19 19:26:42 | [diff] [blame] | 27 | |
James Cook | 4dca079 | 2018-01-24 22:57:34 | [diff] [blame^] | 28 | 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 Dufault | bfef58b | 2018-01-12 22:39:48 | [diff] [blame] | 33 | |
| 34 | # Set the following true to create a Chrome (instead of Chromium) build. |
James Cook | 4dca079 | 2018-01-24 22:57:34 | [diff] [blame^] | 35 | # 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. |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 38 | |
James Cook | 4dca079 | 2018-01-24 22:57:34 | [diff] [blame^] | 39 | NOTE: You may wish to replace 'Default' with something like 'Cros' if |
| 40 | you switch back and forth between Linux and Chromium OS builds, or 'Debug' |
| 41 | if you want to differentiate between Debug and Release builds (see below). |
| 42 | |
| 43 | See [GN Build Configuration](https://www.chromium.org/developers/gn-build-configuration) |
| 44 | for more information about configuring your build. |
| 45 | |
| 46 | You can also build and run test targets like `unit_tests`, `browser_tests`, etc. |
| 47 | |
| 48 | ## Login notes |
| 49 | |
| 50 | By 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 | |
| 61 | Signing in as a specific user is useful for debugging features like sync |
| 62 | that require a logged in user. |
| 63 | |
| 64 | ## Graphics notes |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 65 | |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 66 | The Chromium OS build requires a functioning GL so if you plan on |
| 67 | testing it through Chromium Remote Desktop you might face drawing |
| 68 | problems (e.g. Aura window not painting anything). Possible remedies: |
| 69 | |
Matt Giuca | d8cebe4 | 2018-01-09 04:37:46 | [diff] [blame] | 70 | * `--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. |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 73 | |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 74 | To more closely match the UI used on devices, you can install fonts used |
| 75 | by Chrome OS, such as Roboto, on your Linux distro. |
| 76 | |
James Cook | 4dca079 | 2018-01-24 22:57:34 | [diff] [blame^] | 77 | ## Compile Chromium for a Chromium OS device |
tfarina | 5b37337 | 2016-03-27 08:06:21 | [diff] [blame] | 78 | |
James Cook | 4dca079 | 2018-01-24 22:57:34 | [diff] [blame^] | 79 | See [Building Chromium for a Chromium OS device](https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md) |
| 80 | for information about building and testing Chromium for Chromium OS. |