]> code.ossystems Code Review - openembedded-core.git/commit
kernel.bbclass: improve reproducibility
authorJuro Bystricky <juro.bystricky@intel.com>
Wed, 9 Aug 2017 17:48:32 +0000 (10:48 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 Aug 2017 23:01:44 +0000 (00:01 +0100)
commit012a70da7ae0617740cd0cf807d01c3cd912c823
tree3d88a8a3d8461a6a7d6e093d22b246b2dbb808db
parent40ce3db222f8557a01d041f8115d531cc90a54e8
kernel.bbclass: improve reproducibility

Several tweaks to improve reproducibility:

1. If BUILD_REPRODUCIBLE_BINARIES == 1, set KBUILD_BUILD_TIMESTAMP
to a reproducible value. This is either a non-zero SOURCE_DATE_EPOCH, or the
value obtained from top entry of GIT repo, or (if there is no GIT repo)
fallback to REPRODUCIBLE_TIMESTAMP_ROOTFS as the last resort.
Also export KCONFIG_NOTIMESTAMP=1.

2. When compressing vmlinux.gz, use gzip "-n" option

3. Kernel and kernel modules contain hard coded paths referencing the host
build system. This is usually because the source code contains __FILE__
at some place. This prevents binary reproducibility. However, some compilers
allow remapping of the __FILE__ value. If we detect the compiler is capable
of doing this, we replace the source path $(S) part of __FILE__ by a string "/kernel-source".
For example:

​/data/master/build/tmp/work-shared/qemux86/kernel-source/drivers/media/v4l2-core/videobuf2-core.​c

will be replaced by a reproducible value:

/kernel-source/drivers/media/v4l2-core/videobuf2-core.c.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel.bbclass