build: SDK/IB reproducible and faster compression

Both IB and SDK now use the same logic for packing.

This commit add reproducible multithread compression to the SDK and
corrects the file mtime for both. Previously all files where just copied
over from the build system, generating random mtimes.

Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
Paul Spooren 2020-08-13 13:46:43 -10:00 committed by Matthias Schiffer
parent 1cf842dd13
commit 8c9a788172
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
2 changed files with 6 additions and 2 deletions

View File

@ -86,7 +86,10 @@ endif
(cd $(PKG_BUILD_DIR); find staging_dir/host/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \ (cd $(PKG_BUILD_DIR); find staging_dir/host/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \
$(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host) $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host)
STRIP=sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/ STRIP=sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/
$(TAR) -cf - -C $(BUILD_DIR) $(IB_NAME) | xz -T$(if $(filter 1,$(NPROC)),2,0) -zc -7e > $@ (cd $(BUILD_DIR); \
tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(IB_NAME) \
--mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \
)
download: download:
prepare: prepare:

View File

@ -152,7 +152,8 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean
find $(SDK_BUILD_DIR) -name CVS | $(XARGS) rm -rf find $(SDK_BUILD_DIR) -name CVS | $(XARGS) rm -rf
-make -C $(SDK_BUILD_DIR)/scripts/config clean -make -C $(SDK_BUILD_DIR)/scripts/config clean
(cd $(BUILD_DIR); \ (cd $(BUILD_DIR); \
tar -I 'xz -7e' -cf $@ $(SDK_NAME); \ tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(SDK_NAME) \
--mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \
) )
download: download: