From 74450124f606cb04bdd44684b6070a15dd0837bd Mon Sep 17 00:00:00 2001 From: Michal Hrusecky Date: Wed, 17 Jan 2018 13:25:43 +0100 Subject: build: Optionally provide file checksums in package metadata This may be useful if you don't entirely trust your flash and want to be able to check for corruptions. Signed-off-by: Michal Hrusecky --- include/package-ipkg.mk | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 200a5cf4eb..dc05eefc7c 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -199,6 +199,15 @@ $(_endef) $(CheckDependencies) $(RSTRIP) $$(IDIR_$(1)) + + ifneq ($$(CONFIG_IPK_FILES_CHECKSUMS),) + (cd $$(IDIR_$(1)); \ + ( \ + find . -type f \! -path ./CONTROL/\* -exec sha256sum \{\} \; 2> /dev/null | \ + sed 's|\([[:blank:]]\)\./|\1/|' > $$(IDIR_$(1))/CONTROL/files-sha256 \ + ) || true \ + ) + endif (cd $$(IDIR_$(1))/CONTROL; \ ( \ echo "$$$$CONTROL"; \ -- cgit v1.2.3