[OE-core] How to add build date? (was: ... basehash value changed...)

Mikko.Rapeli at bmw.de Mikko.Rapeli at bmw.de
Mon Nov 18 08:58:38 UTC 2019


On Sun, Nov 17, 2019 at 10:19:32PM +0100, Alexander Kanavin wrote:
> I'd write the date into the file at image creation, via
> ROOTFS_POSTPROCESS_COMMAND.
> 
> 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.

This is the approach I use. Also, the need of build time stamp is usually not what
users need. They likely need the latest time stamp in meta layer commits,
or similar. I use git submodules for them so a "git describe --tags --always --dirty" will
generate a unique tag and hash combination for all builds. The commit time
can be queried with 'git log HEAD~1.. --format="%cD"'.

-Mikko


More information about the Openembedded-core mailing list