[oe] get OE git hash tag in executable

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Sat Jan 28 12:42:32 UTC 2012


Hi,

In order to allow backtracking of the sources for a binary build with OE, I
would like to (automatically) add the hash of the top level commit (and
maybe also the branch) of the oe git tree my recipe lives in).
E.g. in main.c I would like to have a var say:
const char * const buildfrom = "oe branch 2011.03-maintence hash
1234567890"; or something like that.

What would be the best way to get that info into my program?
(my best guess at the moment is to use a macro and compile with
-DOE_IDENT="....." or so and say  char *buildfrom = OE_IDENT; but not
really sure what the best way is to fill OE_IDENT and pass it to the
recipe.)

(and of course I'm open to alternate solutions; as long as I can trace back
the git hash)

Thanks in advance for any suggestions!
Frans



More information about the Openembedded-devel mailing list