<div dir="ltr"><div>I'd write the date into the file at image creation, via ROOTFS_POSTPROCESS_COMMAND.</div><div><br></div><div>Having it in a recipe means that you either force the recipe to not be a part of sstate cache, always rebuilding it and its dependencies (bad idea), or accept that the date comes from a previously built cache object, which means it will mismatch the actual image creation date.</div><div><br></div><div>A bit of context would help: why would you want that info in os-release? Who would use that information and how?<br></div><div><br></div><div>Alex<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 16 Nov 2019 at 23:14, Joseph Reynolds <<a href="mailto:jrey@linux.ibm.com">jrey@linux.ibm.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Is there a best practice for folks who want to put the build date into <br>
their generated os-release file? I've seen this question come up at <br>
least 3 times in my brief involvement with OE. I could perhaps add <br>
comment to the OpenBMC os-release.bbappend file to provide the proper <br>
guidance. I would like to hear your ideas.<br>
<br>
- Joseph<br>
<br>
<br>
-------- Forwarded Message --------<br>
Subject: Re: how to solve the error that basehash value changed from <br>
'xxx' to 'aaaa' ?<br>
Date: Sat, 16 Nov 2019 15:50:38 -0600<br>
From: Joseph Reynolds <<a href="mailto:jrey@linux.ibm.com" target="_blank">jrey@linux.ibm.com</a>><br>
To: www <<a href="mailto:ouyangxuan10@163.com" target="_blank">ouyangxuan10@163.com</a>>, <a href="mailto:openbmc@lists.ozlabs.org" target="_blank">openbmc@lists.ozlabs.org</a> <br>
<<a href="mailto:openbmc@lists.ozlabs.org" target="_blank">openbmc@lists.ozlabs.org</a>><br>
<br>
<br>
<br>
Byron,<br>
<br>
What modification did you put into the os-release recipe? It would help <br>
us help you if you put that in your email.<br>
<br>
<br>
Are you adding the build date to the generated os-release file? If so, <br>
be aware that might cause the issues with the shared state cache you are <br>
experiencing. Also be aware this practice wrecks reproducible builds.<br>
<br>
A better way to get the same effect might be to create a git tag with <br>
the information you want to appear in the generated os-release file. <br>
When you buld with this tag is then picked up by the OpenBMC <br>
meta-phosphor os-release.bbappend (via `git describe`) and included in <br>
the genersted os-release file as the BUILD_ID. See:<br>
<a href="https://github.com/ibm-openbmc/openbmc/blob/d1c59b7a36c10c18838c07af10b18080174cd61d/meta-phosphor/recipes-core/os-release/os-release.bbappend" rel="noreferrer" target="_blank">https://github.com/ibm-openbmc/openbmc/blob/d1c59b7a36c10c18838c07af10b18080174cd61d/meta-phosphor/recipes-core/os-release/os-release.bbappend</a><br>
(But I have not tried that.)<br>
<br>
A way to work around the hash change is to add a line to your recipe <br>
like: PR[vardepsxeclude]="DATETIME"<br>
As suggested by: <br>
<a href="https://forums.openpli.org/topic/41447-how-to-get-rid-of-taskhash-mismatch/" rel="noreferrer" target="_blank">https://forums.openpli.org/topic/41447-how-to-get-rid-of-taskhash-mismatch/</a><br>
<br>
<br>
My apologies for top posting -- my email reader was not quoting the <br>
message properly, so I cut/pasted it below.<br>
<br>
- Joseph<br>
<br>
<br>
On 11/13/19 1:38 AM, www wrote:<br>
<br>
When I modify the os-release file in my yocto project, it appear some <br>
error, and how can I solve it ? Who can give me some help or advice? <br>
Thank you!<br>
I execute the recommended command on the console and it didn't work.<br>
<br>
ERROR: os-release-1.0-r0 do_compile: Taskhash mismatch <br>
ce133f0458608e03aa55224df28156e523e54903115efbbcd62946f84a867201 versus <br>
7269881f0eb1759ed420a2db4c04fb477cd8c1288bc5f82df5c8161bb926ea1f <br>
for /home/temp/xxx/wsp/obmc-source/entity_xxx/meta/recipes-core/os-release/os-release.bb.do_compile<br>
ERROR: Taskhash mismatch <br>
ce133f0458608e03aa55224df28156e523e54903115efbbcd62946f84a867201 versus <br>
7269881f0eb1759ed420a2db4c04fb477cd8c1288bc5f82df5c8161bb926ea1f <br>
for /home/temp/xxx/wsp/obmc-source/entity_xxx/meta/recipes-core/os-release/os-release.bb.do_compile<br>
ERROR: When reparsing <br>
/home/temp/xxx/wsp/obmc-source/entity_xxx/meta/recipes-core/os-release/os-release.bb.do_compile, the <br>
basehash value changed from <br>
99a42a1a3b1a151de604267b159558ecaf1031a3bec8917df132c81302e729a5 to <br>
4f3288a8763e2e1af78e4b3cdd9c0c0ccb3b0d5c78a3073c188b22200df2a9b0. The <br>
metadata is not deterministic and this needs to be fixed.<br>
ERROR: The following commands may help:<br>
ERROR: $ bitbake os-release -cdo_compile -Snone<br>
ERROR: Then:<br>
ERROR: $ bitbake os-release -cdo_compile -Sprintdiff<br>
<br>
ERROR: When <br>
reparsing /home/temp/xxx/wsp/obmc-source/entity_xxx/meta/recipes-core/os-release/os-release.bb.do_compile, the <br>
basehash value changed from <br>
99a42a1a3b1a151de604267b159558ecaf1031a3bec8917df132c81302e729a5 to <br>
47c30012daa6aa77be09a93fe21e66995361ef26b4487111005617db8cb4de59. The <br>
metadata is not deterministic and this needs to be fixed.<br>
ERROR: The following commands may help:<br>
ERROR: $ bitbake os-release -cdo_compile -Snone<br>
ERROR: Then:<br>
ERROR: $ bitbake os-release -cdo_compile -Sprintdiff<br>
<br>
thanks,<br>
Byron<br>
<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>