Skip to content

Commit 0cb6d91

Browse files
Makefile: Allow downstream config in site-local/config
Allow downstreams to add config to site-local/config, which can set config options, including overriding board config and exporting config to /etc/config. The intent of site-local is exactly the same as in coreboot - it is a place for downstreams to add customizations that are included at well- defined points in the build. site-local should never appear in the upstream repository. coreboot's documentation explains this as well: https://doc.coreboot.org/tutorial/managing_local_additions.html Move definitions of ROM artifacts later, so site config can override BRAND_NAME (and still is included after board config to override it as well). Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
1 parent 12a099a commit 0cb6d91

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ HEADS_GIT_VERSION := $(shell git describe --abbrev=7 --tags --dirty)
1212
# Override BRAND_NAME to set the name displayed in the UI, filenames, versions, etc.
1313
BRAND_NAME ?= Heads
1414

15-
CB_OUTPUT_BASENAME := $(shell echo $(BRAND_NAME) | tr A-Z a-z)-$(BOARD)-$(HEADS_GIT_VERSION)
16-
CB_OUTPUT_FILE := $(CB_OUTPUT_BASENAME).rom
17-
CB_OUTPUT_FILE_GPG_INJ := $(CB_OUTPUT_BASENAME)-gpg-injected.rom
18-
CB_BOOTBLOCK_FILE := $(CB_OUTPUT_BASENAME).bootblock
19-
CB_UPDATE_PKG_FILE := $(CB_OUTPUT_BASENAME).zip
20-
LB_OUTPUT_FILE := linuxboot-$(BOARD)-$(HEADS_GIT_VERSION).rom
21-
2215
all:
2316
-include .config
2417

@@ -59,6 +52,20 @@ CONFIG_LEGACY_FLASH := n
5952

6053
include $(CONFIG)
6154

55+
# Include site-local/config only if it exists, downstreams can set configs for
56+
# all boards, including overriding values specified by boards. site-local is
57+
# not a part of the upstream distribution but is for downstreams to insert
58+
# customizations at well-defined points, like in coreboot:
59+
# https://doc.coreboot.org/tutorial/managing_local_additions.html
60+
-include $(pwd)/site-local/config
61+
62+
CB_OUTPUT_BASENAME := $(shell echo $(BRAND_NAME) | tr A-Z a-z)-$(BOARD)-$(HEADS_GIT_VERSION)
63+
CB_OUTPUT_FILE := $(CB_OUTPUT_BASENAME).rom
64+
CB_OUTPUT_FILE_GPG_INJ := $(CB_OUTPUT_BASENAME)-gpg-injected.rom
65+
CB_BOOTBLOCK_FILE := $(CB_OUTPUT_BASENAME).bootblock
66+
CB_UPDATE_PKG_FILE := $(CB_OUTPUT_BASENAME).zip
67+
LB_OUTPUT_FILE := linuxboot-$(BOARD)-$(HEADS_GIT_VERSION).rom
68+
6269
# Unless otherwise specified, we are building for heads
6370
CONFIG_HEADS ?= y
6471

0 commit comments

Comments
 (0)