All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: Alex Kiernan <alex.kiernan@gmail.com>,
	openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] image: Use ${COREBASE}/meta for timestamp, fallback to bitbake.conf
Date: Thu, 19 Jul 2018 10:21:47 -0700	[thread overview]
Message-ID: <096e8a04-c49b-88ae-df8e-444cf4c33c94@gmail.com> (raw)
In-Reply-To: <1532020379-32243-1-git-send-email-alex.kiernan@gmail.com>



On 7/19/18 10:12 AM, Alex Kiernan wrote:
> To handle the case where ${COREBASE} isn't the git directory, but
> ${COREBASE}/meta might be (since that's the layer that sets up the COREBASE
> variable), use the timestamp from there. If that fails use the timestamp
> from conf/bitbake.conf.

whats the chance that ${COREBASE}/meta might also not be a directory 
under git when compared to ${COREBASE} ?

> 
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> ---
> 
>   meta/classes/image.bbclass | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index adc50c9..0afebff 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -651,7 +651,10 @@ POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usr
>   reproducible_final_image_task () {
>       if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
>           if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
> -            REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 --pretty=%ct`
> +            REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}/meta" log -1 --pretty=%ct 2>/dev/null` || true
> +            if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" = "" ]; then
> +                REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y ${@bb.utils.which(d.getVar("BBPATH"), "conf/bitbake.conf")}`
> +            fi
>           fi
>           # Set mtime of all files to a reproducible value
>           bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"
> 


  reply	other threads:[~2018-07-19 17:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 17:12 [PATCH] image: Use ${COREBASE}/meta for timestamp, fallback to bitbake.conf Alex Kiernan
2018-07-19 17:21 ` Khem Raj [this message]
2018-07-19 17:26   ` Alex Kiernan
2018-07-19 18:19     ` Khem Raj
2018-07-20  3:40       ` Alex Kiernan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=096e8a04-c49b-88ae-df8e-444cf4c33c94@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=alex.kiernan@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.