summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-20 12:15:06 +0000
committerSteve Sakoman <steve@sakoman.com>2020-12-22 08:09:20 -1000
commitd39587d65bd57148c2c76b23e7a6ec78de855909 (patch)
tree744388ff95ff7c7b8486d3a9098f6d59ec466a5c /meta/recipes-bsp
parentfcb5fbb2e326e48236e03cc0d0540b6b0e7a287e (diff)
downloadopenembedded-core-contrib-d39587d65bd57148c2c76b23e7a6ec78de855909.tar.gz
u-boot-tools: Fix reproducibility issue
If you build on a system with git < 2.14 from scratch (e.g. debian9), the tree will be marked as "dirty" and the version will include "-dirty", leading to a reproducibility problem. The issue is the inode count for Licnses/README changing due to do_populate_lic hardlinking a copy of the file. We avoid this by ensuring the index is updated with a "git diff" before the u-boot machinery tries to determine the version. build$ ../git/scripts/setlocalversion ../git "" build$ ln ../git/ build$ ln ../git/README ../foo build$ ../git/scripts/setlocalversion ../git ""-dirty (i.e. creating a hardlink dirties the index) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a4de915af9e2c4d365527ad09286483b2ee904fc) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r--meta/recipes-bsp/u-boot/u-boot-tools.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/recipes-bsp/u-boot/u-boot-tools.inc b/meta/recipes-bsp/u-boot/u-boot-tools.inc
index 8ae290acc6..4ed936a70d 100644
--- a/meta/recipes-bsp/u-boot/u-boot-tools.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-tools.inc
@@ -23,6 +23,21 @@ SED_CONFIG_EFI_armeb = ''
SED_CONFIG_EFI_aarch64 = ''
do_compile () {
+ # Yes, this is crazy. If you build on a system with git < 2.14 from scratch, the tree will
+ # be marked as "dirty" and the version will include "-dirty", leading to a reproducibility problem.
+ # The issue is the inode count for Licnses/README changing due to do_populate_lic hardlinking a
+ # copy of the file. We avoid this by ensuring the index is updated with a "git diff" before the
+ # u-boot machinery tries to determine the version.
+ #
+ # build$ ../git/scripts/setlocalversion ../git
+ # ""
+ # build$ ln ../git/
+ # build$ ln ../git/README ../foo
+ # build$ ../git/scripts/setlocalversion ../git
+ # ""-dirty
+ # (i.e. creating a hardlink dirties the index)
+ cd ${S}; git diff; cd ${B}
+
oe_runmake -C ${S} sandbox_defconfig O=${B}
# Disable CONFIG_CMD_LICENSE, license.h is not used by tools and