aboutsummaryrefslogtreecommitdiffstats
path: root/include/package-ipkg.mk
diff options
context:
space:
mode:
authorMichal Hrusecky <Michal@Hrusecky.net>2018-01-17 13:25:43 +0100
committerJo-Philipp Wich <jo@mein.io>2019-01-22 09:22:25 +0100
commit74450124f606cb04bdd44684b6070a15dd0837bd (patch)
treec43b7648ea81e01253e2415f3f057076c7c76c44 /include/package-ipkg.mk
parent69dfdda157e86c4aabbae9e51ecf76911f833af2 (diff)
downloadupstream-74450124f606cb04bdd44684b6070a15dd0837bd.tar.gz
upstream-74450124f606cb04bdd44684b6070a15dd0837bd.tar.bz2
upstream-74450124f606cb04bdd44684b6070a15dd0837bd.zip
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>
Diffstat (limited to 'include/package-ipkg.mk')
-rw-r--r--include/package-ipkg.mk9
1 files changed, 9 insertions, 0 deletions
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"; \