From 605adb1023efda0c29d160839fccc20801b717cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 19 Nov 2020 16:32:46 +0100 Subject: download: handle possibly invalid local tarballs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently it's assumed, that already downloaded tarballs are always fine, so no checksum checking is performed and the tarball is used even if it might be corrupted. From now on, we're going to always check the downloaded tarballs before considering them valid. Steps to reproduce: 1. Remove cached tarball rm dl/libubox-2020-08-06-9e52171d.tar.xz 2. Download valid tarball again make package/libubox/download 3. Invalidate the tarball sed -i 's/PKG_MIRROR_HASH:=../PKG_MIRROR_HASH:=ff/' package/libs/libubox/Makefile 4. Now compile with corrupt tarball source make package/libubox/{clean,compile} Signed-off-by: Petr Štetiar (cherry picked from commit 4e19cbc553350b8146985367ba46514cf50e3393) --- include/host-build.mk | 2 ++ include/package.mk | 2 ++ 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/host-build.mk b/include/host-build.mk index 827ea6bbfb..79a9b1f8d6 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -184,6 +184,8 @@ ifndef DUMP clean-build: host-clean-build endif + $(DL_DIR)/$(FILE): FORCE + $(_host_target)host-prepare: $(HOST_STAMP_PREPARED) $(_host_target)host-configure: $(HOST_STAMP_CONFIGURED) $(_host_target)host-compile: $(HOST_STAMP_BUILT) $(HOST_STAMP_INSTALLED) diff --git a/include/package.mk b/include/package.mk index c541f6edf7..f6aa5ea8d0 100644 --- a/include/package.mk +++ b/include/package.mk @@ -185,6 +185,8 @@ define Build/CoreTargets $(call Build/Autoclean) $(call DefaultTargets) + $(DL_DIR)/$(FILE): FORCE + download: $(foreach hook,$(Hooks/Download), $(call $(hook))$(sep) -- cgit v1.2.3