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