README.md
1This directory is used to store GN arg mapping for Chrome OS boards. The values
2of the args are determined by processing the [chromeos-chrome ebuild] for a
3given board and a given ChromeOS version (stored in the [CHROMEOS_LKGM] file).
4
5Files in this directory are populated by running `gclient sync` with specific
6arguments set in the .gclient file. Specifically:
7* The file must have a top-level variable set: `target_os = ["chromeos"]`
8* The `"custom_vars"` parameter of the chromium/src.git solution must include
9 the parameter: `"cros_boards": "{BOARD_NAMES}"` where `{BOARD_NAMES}` is a
10 colon-separated list of boards you'd like to checkout.
11* If you'd like to a checkout a QEMU-bootable image for a given board, include
12 it in the `cros_boards_with_qemu_images` var rather than the `cros_boards`
13 var.
14
15A typical .gclient file is a sibling of the src/ directory, and might look like
16this:
17```
18solutions = [
19 {
20 "url": "https://chromium.googlesource.com/chromium/src.git",
21 "managed": False,
22 "name": "src",
23 "custom_deps": {},
24 "custom_vars" : {
25 "checkout_src_internal": True,
26 "cros_boards": "eve:kevin",
27 # If a QEMU-bootable image is desired for any board, move it from
28 # the previous var to the following:
29 "cros_boards_with_qemu_images": "amd64-generic",
30 },
31 },
32]
33target_os = ["chromeos"]
34```
35
36To use these files in a build, simply add the following line to your GN args:
37```
38import("//build/args/chromeos/${some_board}.gni")
39```
40
41That will produce a Chrome OS build of Chrome very similar to what is shipped
42for that device. You can also supply additional args or even overwrite ones
43supplied in the .gni file after the `import()` line. For example, the following
44args will produce a debug build of Chrome for board=eve using goma:
45```
46import("//build/args/chromeos/eve.gni")
47
48is_debug = true
49use_remoteexec = true
50```
51
52TODO(bpastene): Make 'cros_boards' a first class citizen in gclient and replace
53it with 'target_boards' instead.
54
55[chromeos-chrome ebuild]: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/HEAD/chromeos-base/chromeos-chrome/chromeos-chrome-9999.ebuild
56[CHROMEOS_LKGM]: https://chromium.googlesource.com/chromium/src/+/HEAD/chromeos/CHROMEOS_LKGM
57