Revision number calculation

LEDE continues to use the svn-like rXXXX revision, but as source code is stored in git repository, the rXXXX revision needs to be calculated separately.

LEDE uses the shell script scripts/ for calculating the revision. It calculates the revision by counting the number of commits since the LEDE repository was initially cloned from Openwrt.

  • The counting is not global, but is done separately for master and stable branches. E.g. currently 17.01 branch is at r3300 while master is at r3921.

You can use ./scripts/ in your buildroot in four ways:

  • Without arguments, it gives you current HEAD revision as “rxxxx-hash”. That is the normal use.
  • If you give a version like “r3298” as an argument, it fetches you the git hash
  • If you give a git hash as argument, it calculates the rxxxx revision for it
  • If you give it its own output (“version string”) it will return the hash for the git commit


$ git log --oneline
53fcaed1f7 force kernel rebuild on every run
638ca50f3b kernel: Fix the incorrect i_nlink count after jffs2's RENAME_EXCHANGE operations.
47bf110cbb mac80211: backport an upstream fix for queue start/stop handling
a49503bbc7 sysntpd: restore support for peer-less (standalone) mode
1bdd23231b ar71xx: fix Wallys DR344 ethernet MAC addresses offsets
0cb669b469 ugps: fix and improve init script
0dcc4d239d kernel: update kernel 4.4 to 4.4.59

$ ./scripts/ 

$ ./scripts/ 0cb669b469

$ ./scripts/ r3296

Recovering git commit from version string

lede_source$ git describe

lede_source$ ./scripts/ 

lede_source$ ./scripts/ r2993+783-b9a408c
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2018/03/18 18:22
  • by jeff