[Buildroot] [PATCH 17/51] core/legal-info: generate a hash of all saved files

Yann E. MORIN yann.morin.1998 at free.fr
Mon Nov 23 14:47:47 UTC 2015


Having a hash of the saved files can be interesting for the recipient to
verify the integrity of the files.

We remove the warning file earlier, to exclude it from the hash list.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Cc: Luca Ceresoli <luca at lucaceresoli.net>
---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 5e62275..947f941 100644
--- a/Makefile
+++ b/Makefile
@@ -662,8 +662,13 @@ legal-info: dirs legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p
 		cat support/legal-info/README.warnings-header \
 			$(LEGAL_WARNINGS) >>$(LEGAL_REPORT); \
 		cat $(LEGAL_WARNINGS); fi
-	@echo "Legal info produced in $(LEGAL_INFO_DIR)"
 	@rm -f $(LEGAL_WARNINGS)
+	@find $(LEGAL_INFO_DIR) -type f -exec sha256sum {} + \
+	 |sed -r -e 's:  $(LEGAL_INFO_DIR)/+:  :' \
+	 |sort -k2 \
+	 >$(BUILD_DIR)/legal-info.sha256
+	@mv $(BUILD_DIR)/legal-info.sha256 $(LEGAL_INFO_DIR)/legal-info.sha256
+	@echo "Legal info produced in $(LEGAL_INFO_DIR)"
 
 show-targets:
 	@echo $(PACKAGES) $(TARGETS_ROOTFS)
-- 
1.9.1



More information about the buildroot mailing list