diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-12-20 12:15:06 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-01 11:55:34 +0000 |
commit | 25e3e95e042df6a0bb5eda98843f826184d0d4e3 (patch) | |
tree | 15ee7607c0acfd3d42b31d7a6a643ccd87583b05 /meta/recipes-bsp/u-boot/u-boot-tools.inc | |
parent | 5e2092323a24fc76cf779e98d2c2ff35e9084df0 (diff) | |
download | poky-25e3e95e042df6a0bb5eda98843f826184d0d4e3.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)
(From OE-Core rev: d39587d65bd57148c2c76b23e7a6ec78de855909)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a4de915af9e2c4d365527ad09286483b2ee904fc)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/u-boot/u-boot-tools.inc')
-rw-r--r-- | meta/recipes-bsp/u-boot/u-boot-tools.inc | 15 |
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 = '' | |||
23 | SED_CONFIG_EFI_aarch64 = '' | 23 | SED_CONFIG_EFI_aarch64 = '' |
24 | 24 | ||
25 | do_compile () { | 25 | do_compile () { |
26 | # Yes, this is crazy. If you build on a system with git < 2.14 from scratch, the tree will | ||
27 | # be marked as "dirty" and the version will include "-dirty", leading to a reproducibility problem. | ||
28 | # The issue is the inode count for Licnses/README changing due to do_populate_lic hardlinking a | ||
29 | # copy of the file. We avoid this by ensuring the index is updated with a "git diff" before the | ||
30 | # u-boot machinery tries to determine the version. | ||
31 | # | ||
32 | # build$ ../git/scripts/setlocalversion ../git | ||
33 | # "" | ||
34 | # build$ ln ../git/ | ||
35 | # build$ ln ../git/README ../foo | ||
36 | # build$ ../git/scripts/setlocalversion ../git | ||
37 | # ""-dirty | ||
38 | # (i.e. creating a hardlink dirties the index) | ||
39 | cd ${S}; git diff; cd ${B} | ||
40 | |||
26 | oe_runmake -C ${S} sandbox_defconfig O=${B} | 41 | oe_runmake -C ${S} sandbox_defconfig O=${B} |
27 | 42 | ||
28 | # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and | 43 | # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and |