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 <Michal@Hrusecky.net>
This commit is contained in:
Michal Hrusecky
2018-01-17 13:25:43 +01:00
committed by Jo-Philipp Wich
parent 69dfdda157
commit 74450124f6
4 changed files with 149 additions and 0 deletions

View File

@@ -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"; \