build: use mkhash to replace various quirky md5sum/openssl calls
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp"
|
||||
|
||||
find_md5=$(SH_FUNC) find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) | md5s
|
||||
find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) | mkhash md5
|
||||
|
||||
define rdep
|
||||
.PRECIOUS: $(2)
|
||||
|
||||
@@ -61,7 +61,7 @@ else
|
||||
check_warn = $(if $(filter-out undefined,$(origin F_$(1))),$(filter ,$(shell $(call F_$(1),$(2),$(3),$(4)) >&2)),$(check_warn_nofix))
|
||||
endif
|
||||
|
||||
gen_sha256sum = $(shell openssl dgst -sha256 $(DL_DIR)/$(1) | awk '{print $$2}')
|
||||
gen_sha256sum = $(shell mkhash sha256 $(DL_DIR)/$(1))
|
||||
|
||||
ifdef FIXUP
|
||||
F_hash_deprecated = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile fix-hash $(3) $(call gen_sha256sum,$(1)) $(2)
|
||||
|
||||
@@ -33,7 +33,7 @@ param_get_default = $(firstword $(call param_get,$(1),$(2)) $(3))
|
||||
param_mangle = $(subst $(space),_,$(strip $(1)))
|
||||
param_unmangle = $(subst _,$(space),$(1))
|
||||
|
||||
mkfs_packages_id = $(shell echo $(sort $(1)) | md5sum | head -c 8)
|
||||
mkfs_packages_id = $(shell echo $(sort $(1)) | mkhash md5 | head -c 8)
|
||||
mkfs_target_dir = $(if $(call param_get,pkg,$(1)),$(KDIR)/target-dir-$(call param_get,pkg,$(1)),$(TARGET_DIR))
|
||||
|
||||
KDIR=$(KERNEL_BUILD_DIR)
|
||||
|
||||
@@ -125,7 +125,7 @@ define Kernel/Configure/Default
|
||||
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \
|
||||
}
|
||||
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
|
||||
$(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | md5s > $(LINUX_DIR)/.vermagic
|
||||
grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | mkhash md5 > $(LINUX_DIR)/.vermagic
|
||||
endef
|
||||
|
||||
define Kernel/Configure/Initramfs
|
||||
|
||||
@@ -127,11 +127,6 @@ $(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
|
||||
gstat -c%s $(TMP_DIR)/.host.mk, \
|
||||
stat -c%s $(TMP_DIR)/.host.mk))
|
||||
|
||||
$(eval $(call SetupHostCommand,md5sum,, \
|
||||
gmd5sum /dev/null | grep d41d8cd98f00b204e9800998ecf8427e, \
|
||||
md5sum /dev/null | grep d41d8cd98f00b204e9800998ecf8427e, \
|
||||
$(SCRIPT_DIR)/md5sum /dev/null | grep d41d8cd98f00b204e9800998ecf8427e))
|
||||
|
||||
$(eval $(call SetupHostCommand,unzip,Please install 'unzip', \
|
||||
unzip 2>&1 | grep zipfile, \
|
||||
unzip))
|
||||
|
||||
@@ -149,7 +149,8 @@ define Quilt/Template
|
||||
echo "The source directory contains no quilt patches."; \
|
||||
false; \
|
||||
}
|
||||
@[ -n "$$$$(ls $(1)/patches/series)" -o "$$$$(cat $(1)/patches/series | md5sum)" = "$$(sort $(1)/patches/series | md5sum)" ] || { \
|
||||
@[ -n "$$$$(ls $(1)/patches/series)" -o \
|
||||
"$$$$(cat $(1)/patches/series | mkhash md5)" = "$$(sort $(1)/patches/series | mkhash md5)" ] || { \
|
||||
echo "The patches are not sorted in the right order. Please fix."; \
|
||||
false; \
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
|
||||
$(TARGET_STAMP)::
|
||||
+( \
|
||||
$(NO_TRACE_MAKE) $(FILELIST); \
|
||||
MD5SUM=$$(cat $(FILELIST) $(OVERRIDELIST) | (md5sum || md5) 2>/dev/null | awk '{print $$1}'); \
|
||||
MD5SUM=$$(cat $(FILELIST) $(OVERRIDELIST) | mkhash md5 | awk '{print $$1}'); \
|
||||
[ -f "$@.$$MD5SUM" ] || { \
|
||||
rm -f $@.*; \
|
||||
touch $@.$$MD5SUM; \
|
||||
|
||||
@@ -13,10 +13,3 @@ isset() {
|
||||
eval "var=\"\${$1}\""
|
||||
[ -n "$var" ]
|
||||
}
|
||||
|
||||
md5s() {
|
||||
cat "$@" | (
|
||||
md5sum 2>/dev/null ||
|
||||
md5
|
||||
) | awk '{print $1}'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user