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

Richard Purdie richard.purdie at linuxfoundation.org
Thu Jun 28 15:28:53 UTC 2018


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
exist, fall back to the timestamp of the
${COREBASE}/meta/conf/bitbake.conf file.

Cheers,

Richard

> //Peter
> 
> > -----Original Message-----
> > From: openembedded-core-bounces at lists.openembedded.org
> > [mailto:openembedded-core-bounces at lists.openembedded.org] On Behalf
> > Of
> > Alex Kiernan
> > Sent: den 26 juni 2018 14:09
> > To: openembedded-core at lists.openembedded.org
> > Subject: [OE-core] [OE-Core][PATCH 1/2] image: Set COREBASE as the
> > git
> > directory for timestamp
> > 
> > When REPRODUCIBLE_TIMESTAMP_ROOTFS is unset and we want to parse
> > one
> > from git, use COREBASE as the base for the git command so we have a
> > known repository which we're using. Without this the build may fail
> > if the current directory is not part of a git repository.
> > 
> > Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
> > ---
> > 
> >  meta/classes/image.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/meta/classes/image.bbclass
> > b/meta/classes/image.bbclass
> > index 8ef06c0..2e88024 100644
> > --- a/meta/classes/image.bbclass
> > +++ b/meta/classes/image.bbclass
> > @@ -651,7 +651,7 @@ 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 log -1 --
> > pretty=%ct`
> > +            REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}"
> > log -1
> > --pretty=%ct`
> >          fi
> >          # Set mtime of all files to a reproducible value
> >          bbnote "reproducible_final_image_task: mtime set to
> > $REPRODUCIBLE_TIMESTAMP_ROOTFS"
> > --
> > 2.7.4
> > 
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core at lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list