[OE-core] [OE-Core][PATCH 1/2] image: Set COREBASE as the git directory for timestamp

Alex Kiernan alex.kiernan at gmail.com
Thu Jun 28 15:57:20 UTC 2018


On Thu, Jun 28, 2018 at 4:31 PM Christopher Larson <kergoth at gmail.com> wrote:
>
>
>
> On Thu, Jun 28, 2018 at 8:29 AM Richard Purdie <richard.purdie at linuxfoundation.org> wrote:
>>
>> On Thu, 2018-06-28 at 15:18 +0000, Peter Kjellerstedt wrote:
>> > There is no guarantee that ${COREBASE} refers to a path that is
>> > under Git control. E.g., in our case it refers to a directory that is
>> > under repo control. "${COREBASE}/meta" is probably a better option.
>>
>> You could make that argument about /meta too.
>>
>> I'd suggest the code checks for ${COREBASE}/.git and if that doesn't

In a poky checkout from repo (which is what I'm also using),
${COREBASE}/meta/.git doesn't exist, but ${COREBASE}/.git does, but
that all works because it's climbing the directory tree to find the
.git directory.

>> exist, fall back to the timestamp of the
>> ${COREBASE}/meta/conf/bitbake.conf file.
>
>
> That's a good idea, but I'd suggest using bb.utils.which() to locate conf/bibake.conf rather than hardcoding that path.

How about (totally untested):

if git -C "${COREBASE}/meta" rev-parse --show-toplevel; then
  REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}/meta" log -1 --pretty=%ct`
else
  REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y ${@bb.utils.which(bbpath,
"conf/bitbake.conf")}`
fi

?

--
Alex Kiernan



More information about the Openembedded-core mailing list