diff options
author | Juro Bystricky <juro.bystricky@intel.com> | 2017-08-09 10:48:24 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-16 00:03:15 +0100 |
commit | f3da1613c4d19f599ecea34fc9ea7b9935a8a26a (patch) | |
tree | d0d93f2e37bd8c3b73f3bf0655a758172975efde /meta/classes | |
parent | 01d82ea619f7067b10808ae868a6dda65a19f08d (diff) | |
download | poky-f3da1613c4d19f599ecea34fc9ea7b9935a8a26a.tar.gz |
image-prelink.bbclass: support binary reproducibility
Conditionally support binary reproducibility in built images.
If BUILD_REPRODUCIBLE_BINARIES = 1 then:
1. Do not randomize library addresses
2. Set/export PRELINK_TIMESTAMP to a reproducible value.
If REPRODUCIBLE_TIMESTAMP_ROOTFS is specified, then the value will
be used. Otherwise the timestamp will be derived from the top git commit.
(From OE-Core rev: 40ce3db222f8557a01d041f8115d531cc90a54e8)
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/image-prelink.bbclass | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/classes/image-prelink.bbclass b/meta/classes/image-prelink.bbclass index 6fcd699016..f3bb68b9e1 100644 --- a/meta/classes/image-prelink.bbclass +++ b/meta/classes/image-prelink.bbclass | |||
@@ -36,7 +36,17 @@ prelink_image () { | |||
36 | dynamic_loader=$(linuxloader) | 36 | dynamic_loader=$(linuxloader) |
37 | 37 | ||
38 | # prelink! | 38 | # prelink! |
39 | ${STAGING_SBINDIR_NATIVE}/prelink --root ${IMAGE_ROOTFS} -amR -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader | 39 | if [ "$BUILD_REPRODUCIBLE_BINARIES" = "1" ]; then |
40 | bbnote " prelink: BUILD_REPRODUCIBLE_BINARIES..." | ||
41 | if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then | ||
42 | export PRELINK_TIMESTAMP=`git log -1 --pretty=%ct ` | ||
43 | else | ||
44 | export PRELINK_TIMESTAMP=$REPRODUCIBLE_TIMESTAMP_ROOTFS | ||
45 | fi | ||
46 | ${STAGING_SBINDIR_NATIVE}/prelink --root ${IMAGE_ROOTFS} -am -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader | ||
47 | else | ||
48 | ${STAGING_SBINDIR_NATIVE}/prelink --root ${IMAGE_ROOTFS} -amR -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader | ||
49 | fi | ||
40 | 50 | ||
41 | # Remove the prelink.conf if we had to add it. | 51 | # Remove the prelink.conf if we had to add it. |
42 | if [ "$dummy_prelink_conf" = "true" ]; then | 52 | if [ "$dummy_prelink_conf" = "true" ]; then |