Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 1 | # Local & Remote Source Tree Layouts |
| 2 | |
| 3 | Here we discuss the layout of files in the local source checkout as well as the |
| 4 | remote Git server. |
| 5 | The goal is both to document the current state of things and to provide guidance |
| 6 | when adding new repos. |
| 7 | |
| 8 | Some repos might exist in places that don't follow these guidelines, but the |
| 9 | goal is to align rather than keep adding exceptions. |
| 10 | |
| 11 | [TOC] |
| 12 | |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 13 | ## Local Checkout {#local-layout} |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 14 | |
| 15 | This is the layout as seen when you get a full CrOS checkout. |
| 16 | We cover the source repos separately from the generated paths to make the |
| 17 | provenance of the paths clearer. |
| 18 | |
| 19 | ### Source directories |
| 20 | |
| 21 | Some of these are marked as *(non-standard)* to indicate that, someday maybe, |
| 22 | the repo would be moved to a more appropriate path. |
| 23 | |
| 24 | * `chromeos-admin/`: *(non-standard)* Internal repo used by the build/infra |
| 25 | team to hold scripts and tools for managing various infrastructure systems. |
| 26 | * [`chromite/`][chromite]: All of CrOS's build tools live here. |
| 27 | * `chromium/`: *(non-standard)* Mirrors of repos from the Chromium project. |
| 28 | * [`cros-signing/`][cros-signing]: *(non-standard)* Signing server code. |
| 29 | * [`crostools/`][crostools]: *(non-standard)* Signing instructions for |
| 30 | builders. |
| 31 | * [`docs/`][docs]: Public documentation. |
| 32 | * [`docs-internal/`][docs-internal]: Internal documentation. |
| 33 | * `infra/`: Projects for various CrOS infra systems. |
| 34 | * `infra_internal/`: Internal projects for various CrOS infra systems. |
| 35 | * `infra_virtualenv/`: Python virtualenv tooling for CrOS infra projects. |
| 36 | * [`manifest/`][manifest]: Public Chromium OS manifest. |
| 37 | * [`manifest-internal/`][manifest-internal]: Internal Chrome OS manifest. |
| 38 | * `src/`: Most source code people care about. |
| 39 | * `aosp/`: Mirrors of repos from the [Android project][AOSP GoB]. |
Stephane Belmon | a05909a | 2020-09-09 20:57:23 | [diff] [blame] | 40 | * `config/`: Schema definitions and utilities for configuring CrOS |
| 41 | hardware and software; used to generate config payloads to drive |
| 42 | CrOS builds, manufacturing, etc. |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 43 | * [`overlays`/][board-overlays]: Single git repo holding all public |
| 44 | board/etc... overlays. |
| 45 | * `baseboard-*/`: Overlays for "base boards". Content that is for the |
| 46 | specified board only and is "software stack" independent. |
| 47 | * `chipset-*/`: Overlays for specific chipsets/SoCs. Board or OS |
| 48 | specific details don't generally belong in here. |
| 49 | * `overlay-*/`: Overlays for the actual board. These often extend a |
| 50 | baseboard or chipset and blend in a project or OS stack. |
| 51 | * `project-*/`: Software stacks for standalone projects. These are |
| 52 | used to share code easily among different boards. |
| 53 | * `partner_private/`: Separate git repos for internal partner repos. |
| 54 | These hold source repos that isn't open source or authored by Google. |
| 55 | * `platform/`: Separate git repos for Google/Chromium OS authored |
| 56 | projects. Here are a few notable repos. |
| 57 | * [`dev/`][dev-util]: Various developer and testing scripts. |
| 58 | * [`contrib/`][contrib]: Where developers can share their personal |
| 59 | scripts/tools/etc... Note: completely unsupported. |
| 60 | * [`vboot_reference/`][vboot_reference]: Code and tools for working |
| 61 | with verified boot, as well as image signing and key generation |
| 62 | scripts. |
| 63 | * `$PROJECT/`: Each project gets its own directory. |
| 64 | * [`platform2/`][platform2]: Combined git repo for Chromium OS system |
| 65 | projects. Used to help share code, libraries, build, and test logic. |
| 66 | * `private-overlays/`: Separate git repos for internal partner repos to |
| 67 | simplify sharing with specific partners. This mirrors the structure |
| 68 | of `src/overlays/`. |
| 69 | * `baseboard-*-private/`: Internal base boards shared with specific |
| 70 | partners. |
| 71 | * `chipset-*-private/`: Internal chipsets shared with specific |
| 72 | partners. |
| 73 | * [`chromeos-overlay/`][chromeos-overlay]: Chrome OS settings & |
| 74 | packages (not Chromium OS) not shared with partners. |
| 75 | * [`chromeos-partner-overlay/`][chromeos-partner-overlay]: Chrome OS |
| 76 | settings & packages shared with all partners. |
| 77 | * `overlay-*-private/`: Internal boards shared with specific partners. |
| 78 | * `project-*-private/`: Internal projects shared with specific |
| 79 | partners. |
| 80 | * [`repohooks/`][repohooks]: Hooks used by the `repo` tool. Most notably, |
| 81 | these are the test run at `repo upload` time to verify CLs. |
| 82 | * [`scripts/`][crosutils]: Legacy Chromium OS build scripts. Being moved |
| 83 | to chromite and eventually dropped. No new code should be added here. |
| 84 | * `third_party/`: Separate git repos for third party (i.e. not Google or |
| 85 | Chromium OS authored) projects, or projects that are intended to be used |
| 86 | beyond CrOS. These are often forks of upstream projects. |
| 87 | * [`chromiumos-overlay/`][chromiumos-overlay]: Custom ebuilds for just |
| 88 | Chromium OS. Also where forked Gentoo ebuilds are kept (instead of |
| 89 | `portage-stable/`). |
| 90 | * [`eclass-overlay/`][eclass-overlay]: Overlay for custom eclasses |
| 91 | that are used by all other overlays (board, project, etc...). |
| 92 | * [`kernel/`][kernel]: The Linux kernel. Separate checkouts are used |
| 93 | for each version we track. |
| 94 | * [`portage-stable/`][portage-stable]: Unmodified ebuilds copied from |
| 95 | Gentoo. If you want to make custom changes, packages are moved to |
| 96 | [chromiumos-overlay]/ instead. See the [Package Upgrade Process] |
| 97 | for details on updating these. |
| 98 | * [`portage_tool/`][portage_tool]: Fork of Gentoo's portage project |
| 99 | (i.e. `emerge` and `ebuild`). |
| 100 | * `$PROJECT/`: Each project gets its own directory. |
| 101 | * `weave/`: Mirrors of repos from the Weave project. |
| 102 | |
| 103 | ### Generated directories |
| 104 | |
| 105 | These paths are all created on the fly and do not have any relationship to git |
| 106 | repos on the servers. |
| 107 | You should not normally need to manage these directly or clean them up. |
| 108 | In fact, you should avoid trying to do so to avoid breaking the build system. |
| 109 | If you're running out of space, use the `cros clean` command to help trim the |
| 110 | various caches and build directories safely. |
| 111 | |
| 112 | * `.cache/`: Various files cached by the build tools. Designed to be shared |
| 113 | between different CrOS checkouts and branch versions. |
| 114 | * `common/`: Various artifacts cached by [chromite] tools. |
| 115 | * `distfiles/`: Artifacts used while running emerge. |
| 116 | * `ccache/`: Compiler cache used by the toolchain to save objects. |
| 117 | * `host/`: Tarballs used by emerge in the SDK itself. |
| 118 | * `target/`: Tarballs used when emerging board packages. |
| 119 | * `sdks/`: Copies of the initial SDK tarball (for `chroot/`). |
| 120 | * `.repo/`: Internal state used by [repo] to manage the checkout. You usually |
| 121 | don't have to mess around with paths under here, so this is more of an |
| 122 | informational section. |
| 123 | * [`local_manifests/`][Local manifests]: Local manifests to add custom |
| 124 | repos to the local checkout. |
| 125 | * `manifests/`: Local checkout of the manifest repo using the |
| 126 | `--manifest-branch` setting from `repo init`. This is used during |
| 127 | all repo operations like `repo sync` and `repo upload`. |
| 128 | * `manifests.git/`: Local bare clone of the remote manifest repo. |
| 129 | This is the `--manifest-url` setting used during `repo init`. |
| 130 | * `manifest.xml`: Symlink to the manifest in the `manifests/` directory. |
| 131 | This is the `--manifest-name` setting used during `repo init`. |
| 132 | * `project-objects/`: Used by `repo` to hold git objects for all the |
| 133 | checked out repos. The `.git/` subdir will often symlink to paths |
| 134 | under here. |
| 135 | * `projects/`: Same as `project-objects/`, but for non-objects git files. |
| 136 | * `repo/`: Local checkout of the [repo] tool itself. This is the code |
| 137 | behind every `repo` command. This is the `--repo-url` setting used |
| 138 | during `repo init`. |
| 139 | * [`chroot/`][chroot]: The full chroot used by `cros_sdk` where boards are |
| 140 | built. See the [filesystem layout] document for more details. |
| 141 | Use `cros_sdk --delete` to safely remove this directory. |
| 142 | * `chroot.img`: A disk image for the `chroot/` directory. Provides hermetic |
| 143 | guarantees about the filesystem, and helps speed up things like snapshots. |
| 144 | Use `cros_sdk --delete` to safely remove these paths. |
| 145 | * `src/`: |
| 146 | * `build/`: All final artifacts & images are written here (e.g. |
| 147 | `build_image` outputs). |
| 148 | * `images/$BOARD/`: Every board goes into a unique output directory. |
| 149 | * `latest/`: A symlink that is automatically updated to point to |
| 150 | the latest build for this board. |
| 151 | * `$VERSION/`: Each version gets a unique directory. |
| 152 | |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 153 | ## Git Server Layout {#server-layout} |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 154 | |
| 155 | This is the layout as organized on the Git server. |
| 156 | This isn't comprehensive, but should provide enough guidance here. |
| 157 | |
| 158 | Note that the layout (and even specific names) of repos on the server do not |
| 159 | need to exactly match the layout of the local source checkout. |
| 160 | The manifest used by [repo] allows for the paths and names to be completely |
| 161 | independent. |
| 162 | Often times they are pretty similar since we try to keep the naming policies |
| 163 | coherent as it's less confusing that way. |
| 164 | |
| 165 | ### Public Chromium GoB |
| 166 | |
| 167 | This is the public https://chromium.googlesource.com/ site. |
| 168 | |
| 169 | The majority of repos should live under either `platform/` or `third_party/`. |
| 170 | It's very uncommon to create projects outside of those paths. |
| 171 | If you want to create a new project somewhere else, please check with the |
| 172 | build/infra team first using [[email protected]][Contact]. |
| 173 | |
| 174 | * `aosp/`: Mirrors of Android projects. Should use the same layout as on the |
| 175 | [AOSP GoB] host. |
| 176 | * `apps/`: Various Chromium OS applications. Usually these are "Chrome Apps" |
| 177 | written in HTML/JavaScript/CSS. |
| 178 | * `chromium/`: Chromium (the browser) related projects. These are managed |
| 179 | entirely by the browser team. |
| 180 | * `chromiumos/`: Chromium OS related projects. Most Chrome OS people will |
| 181 | only ever work on projects under these paths. |
| 182 | * [`chromite/`][chromite]: All of CrOS's build tools live here. |
| 183 | * `containers/`: Projects for the [VM/containers] project. Mainly for |
| 184 | projects that don't integrate directly into CrOS builds, otherwise the |
| 185 | projects are stored under `platform2/vm_tools/`. |
| 186 | * `$PROJECT/`: Each project gets its own repo. |
| 187 | * [`docs/`][docs]: General project documentation repo. |
| 188 | * `infra/`: Projects for various CrOS infra systems. |
| 189 | * [`manifest/`][manifest]: The manifest use by `repo init` and `repo sync` |
| 190 | to get a public Chromium OS checkout. |
| 191 | * `overlays/`: Various ebuild overlays used to build Chromium OS. These |
| 192 | are where all the packages and their compile/install logic live. |
| 193 | * [`board-overlays/`][board-overlays]: All public board overlays. |
| 194 | * [`chromiumos-overlay/`][chromiumos-overlay]: Custom ebuilds for just |
| 195 | Chromium OS. Also where forked Gentoo ebuilds are kept (instead of |
| 196 | [portage-stable]/). |
| 197 | * [`eclass-overlay/`][eclass-overlay]: Overlay for custom eclasses |
| 198 | that are used by all other overlays (board, project, etc...). |
| 199 | * [`portage-stable/`][portage-stable]: Unmodified ebuilds from Gentoo. |
| 200 | When making custom changes, packages are moved to |
| 201 | [chromiumos-overlay]/ instead. See the [Package Upgrade Process] |
| 202 | for details on updating these. |
| 203 | * `platform/`: Projects written by the Chromium OS project, or some Google |
| 204 | authored projects. Many of these have since been merged into |
| 205 | [platform2]/. |
| 206 | * `$PROJECT/`: Each project gets its own repo. |
| 207 | * [`platform2/`][platform2]: Combined git repo for Chromium OS system |
| 208 | projects. Used to help share code, libraries, build, and test logic. |
| 209 | * [`repohooks/`][repohooks]: Hooks used by the `repo` tool. Most notably, |
| 210 | these are the test run at `repo upload` time to verify CLs. |
| 211 | * `third_party/`: Projects that were not written by Chromium OS project, |
| 212 | or projects that are intended to be used beyond CrOS. |
| 213 | * `$PROJECT/`: Each project gets its own repo. |
| 214 | * `external/`: Mirrors of various external projects. |
| 215 | * `$HOST/`: Domain name for the hosting site. e.g. `github.com`. |
| 216 | Subpaths here tend to reflect the structure of the hosting site. |
| 217 | |
| 218 | ### Internal Chrome GoB |
| 219 | |
| 220 | This is the internal https://chrome-internal.googlesource.com/ site. |
| 221 | |
| 222 | The majority of repos should live under `overlays/`, `platform/`, or |
| 223 | `third_party/`. |
| 224 | It's very uncommon to create projects outside of those paths. |
| 225 | If you want to create a new project somewhere else, please check with the |
| 226 | build/infra team first using [[email protected]][Contact]. |
| 227 | |
| 228 | * `android/`: Mirrors of internal Android projects. Should use the same |
| 229 | layout as on the [AOSP GoB] host. |
| 230 | * `chrome/`: Chrome (the browser) related projects. These are managed |
| 231 | entirely by the browser team. |
| 232 | * `chromeos/`: Chrome OS related projects. Most Chrome OS people will only |
| 233 | ever work on projects under these paths. |
| 234 | * `overlays/`: Separate git repos for internal partner repos to simplify |
| 235 | sharing with specific partners. |
| 236 | * `baseboard-*-private/`: Internal base boards shared with specific |
| 237 | partners. |
| 238 | * `chipset-*-private/`: Internal chipsets shared with specific |
| 239 | partners. |
| 240 | * [`chromeos-overlay/`][chromeos-overlay]: Chrome OS settings & |
| 241 | packages (not Chromium OS) not shared with partners. |
| 242 | * [`chromeos-partner-overlay/`][chromeos-partner-overlay]: Chrome OS |
| 243 | settings & packages shared with all partners. |
| 244 | * `overlay-*-private/`: Internal boards shared with specific partners. |
| 245 | * `project-*-private/`: Internal projects shared with specific |
| 246 | partners. |
| 247 | * `platform/`: Internal projects written by the Chrome OS project, or some |
| 248 | Google-authored projects. Most projects should be open source though and |
| 249 | live in the [Chromium GoB] instead. |
| 250 | * `third_party/`: Internal projects that were not written by Chromium OS. |
| 251 | Often used for early work before being made public, or to hold some code |
| 252 | from partners. |
| 253 | * `vendor/`: Various partner-specific projects like bootloaders or firmware. |
| 254 | * `external/`: Mirrors of other projects. |
| 255 | * `gob/`: Mirrors of other GoB instances. Uses a $GOB_NAME subdir followed |
| 256 | by the path as it exists on the remote GoB server. |
| 257 | |
Mike Frysinger | 01a5f36 | 2018-10-18 21:21:18 | [diff] [blame] | 258 | ## Branch naming |
| 259 | |
| 260 | We have a few conventions when it comes to branch names in our repos. |
| 261 | Not all repos follow all these rules, but moving forward new repos should. |
| 262 | |
| 263 | When cloning/syncing git repos, only `heads/` and `tags/` normally get synced. |
| 264 | Any other refs stay on the server and are accessed directly. |
| 265 | |
| 266 | Note: All the paths here assume a `refs/` prefix on them. |
| 267 | So when using `git push`, make sure to use `refs/heads/xxx` and not just `xxx` |
| 268 | to refer to the remote ref. |
| 269 | |
| 270 | * `tags/`: CrOS doesn't use git tags normally. Repos that do tend to do so |
| 271 | for their own arbitrary usage. If they are used, they should follow the |
| 272 | [SemVerTag] format (e.g. `v1.2.3`). |
| 273 | * `heads/`: The majority of CrOS development happens under these branches. |
| 274 | * `factory-xxx`: Every device gets a unique branch for factory purposes. |
| 275 | Factory developers tend to be the only ones who work on these. |
| 276 | Typically it uses `<device>-<OS major version>.B` names. |
| 277 | * `firmware-xxx`: Every device gets a unique branch for maintaining a |
| 278 | stable firmware release. Firmware developers tend to be the only ones |
| 279 | who work on these. Typically it uses `<device>-<OS major version>.B` |
| 280 | names. |
| 281 | * `master`: The normal ToT branch where current development happens. |
| 282 | * `release-xxx`: Every release gets a unique branch. When developers |
| 283 | need to cherry pick back changes to releases to fix bugs, these are |
| 284 | the branches they work on. Typically it uses |
| 285 | `R<milestone>-<OS major version>.B` names. |
| 286 | * `stabilize-xxx`: Temporary branches used for testing new releases. |
| 287 | Developers pretty much never work with these and they're managed by |
| 288 | TPMs. Typically it uses `<OS major version>.B` names. |
| 289 | * `sandbox/`: Arbitrary developer scratch space. See the [sandbox] |
| 290 | documentation for more details. |
| 291 | |
| 292 | ### Automatic m/ repo refs |
| 293 | |
| 294 | Locally, repo provides some pseudo refs to help developers. |
| 295 | It uses the `m/xxx` style where `xxx` is the branch name used when running |
| 296 | `repo init`. |
| 297 | It often matches the actual git branch name used in the git repo, but there is |
| 298 | no such requirement. |
| 299 | |
| 300 | For example, when getting a repo checkout of the master branch (i.e. after |
| 301 | running `repo init -b master`), every git repo will have a pseudo `m/master` |
| 302 | that points to the branch associated with that project in the [manifest]. |
| 303 | In chromite, `m/master` will point to `heads/master`, but in bluez, `m/master` |
| 304 | will point to `heads/chromeos`. |
| 305 | |
| 306 | In another example, when getting a repo checkout of the R70 release branch (i.e. |
| 307 | after running `repo init -b release-R70-11021.B`), every git repo will have a |
| 308 | pseudo `m/release-R70-11021.B` that points to the branch associated with that |
| 309 | project in the [manifest]. |
| 310 | In chromite, `m/release-R70-11021.B` will point to `heads/release-R70-11021.B`, |
| 311 | but in kernel/v4.14, `m/release-R70-11021.B-chromeos-4.14`. |
| 312 | |
| 313 | ### Other refs |
| 314 | |
| 315 | There are a few additional paths that you might come across, although they |
| 316 | aren't commonly used, or at least directly. |
| 317 | |
| 318 | * `changes/`: Read-only paths used by Gerrit to expose uploaded CLs and their |
| 319 | various patchsets. See the [Gerrit refs/for] docs for more details. |
| 320 | * `for/xxx`: All paths under `for/` are a Gerrit feature for uploading commits |
| 321 | for Gerrit review in the `xxx` branch. See the [Gerrit refs/for] docs for |
| 322 | more details. |
| 323 | * `infra/config`: Branch used by [LUCI] for configuring that service. |
| 324 | * `meta/config`: Branch for storing per-repo Gerrit settings & ACLs. Usually |
| 325 | people use the [Admin UI] in each GoB to manage these settings indirectly, |
| 326 | but users can manually check this out and upload CLs by hand for review. |
| 327 | See the [Gerrit project config] docs for more details. |
| 328 | |
| 329 | ### Local heads/ namespaces |
| 330 | |
| 331 | You might see that, depending on the repo, the remote branches look like |
| 332 | `remotes/cros/xxx` or `remotes/cros-internal/xxx` or `remotes/aosp/xxx`. |
| 333 | The `cros` and such names come from the `remote` name used in the [manifest] |
| 334 | for each `project` element. |
| 335 | |
| 336 | For example, the [manifest] has: |
| 337 | ```xml |
| 338 | <manifest> |
| 339 | <remote name="cros" |
| 340 | fetch="https://chromium.googlesource.com" |
| 341 | review="https://chromium-review.googlesource.com" /> |
| 342 | |
| 343 | <default revision="refs/heads/master" |
| 344 | remote="cros" sync-j="8" /> |
| 345 | |
| 346 | <project path="chromite" name="chromiumos/chromite" ?> |
| 347 | <project path="src/aosp/external/minijail" |
| 348 | name="platform/external/minijail" |
| 349 | remote="aosp" /> |
| 350 | </manifest> |
| 351 | ``` |
| 352 | |
| 353 | The `default` element sets `remote` to `cros`, so that's why it shows up in |
| 354 | the chromite (whose `project` omits `remote`) repo as `remotes/cros/xxx`. |
| 355 | |
| 356 | The minijail project has an explicit `remote=aosp`, so that's why it shows up |
| 357 | as `remotes/aosp/xxx` in the local checkout. |
| 358 | |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 359 | ## FAQ |
| 360 | |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 361 | ### How do I create a new repository on the server? {#server-new-repo} |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 362 | |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 363 | File a bug for the [Infra>Git>Admin rotation]. |
| 364 | All these bugs are marked [RVG] by default so providing non-public info is OK. |
| 365 | ~24hr respone time can be expected. |
| 366 | |
| 367 | Please do not ask specific people to create repositories for you, even if you |
| 368 | happen to know they might have credentials to do so. |
| 369 | The bug queue above goes into an oncall rotation queue to help distribute load. |
| 370 | |
| 371 | If you are not a committer, make sure to mention someone by their @chromium.org |
| 372 | or @google.com address who can help vouch/verify the request. |
| 373 | |
| 374 | Be sure to fill out the template, and to provide these details: |
| 375 | * The name of the new repository on the server. |
| 376 | * See the [Server Layout] section above for examples. |
| 377 | * Whether it should be a read-only mirror, a fork of an upstream project, or |
| 378 | a completely new (empty) project. |
| 379 | * Any non-standard permissions/access to the repository. |
| 380 | NB: We try to avoid this, but we may consider anything that is reasonable |
| 381 | and allowed by our [security policy](./contributing.md#policies). |
| 382 | |
| 383 | Feel free to provide any other information you think would help with processing |
| 384 | the request. |
| 385 | We don't usually need full details (e.g. [PRD]/design docs), but usually "too |
| 386 | much information" is not the problem we have :). |
| 387 | |
| 388 | ### How do I mirror an upstream repository onto the git server? |
| 389 | |
| 390 | See the [How do I create a new repository on the server?](#server-new-repo) |
| 391 | FAQ above. |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 392 | |
| 393 | ### How do I add a repo to the manifest? |
| 394 | |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 395 | *** note |
| 396 | The repository must already exist on the server. |
| 397 | See [How do I create a new repository on the server?](#server-new-repo) first. |
| 398 | *** |
| 399 | |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 400 | If the repo is public (i.e. exists on the [Chromium GoB]), then update the |
Navil Perez | afe05b2 | 2020-05-26 18:16:58 | [diff] [blame] | 401 | [internal full.xml] file in the internal [manifest-internal] repo. |
| 402 | Do not modify the [full.xml] file in the public [manifest] repo. The public |
| 403 | [manifest] repo will automatically sync with the internal [manifest-internal] |
| 404 | repo. |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 405 | |
| 406 | If the repo is private (i.e. exists on the [Chrome GoB]), then update the |
| 407 | [internal_full.xml] file in the internal [manifest-internal] repo. |
| 408 | |
| 409 | You can follow the examples in the files already. |
| 410 | |
| 411 | ### How do I change branches for an existing repo? |
| 412 | |
| 413 | Set the `revision` attribute in the relevant `<project .../>` element in the |
| 414 | manifest files. |
| 415 | |
| 416 | See the previous question about adding a repo for details on which repos you |
| 417 | will need to update. |
| 418 | |
| 419 | ### How do I test a manifest change? |
| 420 | |
| 421 | The [manifest] and [manifest-internal] repos in the checkout are purely for |
| 422 | developer convenience in making & uploading changes. |
| 423 | They are not used for anything else. |
| 424 | |
| 425 | When you run `repo sync` in your checkout, that only looks at the manifest under |
| 426 | the `.repo/manifests/` directory. |
| 427 | That is an independent checkout of the manifest that was specified originally |
| 428 | when running `repo init`. |
| 429 | |
| 430 | So the flow is usually: |
| 431 | |
| 432 | * Write the CLs in [manifest] and [manifest-internal]. |
| 433 | * Extract the change from the relevant repo. |
| 434 | * Use `git format-patch -1` to create a patch you can apply. |
| 435 | * If you're using a private checkout, then extract it from |
| 436 | [manifest-internal]. |
| 437 | * If you're using a public checkout, then extract it from [manifest]. |
| 438 | * Apply the change to the local directory. |
| 439 | * Run `cd .repo/manifests/`. |
| 440 | * Use `git am` to apply the patch from above. |
| 441 | * Run `repo sync` to use the modified manifest. |
| 442 | * Do whatever testing/validation as makes sense. |
| 443 | |
| 444 | At this point, your checkout is in a modified state. |
| 445 | That means any CLs other people are landing to the manifest will be pulled in |
| 446 | when you run `repo sync`. |
| 447 | If those changes cause conflicts, your checkout won't sync properly. |
| 448 | Thus your final step should be to remove your changes. |
| 449 | |
| 450 | * Reset the branch back to the remote state. |
| 451 | This will throw away all local changes! |
| 452 | * You can usually run the following commands: |
| 453 | ``` |
| 454 | # This might say "No rebase in progress" which is OK. |
| 455 | git rebase --abort |
| 456 | git reset --hard HEAD^ |
| 457 | git checkout -f |
| 458 | ``` |
| 459 | * If those "simple" commands didn't work, try this more complicated one: |
| 460 | ``` |
| 461 | git reset --hard "remotes/$(git config --get branch.default.remote)/$(basename "$(git config --get branch.default.merge)")" |
| 462 | ``` |
| 463 | * If those commands don't work, you basically want to figure out what the |
| 464 | remote branch is currently at and reset to it. |
| 465 | |
| 466 | If your manifest CL hasn't landed yet, then when you run `repo sync`, the |
| 467 | changes you made will be lost. |
| 468 | So if you were adding a repo, it will be deleted again from the checkout. |
| 469 | If you were removing a repo, it will be added again to the checkout. |
| 470 | |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 471 | ### How do I initialize a new repository? |
| 472 | |
| 473 | Once the repository is in the manifest (see the previous FAQs), you can |
| 474 | `repo sync` to get it locally, and then add/commit/upload files like normal. |
| 475 | |
| 476 | The manifest CLs do not need to be merged first -- if you want to generate |
| 477 | content ahead of time, you can use the testing steps above to add it to your |
| 478 | local manifest, and then start uploading CLs right away. |
| 479 | |
| 480 | ### How do I create a new branch/tag in a repository on the git server? |
| 481 | |
| 482 | You don't :). |
| 483 | File a bug for the [Infra>Git>Admin rotation] with your exact request and you |
| 484 | should hear back within ~24hrs. |
| 485 | |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 486 | ### Where do I put ebuilds only for Googlers and internal Chrome OS builds? |
| 487 | |
| 488 | The [chromeos-overlay] holds all packages & settings for this. |
| 489 | It is not made public or shared with any partners, so this is for restricted |
| 490 | packages and features only. |
| 491 | |
| 492 | ### Where do I put ebuilds to share with partners? |
| 493 | |
| 494 | The [chromeos-partner-overlay] holds all packages & settings for this. |
| 495 | It is not made public, but it is shared among *all* partners. |
| 496 | |
| 497 | If you want to share a package with specific partners for a specific board, |
| 498 | then put it in the respective `src/private-overlays/xxx-private/` overlay. |
| 499 | |
| 500 | ### Can I put ebuilds for private changes into public overlays? |
| 501 | |
| 502 | No. |
| 503 | All ebuilds in public overlays must be usable by the public. |
| 504 | Even if the ebuild itself contains no secret details (e.g. it just installs a |
| 505 | binary from a tarball), if the tarball is not publicly available, then we do |
| 506 | not put the ebuild in the public overlays. |
| 507 | |
| 508 | Use one of the respective private overlays instead. |
| 509 | See the previous questions in this FAQ for more details. |
| 510 | |
| 511 | |
Mike Frysinger | 01a5f36 | 2018-10-18 21:21:18 | [diff] [blame] | 512 | [Admin UI]: https://chromium-review.googlesource.com/admin/repos |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 513 | [AOSP GoB]: https://android.googlesource.com/ |
| 514 | [Chrome GoB]: https://chrome-internal.googlesource.com/ |
| 515 | [chromeos-overlay]: https://chrome-internal.googlesource.com/chromeos/overlays/chromeos-overlay/ |
| 516 | [chromeos-partner-overlay]: https://chrome-internal.googlesource.com/chromeos/overlays/chromeos-partner-overlay/ |
| 517 | [chromite]: https://chromium.googlesource.com/chromiumos/chromite/ |
| 518 | [Chromium GoB]: https://chromium.googlesource.com/ |
| 519 | [chromiumos-overlay]: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/ |
| 520 | [chroot]: filesystem_layout.md#SDK |
Brian Norris | e15bb05 | 2019-04-15 19:29:50 | [diff] [blame] | 521 | [Cq-Depend]: contributing.md#CQ-DEPEND |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 522 | [Contact]: contact.md |
| 523 | [contrib]: https://chromium.googlesource.com/chromiumos/platform/dev-util/+/HEAD/contrib/ |
| 524 | [cros-signing]: https://chrome-internal.googlesource.com/chromeos/cros-signing/ |
| 525 | [crostools]: https://chrome-internal.googlesource.com/chromeos/crostools/ |
| 526 | [crosutils]: https://chromium.googlesource.com/chromiumos/platform/crosutils/ |
| 527 | [dev-util]: https://chromium.googlesource.com/chromiumos/platform/dev-util/ |
| 528 | [docs-internal]: https://chrome-internal.googlesource.com/chromeos/docs/ |
| 529 | [docs]: https://chromium.googlesource.com/chromiumos/docs/ |
| 530 | [eclass-overlay]: https://chromium.googlesource.com/chromiumos/overlays/eclass-overlay/ |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 531 | [Infra>Git>Admin rotation]: https://bugs.chromium.org/p/chromium/issues/entry?template=Infra-Git |
| 532 | [internal full.xml]: https://chrome-internal.googlesource.com/chromeos/manifest-internal/+/HEAD/full.xml |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 533 | [filesystem layout]: filesystem_layout.md |
| 534 | [full.xml]: https://chromium.googlesource.com/chromiumos/manifest/+/HEAD/full.xml |
Mike Frysinger | 01a5f36 | 2018-10-18 21:21:18 | [diff] [blame] | 535 | [Gerrit project config]: https://www.gerritcodereview.com/config-project-config.html |
| 536 | [Gerrit refs/for]: https://www.gerritcodereview.com/concept-refs-for-namespace.html |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 537 | [internal_full.xml]: https://chrome-internal.googlesource.com/chromeos/manifest-internal/+/HEAD/internal_full.xml |
| 538 | [kernel]: https://chromium.googlesource.com/chromiumos/third_party/kernel/ |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 539 | [Local Checkout]: #local-layout |
Mike Frysinger | 9fc0fc0 | 2020-09-05 05:18:57 | [diff] [blame] | 540 | [Local manifests]: https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md#Local-Manifests |
Mike Frysinger | 01a5f36 | 2018-10-18 21:21:18 | [diff] [blame] | 541 | [LUCI]: https://chromium.googlesource.com/infra/luci/luci-py/ |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 542 | [manifest]: https://chromium.googlesource.com/chromiumos/manifest/ |
| 543 | [manifest-internal]: https://chrome-internal.googlesource.com/chromeos/manifest-internal/ |
| 544 | [board-overlays]: https://chromium.googlesource.com/chromiumos/overlays/board-overlays/ |
Evan Benn | 6a6383b | 2019-10-31 23:01:07 | [diff] [blame] | 545 | [Package Upgrade Process]: portage/package_upgrade_process.md |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 546 | [platform2]: https://chromium.googlesource.com/chromiumos/platform2/ |
| 547 | [portage-stable]: https://chromium.googlesource.com/chromiumos/overlays/portage-stable/ |
| 548 | [portage_tool]: https://chromium.googlesource.com/chromiumos/third_party/portage_tool/ |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 549 | [PRD]: glossary.md#PRD |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 550 | [repo]: https://gerrit.googlesource.com/git-repo |
| 551 | [repohooks]: https://chromium.googlesource.com/chromiumos/repohooks/ |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 552 | [RVG]: glossary.md#RVG |
Mike Frysinger | 01a5f36 | 2018-10-18 21:21:18 | [diff] [blame] | 553 | [sandbox]: contributing.md#sandbox |
Mike Frysinger | d0e557a | 2020-05-22 06:49:15 | [diff] [blame] | 554 | [Server Layout]: #server-layout |
Mike Frysinger | 01a5f36 | 2018-10-18 21:21:18 | [diff] [blame] | 555 | [SemVerTag]: https://semver.org/spec/v1.0.0.html#tagging-specification-semvertag |
Mike Frysinger | 4e9caf4 | 2018-10-09 04:17:16 | [diff] [blame] | 556 | [vboot_reference]: https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ |
| 557 | [VM/containers]: containers_and_vms.md |