Skip to contentSkip to conversation

Makefile: Create a file to indicate the config

PATCH Superseded Simon Glass 1 participant 2 messages Aug 7, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Makefile: Create a file to indicate the config

At present it is not actually possible to discover the defconfig file that was used to build U-Boot, so far as I can tell. Write this out to a file in the build directory, so this is visible.

---

 scripts/kconfig/Makefile | 2 ++
 1 file changed, 2 insertions(+)
scripts/kconfig/Makefile +2 -0
index d52128425ce..bfb92a50bf9 100644
@@ -92,8 +92,10 @@ else
 endif
 endif
 
+# Write out the defconfig name to a file so we know which board was configured
 %_defconfig: $(obj)/conf
 	$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
+	$(Q)echo $(subst _defconfig,,$@) > .defconfig_name
 
 # Added for U-Boot (backward compatibility)
 %_config: %_defconfig
Signature · 1 line
2.32.0.605.g8dce9f2422-goog
#1 lore raw

PATCH 2/2 Makefile: Don't allow new boards with SPL_FIT_GENERATOR

More than a year after this migration message appeared, we still have new boards being added with this option. Add a check against this.

---

 Makefile                      |  6 +++
 scripts/fit_gen_whitelist.txt | 89 +++++++++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+)
 create mode 100644 scripts/fit_gen_whitelist.txt
Makefile +6 -0
index 269e353a28a..49d09550337 100644
@@ -1110,6 +1110,12 @@ ifeq ($(CONFIG_OF_EMBED),y)
 	@echo >&2 "===================================================="
 endif
 ifneq ($(CONFIG_SPL_FIT_GENERATOR),)
+	# Only allow existing users of this deprecated option. Please migrate!
+	@if ! grep -q $(shell cat .defconfig_name) \
+			$(srctree)/scripts/fit_gen_whitelist.txt; then \
+		echo >&2 "Error: CONFIG_SPL_FIT_GENERATOR is deprecated"; \
+		exit 1; \
+	fi
 	@echo >&2 "===================== WARNING ======================"
 	@echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate"
 	@echo >&2 "to binman instead, to avoid the proliferation of"
scripts/fit_gen_whitelist.txt new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
2.32.0.605.g8dce9f2422-goog