Commit 5764fdd6 authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

Update //docs/chromeos_build_instructions with new Simple Chrome flow.

Will update simple_chrome_workflow.md on the CrOS-side of the world
in a follow-up.

Bug: 937821
Change-Id: I006dde1fcab5ad4a0fc48a5b5f8440a554da1bcd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2350540
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797456}
parent 5f7b338c
# Chrome OS Build Instructions (Chromium OS on Linux) # Chrome OS Build Instructions
Chromium on Chromium OS uses Linux Chromium as a base, but adds a large number Chrome for Chromium OS can be built in a couple different ways. After following
of features to the code. For example, the login UI, window manager and system UI the [initial setup](#common-setup), you'll need to choose one of the following
are part of the Chromium code base and built into the chrome binary. build configurations:
Fortunately, most Chromium changes that affect Chromium OS can be built and - If you're interested in testing Chrome OS code in Chrome, but not interactions
tested on a Linux workstation. This build is called "linux-chromeos". In this with Chrome OS services, you can build for
configuration most system services (like the power manager, bluetooth daemon, [linux-chromeos](#Chromium-OS-on-Linux-linux_chromeos) using just a Linux
etc.) are stubbed out. The entire system UI runs in a single X11 window on your workstation.
desktop. - Otherwise, Chrome's full integration can be covered by building for a real
Chrome OS device or VM using [Simple Chrome](#Chromium-OS-Device-Simple-Chrome).
[TOC]
## Common setup
First, follow the [normal Linux build First, follow the [normal Linux build
instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md) instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md)
as usual to get a Chromium checkout. as usual to get a Chromium checkout.
## Updating your gclient config You'll also need to add `'chromeos'` to the `target_os` list in your `.gclient`
configuration, which will fetch the additional build dependencies required for
Chromium OS builds of Chromium require some additional build dependencies which CrOS. This file is located one level up from your Chromium checkout's `src`.
can be synced by adding `'chromeos'` to the `target_os` list in your `.gclient`
configuration. This file is located one level up from your Chromium checkout's
`src`.
If you don't already have a `target_os` line present, simply add this to the If you don't already have a `target_os` line present, simply add this to the
end of the `.gclient` file: end of the `.gclient` file:
...@@ -34,7 +36,20 @@ simply append `'chromeos'` to the existing list there. For example: ...@@ -34,7 +36,20 @@ simply append `'chromeos'` to the existing list there. For example:
Once your `.gclient` file is updated, you will need to run `gclient sync` once Once your `.gclient` file is updated, you will need to run `gclient sync` once
before proceeding with the rest of these instructions. before proceeding with the rest of these instructions.
## Building and running Chromium with Chromium OS UI on your local machine ## Chromium OS on Linux (linux-chromeos)
Chromium on Chromium OS uses Linux Chromium as a base, but adds a large number
of Chrome OS-specific features to the code. For example, the login UI, window
manager and system UI are part of the Chromium code base and built into the
chrome binary.
Fortunately, most Chromium changes that affect Chromium OS can be built and
tested on a Linux workstation. This build is called "linux-chromeos". In this
configuration most system services (like the power manager, bluetooth daemon,
etc.) are stubbed out. The entire system UI runs in a single X11 window on your
desktop.
### Building and running Chromium with Chromium OS UI on your local machine
Run the following in your chromium checkout: Run the following in your chromium checkout:
...@@ -68,7 +83,7 @@ for more information about configuring your build. ...@@ -68,7 +83,7 @@ for more information about configuring your build.
You can also build and run test targets like `unit_tests`, `browser_tests`, etc. You can also build and run test targets like `unit_tests`, `browser_tests`, etc.
## Flags ### Flags
Some useful flags: Some useful flags:
...@@ -90,7 +105,7 @@ Some useful flags: ...@@ -90,7 +105,7 @@ Some useful flags:
http://localhost:9222 http://localhost:9222
* `--use-system-clipboard`: Integrate clipboard with the host X11 system. * `--use-system-clipboard`: Integrate clipboard with the host X11 system.
## Login notes ### Login notes
By default this build signs in with a stub user. To specify a real user: By default this build signs in with a stub user. To specify a real user:
...@@ -107,7 +122,7 @@ By default this build signs in with a stub user. To specify a real user: ...@@ -107,7 +122,7 @@ By default this build signs in with a stub user. To specify a real user:
Signing in as a specific user is useful for debugging features like sync Signing in as a specific user is useful for debugging features like sync
that require a logged in user. that require a logged in user.
## Graphics notes ### Graphics notes
The Chromium OS build requires a functioning GL so if you plan on The Chromium OS build requires a functioning GL so if you plan on
testing it through Chromium Remote Desktop you might face drawing testing it through Chromium Remote Desktop you might face drawing
...@@ -119,7 +134,65 @@ problems (e.g. Aura window not painting anything). Possible remedies: ...@@ -119,7 +134,65 @@ problems (e.g. Aura window not painting anything). Possible remedies:
To more closely match the UI used on devices, you can install fonts used To more closely match the UI used on devices, you can install fonts used
by Chrome OS, such as Roboto, on your Linux distro. by Chrome OS, such as Roboto, on your Linux distro.
## Compile Chromium for a Chromium OS device ## Chromium OS Device (Simple Chrome)
This configuration allows you to build a fully functional Chrome for a real
Chrome OS device or VM. Since Chrome OS uses a different toolchain for each
device model, you'll first need to know the name of the model (or "board") you
want to build for. For most boards, `amd64-generic` and `arm-generic` will
produce a functional binary, though it won't be optimized and may be missing
functionality.
### Additional gclient setup
Each board has its own toolchain and misc. build dependencies. To fetch these,
list the board under the `"cros_boards"` gclient custom var. If you were using
the `amd64-generic` board, your `.gclient` file would look like:
```
solutions = [
{
"url": "https://chromium.googlesource.com/chromium/src.git",
"name": "src",
"custom_deps": {},
"custom_vars" : {
"cros_boards": "amd64-generic",
},
},
]
target_os = ["chromeos"]
```
Once your .gclient file is updated, you will need to run `gclient sync` again
to fetch the toolchain.
NOTE:
- If you'd like a VM image additionally downloaded for the board, add it to the
`"cros_boards_with_qemu_images"` gclient custom var. That var downloads the
SDK along with a VM image. `cros_boards` downloads only the SDK.
- If you'd like to fetch multiple boards, add a `:` between each board in the
gclient var. For example: `"cros_boards": "amd64-generic:arm-generic"`.
### Building for the board
After the needed toolchain has been downloaded for your ${BOARD}, a build dir
will have been conveniently created for you at `out_$BOARD/Release`, which can
then be used to build Chrome. For the `amd64-generic` board, this would
look like:
$ gn gen out_amd64-generic/Release
$ autoninja -C out_$BOARD/Release chrome
Or if you prefer to use your own build dir, simply add the following line to the
top of your GN args: `import("//build/args/chromeos/amd64-generic.gni")`. eg:
$ gn gen out/Default --args='import("//build/args/chromeos/amd64-generic.gni")'
$ autoninja -C out/Default chrome
That will produce a Chrome OS build of Chrome very similar to what is shipped
for that device. You can also supply additional args or even overwrite ones
supplied in the imported .gni file after the `import()` line.
### Additional notes
See [Building Chromium for a Chromium OS device](https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md) For more information (like copying the locally-built Chrome to a device, or
for information about building and testing Chromium for Chromium OS. running Tast tests), consult Simple Chrome's
[full documentation](https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md).
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment