xref: /aosp_15_r20/external/coreboot/Documentation/tutorial/managing_local_additions.md (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1Managing local additions
2========================
3
4This section describes the site-local mechanism, what it is good for and
5how it can be used.
6
7What is site-local?
8-------------------
9site-local is the name of a directory that won't ever appear in the
10upstream coreboot repository but is referred to in several key places of its
11configuration and build system. The intent is provide a single location to
12store local modifications.
13
14By keeping local additions to builds in this place, it can be versioned
15independently from upstream (e.g. controlled by git in another repository)
16and any changes made there won't ever conflict with upstream changes.
17
18This optional directory is searched for in the top-level of the coreboot
19repo and is called `site-local`.
20
21Integration into the configuration system
22-----------------------------------------
23Kconfig includes `site-local/Kconfig` relatively early, so it can be used
24to pre-define some configuration before coreboot's regular ruleset sets
25up defaults.
26
27Integration into the build system
28---------------------------------
29The build system includes, if present, `site-local/Makefile.inc`. The main
30purpose so far has been to add additional files to a CBFS image. A single
31Makefile.inc can serve multiple boards, for example:
32
33    cbfs-files-$(CONFIG_BOARD_INTEL_D945GCLF) += pci8086,2772.rom
34    pci8086,2772.rom-file := intel_d945gclf/pci8086,2772.rom
35    pci8086,2772.rom-type := optionrom
36
37    cbfs-files-$(CONFIG_BOARD_KONTRON_986LCD_M) += pci8086,27a2.rom
38    pci8086,27a2.rom-file := kontron_986lcd-m/pci8086,27a2.rom
39    pci8086,27a2.rom-type := optionrom
40
41This adds the correct Option ROM binary (which are non-redistributable and
42therefore can't become part of the coreboot.org repos) to coreboot.rom when
43built for intel/d945gclf or kontron/986lcd-m.
44