diff options
author | Leonardo Mörlein <me@irrelefant.net> | 2021-05-09 22:28:15 +0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2021-05-13 15:13:15 +0200 |
commit | b993b68b6ca8444b5227a0c18df4600b37ac565c (patch) | |
tree | a55300e2e43a57fa46a534d1135eee006a4b6d71 /include | |
parent | ce8af0ace04bb43e8156940c771b4058fa83d27a (diff) | |
download | upstream-b993b68b6ca8444b5227a0c18df4600b37ac565c.tar.gz upstream-b993b68b6ca8444b5227a0c18df4600b37ac565c.tar.bz2 upstream-b993b68b6ca8444b5227a0c18df4600b37ac565c.zip |
build: introduce $(MKHASH)
Before this commit, it was assumed that mkhash is in the PATH. While
this was fine for the normal build workflow, this led to some issues if
make TOPDIR="$(pwd)" -C "$pkgdir" compile
was called manually. In most of the cases, I just saw warnings like this:
make: Entering directory '/home/.../package/gluon-status-page'
bash: line 1: mkhash: command not found
bash: line 1: mkhash: command not found
bash: line 1: mkhash: command not found
bash: line 1: mkhash: command not found
bash: line 1: mkhash: command not found
bash: line 1: mkhash: command not found
bash: line 1: mkhash: command not found
bash: line 1: mkhash: command not found
[...]
While these were only warnings and the package still compiled sucessfully,
I also observed that some package even fail to build because of this.
After applying this commit, the variable $(MKHASH) is introduced. This
variable points to $(STAGING_DIR_HOST)/bin/mkhash, which is always the
correct path.
Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/depends.mk | 2 | ||||
-rw-r--r-- | include/download.mk | 2 | ||||
-rw-r--r-- | include/image-commands.mk | 2 | ||||
-rw-r--r-- | include/image.mk | 6 | ||||
-rw-r--r-- | include/kernel-defaults.mk | 4 | ||||
-rw-r--r-- | include/package-ipkg.mk | 2 | ||||
-rw-r--r-- | include/quilt.mk | 2 | ||||
-rw-r--r-- | include/scan.mk | 3 |
8 files changed, 11 insertions, 12 deletions
diff --git a/include/depends.mk b/include/depends.mk index 0080b97876..465e4e952a 100644 --- a/include/depends.mk +++ b/include/depends.mk @@ -11,7 +11,7 @@ DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*" -find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | mkhash md5 +find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | $(MKHASH) md5 define rdep .PRECIOUS: $(2) diff --git a/include/download.mk b/include/download.mk index 4bf055e611..609956b004 100644 --- a/include/download.mk +++ b/include/download.mk @@ -74,7 +74,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 mkhash sha256 $(DL_DIR)/$(1)) +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) diff --git a/include/image-commands.mk b/include/image-commands.mk index afb2dde5ba..fa36885038 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -198,7 +198,7 @@ define Build/elx-header dd bs=20 count=1 conv=sync; \ echo -ne "$$(printf '%08x' $$(stat -c%s $@) | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \ dd bs=8 count=1 conv=sync; \ - echo -ne "$$($(STAGING_DIR_HOST)/bin/mkhash md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \ + echo -ne "$$($(MKHASH) md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \ dd bs=58 count=1 conv=sync; \ ) > $(KDIR)/tmp/$(DEVICE_NAME).header $(call Build/xor-image,-p $(xor_pattern) -x) diff --git a/include/image.mk b/include/image.mk index 76c527a15e..d93ce7f233 100644 --- a/include/image.mk +++ b/include/image.mk @@ -26,7 +26,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)) | mkhash md5 | cut -b1-8) +mkfs_packages_id = $(shell echo $(sort $(1)) | $(MKHASH) md5 | cut -b1-8) mkfs_target_dir = $(if $(call param_get,pkg,$(1)),$(KDIR)/target-dir-$(call param_get,pkg,$(1)),$(TARGET_DIR)) KDIR=$(KERNEL_BUILD_DIR) @@ -40,8 +40,8 @@ IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERS IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) IMG_ROOTFS:=$(IMG_PREFIX)-rootfs IMG_COMBINED:=$(IMG_PREFIX)-combined -IMG_PART_SIGNATURE:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | mkhash md5 | cut -b1-8) -IMG_PART_DISKGUID:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | mkhash md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/') +IMG_PART_SIGNATURE:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | cut -b1-8) +IMG_PART_DISKGUID:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/') MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index 4b0b136a03..82bc32256d 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -116,7 +116,7 @@ define Kernel/Configure/Default cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \ } $(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install - grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | mkhash md5 > $(LINUX_DIR)/.vermagic + grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic endef define Kernel/Configure/Initramfs @@ -186,5 +186,3 @@ define Kernel/Clean/Default rm -f $(LINUX_KERNEL) $(_SINGLE)$(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) clean endef - - diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index c2017cd220..b066e116f7 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -221,7 +221,7 @@ $(_endef) ifneq ($$(CONFIG_IPK_FILES_CHECKSUMS),) (cd $$(IDIR_$(1)); \ ( \ - find . -type f \! -path ./CONTROL/\* -exec mkhash sha256 -n \{\} \; 2> /dev/null | \ + find . -type f \! -path ./CONTROL/\* -exec $(MKHASH) sha256 -n \{\} \; 2> /dev/null | \ sed 's|\([[:blank:]]\)\./| \1/|' > $$(IDIR_$(1))/CONTROL/files-sha256sum \ ) || true \ ) diff --git a/include/quilt.mk b/include/quilt.mk index 00597ca0f2..6d25469daf 100644 --- a/include/quilt.mk +++ b/include/quilt.mk @@ -159,7 +159,7 @@ define Quilt/Template false; \ } @[ -n "$$$$(ls $(1)/patches/series)" -o \ - "$$$$(cat $(1)/patches/series | mkhash md5)" = "$$(sort $(1)/patches/series | mkhash md5)" ] || { \ + "$$$$(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; \ } diff --git a/include/scan.mk b/include/scan.mk index 7df5dc6486..aee24cb3e5 100644 --- a/include/scan.mk +++ b/include/scan.mk @@ -1,4 +1,5 @@ include $(TOPDIR)/include/verbose.mk +include $(TOPDIR)/rules.mk TMP_DIR:=$(TOPDIR)/tmp all: $(TMP_DIR)/.$(SCAN_TARGET) @@ -100,7 +101,7 @@ $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST) $(TARGET_STAMP):: +( \ $(NO_TRACE_MAKE) $(FILELIST); \ - MD5SUM=$$(cat $(FILELIST) $(OVERRIDELIST) | mkhash md5 | awk '{print $$1}'); \ + MD5SUM=$$(cat $(FILELIST) $(OVERRIDELIST) | $(MKHASH) md5 | awk '{print $$1}'); \ [ -f "$@.$$MD5SUM" ] || { \ rm -f $@.*; \ touch $@.$$MD5SUM; \ |