build: Add macro for sha1 checked add-radio-file
This makes it slightly safer in case radio/*.img contains LFS pointer instead of actual blob. Change-Id: Ia3561400c62675eac9f717f7eae74e4cdf71cf45
This commit is contained in:
		@@ -201,3 +201,12 @@ $(strip \
 | 
			
		||||
  $(if $(strip $(acn)),true,) \
 | 
			
		||||
)
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
# $(call add-radio-file-sha1-checked,path,sha1)
 | 
			
		||||
define add-radio-file-sha1-checked
 | 
			
		||||
  $(eval path := $(LOCAL_PATH)/$(1))
 | 
			
		||||
  $(eval sha1 := $(shell sha1sum "$(path)" | cut -d" " -f 1))
 | 
			
		||||
  $(if $(filter $(sha1),$(2)),
 | 
			
		||||
    $(call add-radio-file,$(1)),
 | 
			
		||||
    $(error $(path) SHA1 mismatch ($(sha1) != $(2))))
 | 
			
		||||
endef
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user