Hi, Simon, The script (gen_gitrev.sh) is attached (slightly later version than last checked into orig NuttX.org repo) and should reside in in the nuttx/tools subdir. I can create a patch and pull request if needed, but in the meantime see attached. The /tools/Makefile.unix needs one line added to the .version: recipe to call the script: # [Re-]create .version if it doesn't already exist. $(TOPDIR)/.version: $(Q) echo "Create .version" $(Q) tools/version.sh -s $(CONFIG_VERSION_STRING) -v $(CONFIG_VERSION_MAJOR).$(CONFIG_VERSION_MINOR) -b $(CONFIG_VERSION_BUILD) .version $(Q) tools/gen_gitrev.sh -t $(TOPDIR) -f .version $(Q) chmod 755 .version Then modify procfsversion.c: if (filep->f_pos == 0) { #ifdef CONFIG_GIT_REVISION_STR linesize = snprintf(attr->line, VERSION_LINELEN, "NuttX version %s %s\n" "%s\n", CONFIG_VERSION_STRING, CONFIG_VERSION_BUILD, CONFIG_GIT_REVISION_STR); #elif defined(__DATE__) && defined(__TIME__) linesize = snprintf(attr->line, VERSION_LINELEN, "NuttX version %s %s %s %s\n", CONFIG_VERSION_STRING, CONFIG_VERSION_BUILD, __DATE__, __TIME__); #else linesize = snprintf(attr->line, VERSION_LINELEN, "NuttX version %s %s\n", CONFIG_VERSION_STRING, CONFIG_VERSION_BUILD); #endif Finally, in a NuttX prompt: cat /proc/version will produce something like this:
Cheers, -david |
gen_gitrev.sh
Description: Binary data
|