How to configure yocto to use the latest git commit?

Stefan Jaritz picture Stefan Jaritz · Jul 14, 2016 · Viewed 10.9k times · Source

I am a very lazy person. While working on a HW/SW project the software changes permanently. In this development stage, changing the commit/reversion-tags in the recipes is very nasty. I want Yocto to fetch the latest git commit. Is this possible/How to do this? My example recipe:

SUMMARY = "my test"
SECTION = "test"
LICENSE = "CLOSED"

inherit cmake
SRCREV = "f9bdbd6c631f07e427c010086c7c26a95eb2924e"

SRC_URI = "gitsm://myGit/mytest;protocol=http;branch=develop"

S = "${WORKDIR}/git/"

Answer

Anders picture Anders · Jul 14, 2016

Sure, set SRCREV = "${AUTOREV}".

Furthermore, you need to reference SRCPV in PV in order to automatically update the version whenever the revision of the source code changes. Here is an example:

 PV = "1.0+git${SRCPV}"

Then it'll build the latest revision each time.