<div><br>
On Thu, Jul 19, 2018 at 10:26 AM Alex Kiernan <<a href="mailto:alex.kiernan@gmail.com" target="_blank">alex.kiernan@gmail.com</a>> wrote:<br>
><br>
> On Thu, Jul 19, 2018 at 6:21 PM Khem Raj <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>> wrote:<br>
> ><br>
> ><br>
> ><br>
> > On 7/19/18 10:12 AM, Alex Kiernan wrote:<br>
> > > To handle the case where ${COREBASE} isn't the git directory, but<br>
> > > ${COREBASE}/meta might be (since that's the layer that sets up the COREBASE<br>
> > > variable), use the timestamp from there. If that fails use the timestamp<br>
> > > from conf/bitbake.conf.<br>
> ><br>
> > whats the chance that ${COREBASE}/meta might also not be a directory<br>
> > under git when compared to ${COREBASE} ?<br>
> ><br>
><br>
> About the same I expect, but if it's not then git will climb up to<br>
> ${COREBASE} so I think we're better off.<br>
><br>
> And if it doesn't find one then it falls back to the timestamp on<br>
> bitbake.conf - I've just been testing a snapshot of the layers as a<br>
> tarball and building successfully inside that when there's no git<br>
> directories for it to find at all.<br>
><br>
<br></div><div>
OK lets stay with adding bitbake.conf as fallback. <br></div><div>
<br>
> > ><br>
> > > Signed-off-by: Alex Kiernan <<a href="mailto:alex.kiernan@gmail.com" target="_blank">alex.kiernan@gmail.com</a>><br>
> > > ---<br>
> > ><br>
> > > meta/classes/image.bbclass | 5 ++++-<br>
> > > 1 file changed, 4 insertions(+), 1 deletion(-)<br>
> > ><br>
> > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass<br>
> > > index adc50c9..0afebff 100644<br>
> > > --- a/meta/classes/image.bbclass<br>
> > > +++ b/meta/classes/image.bbclass<br>
> > > @@ -651,7 +651,10 @@ POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usr<br>
> > > reproducible_final_image_task () {<br>
> > > if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then<br>
> > > if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then<br>
> > > - REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 --pretty=%ct`<br>
> > > + REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}/meta" log -1 --pretty=%ct 2>/dev/null` || true<br>
> > > + if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" = "" ]; then<br>
> > > + REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y ${@bb.utils.which(d.getVar("BBPATH"), "conf/bitbake.conf")}`<br>
> > > + fi<br>
> > > fi<br>
> > > # Set mtime of all files to a reproducible value<br>
> > > bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"<br>
> > ><br>
><br>
><br>
><br>
> --<br>
> Alex Kiernan<br>
</div>