diff --git a/Config.in b/Config.in index 339c28f29c..d3bf6000ca 100644 --- a/Config.in +++ b/Config.in @@ -699,6 +699,23 @@ config BR2_FORCE_HOST_BUILD This option will increase build time. +config BR2_DOWNLOAD_FORCE_CHECK_HASHES + bool "Force all downloads to have a valid hash" + depends on BR2_GLOBAL_PATCH_DIR != "" + help + For packages where a custom version or location can be set, + Buildroot does not carry a hash for those custom versions or + locations, so the integrity of such downloads is not verified. + + Say 'y' here to enforce downloads to have at least one valid + hash (and of course, that all hashes be valid). + + Those hashes are looked in files in BR2_GLOBAL_PATCH_DIR, + see above. + +comment "Forcing all downloads to have a valid hash needs a global patch and hash directory" + depends on BR2_GLOBAL_PATCH_DIR = "" + config BR2_REPRODUCIBLE bool "Make the build reproducible (experimental)" # SOURCE_DATE_EPOCH support in toolchain-wrapper requires GCC 4.4 diff --git a/package/pkg-download.mk b/package/pkg-download.mk index 44cc178dea..078470808e 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -66,9 +66,7 @@ github = https://github.com/$(1)/$(2)/archive/$(3) gitlab = https://gitlab.com/$(1)/$(2)/-/archive/$(3) # Expressly do not check hashes for those files -# Exported variables default to immediately expanded in some versions of -# make, but we need it to be recursively-epxanded, so explicitly assign it. -export BR_NO_CHECK_HASH_FOR = +BR_NO_CHECK_HASH_FOR = ################################################################################ # DOWNLOAD_URIS - List the candidates URIs where to get the package from: @@ -110,6 +108,7 @@ endif define DOWNLOAD $(Q)mkdir -p $($(2)_DL_DIR) $(Q)$(EXTRA_ENV) $($(2)_DL_ENV) \ + BR_NO_CHECK_HASH_FOR="$(if $(BR2_DOWNLOAD_FORCE_CHECK_HASHES),,$(BR_NO_CHECK_HASH_FOR))" \ flock $($(2)_DL_DIR)/.lock $(DL_WRAPPER) \ -c '$($(2)_DL_VERSION)' \ -d '$($(2)_DL_DIR)' \