openwrt/include
Christian Marangi 360d756fbf
build: make find_md5 reproducible with AUTOREMOVE
While experimenting with the AUTOREMOVE option in search of a way to use
prebuilt host tools in different buildroot, it was discovered that the
md5 generated by find_md5 in depends.mk is not reproducible.

Currently the hash is generated by the path of the file in addition to
the file mod time. Out of confusion, probably, there was an idea that
such command was used on the package build_dir. Reality is that this
command is run on the package files. (Makefile, patches, src)

This is problematic because the package Makefile (for example) change at
each git clone and base the hash on the Makefile mtime doesn't really
reflect if the Makefile actually changes across a buildroot or not.

A better approach is to generate an hash of each file and then generate
an hash on the sort hash list. This way we remove the problem of git
clone setting a wrong mtime while keeping the integrity of checking if a
file changed for the package as any change will result in a different
hash.

Introduce a new kind of find_md5 function, find_md5_reproducible that
apply this new logic and limit it only with AUTOREMOVE option set to
prevent any kind of slowdown due to additional hash generation.

(cherry picked from commit 53a08e3743)
[ reworked mkhash to old implementation ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-04 16:07:33 +01:00
..
site Revert faulty tree push 2019-08-12 12:27:06 +02:00
autotools.mk build: add support for patching libtool to include ABI version in soname 2021-02-15 18:47:19 +01:00
cmake.mk Revert "build: replace which with Bash command built-in" 2021-03-03 23:02:30 +01:00
debug.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
depends.mk build: make find_md5 reproducible with AUTOREMOVE 2022-12-04 16:07:33 +01:00
device_table.txt image: ensure that /dev/console exist in rootfs images 2013-08-27 12:02:58 +00:00
download.mk treewide: unify OpenWrt hosted source via @OPENWRT 2021-02-05 12:00:24 -10:00
feeds.mk build: ensure that dash isn't prepended twice to abi version suffix 2021-07-11 16:09:30 +02:00
hardened-ld-pie.specs build: add hardened builds with PIE (ASLR) support 2018-01-27 16:46:45 +01:00
hardening.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
host-build.mk build: make find_md5 reproducible with AUTOREMOVE 2022-12-04 16:07:33 +01:00
image-commands.mk build: kernel2minor: work around path length limit 2021-05-30 22:32:50 +02:00
image.mk build/json: fix IMAGE_PREFIX and DEVICE_PACKAGES 2021-06-02 22:55:52 +02:00
kernel-build.mk build: make find_md5 reproducible with AUTOREMOVE 2022-12-04 16:07:33 +01:00
kernel-defaults.mk kernel-defaults: fix external kernel build when user_headers is missing 2021-05-23 16:10:59 +02:00
kernel-version.mk kernel: bump 5.4 to 5.4.224 2022-11-27 16:28:00 +01:00
kernel.mk kernel: support setting extra CFLAGS for kernel compilation 2022-07-08 15:38:42 +02:00
logo.png include: update logo with better kerning 2021-01-18 09:31:39 -10:00
logo.svg include: update logo with better kerning 2021-01-18 09:31:39 -10:00
netfilter.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
nls.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
package-bin.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
package-defaults.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
package-dumpinfo.mk build: drop ABI version from metadata 2021-02-14 19:41:52 +01:00
package-ipkg.mk build: prepend ABI suffixes with a dash if package name ends with digit 2021-07-11 16:09:30 +02:00
package-seccomp.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
package.mk build: make find_md5 reproducible with AUTOREMOVE 2022-12-04 16:07:33 +01:00
prereq-build.mk build: add support for python3.11 and higher 2022-10-05 22:21:18 +02:00
prereq.mk Revert "build: replace which with Bash command built-in" 2021-03-03 23:02:30 +01:00
quilt.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
rootfs.mk build: reduce cleanup binary calls in rootfs.mk 2020-12-05 22:07:00 -10:00
scan.awk build: propagate override information to .packageinfo 2015-02-09 12:09:31 +00:00
scan.mk build: have scripts/feeds honor all toplevel .mk-files of a feed 2019-10-27 14:32:13 +01:00
shell.sh build: use mkhash to replace various quirky md5sum/openssl calls 2017-01-05 11:09:12 +01:00
subdir.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
target.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
toolchain-build.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
toplevel.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
trusted-firmware-a.mk trusted-firmware-a: fix project name spelling 2021-02-13 20:11:57 +00:00
u-boot.mk u-boot.mk: add LOCALVERSION (explicitly specify OpenWrt build) 2022-03-06 20:56:23 +01:00
uclibc++.mk libcxx[abi]: remove 2020-12-07 10:46:43 -10:00
unpack.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
verbose.mk build: use SPDX license tags 2021-02-05 14:54:47 +01:00
version.mk OpenWrt v21.02.5: revert to branch defaults 2022-10-15 15:02:49 +02:00