[coreboot-gerrit] Change in coreboot[master]: depthcharge: Update build

Martin Roth (Code Review) gerrit at coreboot.org
Thu Jul 20 17:11:11 CEST 2017


Martin Roth has uploaded this change for review. ( https://review.coreboot.org/20667


Change subject: depthcharge: Update build
......................................................................

depthcharge: Update build

- Add prompt so the defconfig can be selected for the build.
- Remove target rename code from makefile.  The old versions don't build
with the latest vboot, so this isn't useful anymore.
- Change $(info ...) to an echo.  info prints immediately when
evaluated, which made it print when it shouldn't have, on make clean
for example.
- Split up single line shell scripts into multiple lines
- Change checkout target to only update the commit id when actually
changing versions instead of on every build.

Change-Id: I46fc2822cf93c821b402e8961ceecedc088f486c
Signed-off-by: Martin Roth <martinroth at google.com>
---
M payloads/external/depthcharge/Kconfig
M payloads/external/depthcharge/Makefile
2 files changed, 31 insertions(+), 23 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/20667/1

diff --git a/payloads/external/depthcharge/Kconfig b/payloads/external/depthcharge/Kconfig
index a913c7e..9fd1268 100644
--- a/payloads/external/depthcharge/Kconfig
+++ b/payloads/external/depthcharge/Kconfig
@@ -36,7 +36,7 @@
 	default "payloads/external/depthcharge/depthcharge/build/depthcharge.elf"
 
 config LP_DEFCONFIG_OVERRIDE
-	def_bool n
+	bool "Use default libpayload config"
 	help
 	  The Depthcharge makefile looks for a file config.<boardname> in the
 	  libpayload/configs directory.  Say Y here to use the file defconfig
diff --git a/payloads/external/depthcharge/Makefile b/payloads/external/depthcharge/Makefile
index fb2d96d..beb159a 100644
--- a/payloads/external/depthcharge/Makefile
+++ b/payloads/external/depthcharge/Makefile
@@ -15,11 +15,6 @@
 TAG-$(DEPTHCHARGE_STABLE)=$(STABLE_COMMIT_ID)
 TAG-$(DEPTHCHARGE_REVISION)=$(DEPTHCHARGE_REVISION_ID)
 
-# todo: consider reverting this once stable moves past the commit below
-payload_target=depthcharge
-payload_target_old=$(payload_target)_unified
-payload_namechange=74a07395eb9976747055b4ac7a0ae7dcb603a6f4
-
 unexport KCONFIG_AUTOHEADER
 unexport KCONFIG_AUTOCONFIG
 unexport KCONFIG_DEPENDENCIES
@@ -31,57 +26,70 @@
 BOARD:=$(notdir $(CONFIG_MAINBOARD_DIR))
 
 ifeq ($(OVERRIDE_DEFCONFIG),y)
-$(info Depthcharge: Using default defconfig for libpayload)
 libpayload_config=$(libpayload_dir)/configs/defconfig
+DEPTHCHARGE_LIBPAYLOAD_MSG="Depthcharge: Using default defconfig for libpayload"
 else
 libpayload_config=$(libpayload_dir)/configs/config.$(BOARD)
+DEPTHCHARGE_LIBPAYLOAD_MSG="Depthcharge: Using $(libpayload_dir)/configs/config.$(BOARD)"
 endif
 
 all: build
 
 $(project_dir):
-	echo "    Cloning $(project_name) from Git"
-	git clone $(project_git_repo)
+	@echo "    Cloning $(project_name) from Git"
+	@git clone $(project_git_repo) $(project_name)
 
 fetch: $(project_dir)
-	cd $(project_dir); git show $(TAG-y) >/dev/null 2>&1 ;	if [ $$? -ne 0 ] || \
+	@cd $(project_dir); \
+	 	git show $(TAG-y) >/dev/null 2>&1 ;\
+		if [ $$? -ne 0 ] || \
 		[ "$(TAG-y)" = "origin/master" ]; then \
 		echo "    Fetching new commits from the $(project_name) git repo"; \
 		git fetch; fi
 
-checkout: fetch
+# Check out the requested version of the tree
+# Don't write a file for master branch so the latest remote version is always used
+$(project_dir)/.version_$(TAG-y):
+	$(MAKE) fetch
 	echo "    Checking out $(project_name) revision $(TAG-y)"
-	cd $(project_dir) ; git checkout master; git branch -D coreboot 2>/dev/null; git checkout -b coreboot $(TAG-y)
+	rm -f $(project_dir)/.version_*
+	cd $(project_dir); \
+		git checkout master; \
+		git branch -D coreboot 2>/dev/null; \
+		git checkout -b coreboot $(TAG-y)
+ifneq ($(DEPTHCHARGE_MASTER),y)
+	touch $(project_dir)/.version_$(TAG-y)
+endif
 
 $(libpayload_install_dir): $(project_dir)
-	test -f $(libpayload_config)|| \
+	test -f $(libpayload_config) || \
 		(echo "Error: $(libpayload_config) is not present" && \
 		false)
+	echo $(DEPTHCHARGE_LIBPAYLOAD_MSG)
 	cp $(libpayload_config) $(libpayload_dir)/.config
 	$(MAKE) -C $(libpayload_dir) olddefconfig
 	$(MAKE) -C $(libpayload_dir)
 	$(MAKE) -C $(libpayload_dir) install DESTDIR=$(libpayload_install_dir)
-#	rm -f $(libpayload_dir)/.config
 
-config: $(libpayload_install_dir) checkout
+config: $(project_dir)/.version_$(TAG-y) $(libpayload_install_dir)
 	echo "    CONFIG     project_name $(TAG-y)"
 	export VERSION=$$(cd depthcharge && \
 		git describe --tags --long --dirty 2>/dev/null || \
 		echo "unknown") ; \
-	cd $(project_dir) && $(MAKE) BOARD=$(BOARD) LIBPAYLOAD_DIR=$(libpayload_install_dir)/libpayload \
+	cd $(project_dir) && \
+		$(MAKE) BOARD=$(BOARD) \
+		LIBPAYLOAD_DIR=$(libpayload_install_dir)/libpayload \
 		VB_SOURCE=$(VBOOT_SOURCE) defconfig
 
 build: config
 	echo "    MAKE       $(project_name) $(TAG-y)"
-	cd $(project_dir) && \
-		git merge-base --is-ancestor $(payload_namechange) $(TAG-y) >/dev/null 2>&1 && \
-			$(MAKE) BOARD=$(BOARD) LIBPAYLOAD_DIR=$(libpayload_install_dir)/libpayload \
-				VB_SOURCE=$(VBOOT_SOURCE) PATH="$(abspath ../../../build/util/cbfstool):$$PATH" $(payload_target) || \
-			$(MAKE) BOARD=$(BOARD) LIBPAYLOAD_DIR=$(libpayload_install_dir)/libpayload \
-				VB_SOURCE=$(VBOOT_SOURCE) PATH="$(abspath ../../../build/util/cbfstool):$$PATH" $(payload_target_old)
+	$(MAKE) -C $(project_dir) depthcharge BOARD=$(BOARD) \
+		LIBPAYLOAD_DIR=$(libpayload_install_dir)/libpayload \
+		VB_SOURCE=$(VBOOT_SOURCE) \
+		PATH="$(abspath ../../../build/util/cbfstool):$$PATH"
 
 clean:
-	test -d $(output_dir) && rm -rf $(output_dir) || exit 0
+	test -d $(output_dir) && rm -rf $(output_dir)
 
 distclean:
 	rm -rf $(project_dir)

-- 
To view, visit https://review.coreboot.org/20667
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I46fc2822cf93c821b402e8961ceecedc088f486c
Gerrit-Change-Number: 20667
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170720/58b2ac63/attachment.html>


More information about the coreboot-gerrit mailing list