[coreboot-gerrit] Patch set updated for coreboot: Makefile.inc: error if UPDATE_IMAGE is enabled with no coreboot.rom

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Mon Jan 25 23:20:08 CET 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13065

-gerrit

commit fa966075c71e9e9b3ce9fc781108402139ac6f25
Author: Martin Roth <martinroth at google.com>
Date:   Wed Jan 20 14:54:27 2016 -0700

    Makefile.inc: error if UPDATE_IMAGE is enabled with no coreboot.rom
    
    Instead of just failing with the statement:
    'mv: cannot stat ‘coreboot.rom’: No such file or directory',
    fail with an error that helps the user understand the issue.
    
    Change-Id: Ie693d45710f599991514e0803a7c444636e473c9
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 Makefile.inc | 35 +++++++++++------------------------
 1 file changed, 11 insertions(+), 24 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index a1f6658..3783695 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -13,7 +13,7 @@
 ## GNU General Public License for more details.
 ##
 
-GIT:=$(shell [ -e "$(top)/.git" ] && command -v git)
+GIT:=$(shell [ -d "$(top)/.git" ] && command -v git)
 
 #######################################################################
 # normalize Kconfig variables in a central place
@@ -112,7 +112,6 @@ spc :=
 spc +=
 $(spc) :=
 $(spc) +=
-comma := ,
 
 # files-in-dir-recursive,dir,files
 files-in-dir-recursive=$(filter $(1)%,$(2))
@@ -649,18 +648,6 @@ $(objcbfs)/%.elf: $(objcbfs)/%.debug
 # 4) replace all '*' characters with spaces
 extract_nth=$(subst *,$(spc),$(patsubst -%-,%,$(word $(1), $(subst |,- -,-$(2)-))))
 
-# regions-for-file - Returns a cbfstool regions parameter
-# $(call regions-for-file,$(filename))
-# returns "REGION1,REGION2,..."
-#
-# This is the default implementation. When using a boot strategy employing
-# multiple CBFSes in fmap regions, override it.
-regions-for-file ?= COREBOOT
-
-ifeq ($(CONFIG_CBFS_AUTOGEN_ATTRIBUTES),y)
-	cbfs-autogen-attributes=-g
-endif
-
 cbfs-add-cmd = \
                printf "    CBFS       $(call extract_nth,2,$(file))\n"; \
 	       $(CBFSTOOL) $@.tmp \
@@ -668,8 +655,7 @@ cbfs-add-cmd = \
 	       -f $(call extract_nth,1,$(file)) \
 	       -n $(call extract_nth,2,$(file)) \
 	       $(if $(filter-out stage,$(call extract_nth,3,$(file))),-t $(call extract_nth,3,$(file))) \
-	       $(if $(call extract_nth,4,$(file)),-c $(call extract_nth,4,$(file))) $(cbfs-autogen-attributes)\
-	       -r $(call regions-for-file,$(call extract_nth,2,$(file))) \
+	       $(if $(call extract_nth,4,$(file)),-c $(call extract_nth,4,$(file))) \
 	       $(call extract_nth,7,$(file))
 
 cbfs-files=$(cbfs-files-fixed) $(cbfs-files-aligned) $(cbfs-files-regular)
@@ -733,20 +719,19 @@ endif # ($(CONFIG_FMDFILE),)
 
 # generated at the same time as fmap.fmap
 $(obj)/fmap.h: $(obj)/fmap.fmap
-$(obj)/fmap.desc: $(obj)/fmap.fmap
 
 $(obj)/fmap.fmap: $(obj)/fmap.fmd $(FMAPTOOL)
 	echo "    FMAP       $(FMAPTOOL) -h $(obj)/fmap.h $< $@"
-	$(FMAPTOOL) -h $(obj)/fmap.h -R $(obj)/fmap.desc $< $@
+	$(FMAPTOOL) -h $(obj)/fmap.h $< $@
 
-$(obj)/coreboot.pre: $(objcbfs)/bootblock.bin $$(prebuilt-files) $(CBFSTOOL) $$(cpu_ucode_cbfs_file) $(obj)/fmap.fmap $(obj)/fmap.desc
-	$(CBFSTOOL) $@.tmp create -M $(obj)/fmap.fmap -r $(shell cat $(obj)/fmap.desc)
+$(obj)/coreboot.pre: $(objcbfs)/bootblock.bin $$(prebuilt-files) $(CBFSTOOL) $$(cpu_ucode_cbfs_file) $(obj)/fmap.fmap
+	$(CBFSTOOL) $@.tmp create -M $(obj)/fmap.fmap
 ifeq ($(CONFIG_ARCH_X86),y)
 	$(CBFSTOOL) $@.tmp add \
 		-f $(objcbfs)/bootblock.bin \
 		-n bootblock \
 		-t bootblock \
-		-b -$(call file-size,$(objcbfs)/bootblock.bin) $(cbfs-autogen-attributes)
+		-b -$(call file-size,$(objcbfs)/bootblock.bin)
 else # ($(CONFIG_ARCH_X86),y)
 	# don't add bootblock to cbfs yet, it's just a waste of space
 	true $(CBFSTOOL) $@.tmp add \
@@ -777,12 +762,14 @@ prebuild-files = \
 	$(foreach file,$(cbfs-files), \
 	$(CBFSTOOL) $@.tmp remove -n $(call extract_nth,2,$(file)) 2>/dev/null ; \
 	       $(if $(call extract_nth,6,$(file)),$(cbfs-add-cmd) -a $(call extract_nth,6,$(file)) &&,\
-	       $(cbfs-add-cmd) $(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file))) \
-	       $(cbfs-autogen-attributes) &&))
+	       $(cbfs-add-cmd) $(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file))) &&))
 
 .PHONY: $(obj)/coreboot.pre
 $(obj)/coreboot.pre: $$(prebuilt-files) $(CBFSTOOL)
-	mv $(obj)/coreboot.rom $@.tmp
+	mv $(obj)/coreboot.rom $@.tmp | \
+	(echo "Error: You have UPDATE_IMAGE set in Kconfig, but have no existing image to update." && \
+	echo "Exiting." && \
+	false)
 	$(prebuild-files) true
 	mv $@.tmp $@
 endif # ($(CONFIG_UPDATE_IMAGE),y)



More information about the coreboot-gerrit mailing list