]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel: Set SOURCE_DATE_EPOCH to kernel git timestamp if not set
authorAlex Kiernan <alex.kiernan@gmail.com>
Tue, 26 Jun 2018 12:08:56 +0000 (12:08 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 28 Jun 2018 08:22:30 +0000 (09:22 +0100)
If SOURCE_DATE_EPOCH is unset (in addition to the existing "0" behaviour)
parse out the top most commit timestamp from the kernel tree to use as the
timestamp.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel.bbclass

index 972ac52814efd886d7cc7dbe17b489434dd0521b..3213b932bf3ac3b40192593769293eea437975bc 100644 (file)
@@ -288,7 +288,7 @@ kernel_do_compile() {
        if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
                # kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not
                # be set....
-               if [ "$SOURCE_DATE_EPOCH" = "0" ]; then
+               if [ "${SOURCE_DATE_EPOCH}" = "" -o "${SOURCE_DATE_EPOCH}" = "0" ]; then
                        olddir=`pwd`
                        cd ${S}
                        SOURCE_DATE_EPOCH=`git log  -1 --pretty=%ct`