aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/make_gitrev.sh
Commit message (Collapse)AuthorAgeFilesLines
* Make gitrev more reliableMatthew Ahrens2018-10-221-3/+1
| | | | | | | | | | | | | | | | In some build methods, the gitrev is unnecessarily set to "unknown". We can improve this by changing the gitrev to use `git describe --always --long --dirty`. This gets the revision even when no tag matches (--always). It prints the hash even when it exactly matches a tag (--long). And if there are uncommitted changes, it appends "-dirty", rather than failing (--dirty). Reviewed-by: George Melikov <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matthew Thode <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #8034
* Allow copy-builtin to work with modified sourcesMatthew Thode2018-10-171-24/+13
| | | | | | | | | | | | | | `scripts/make_gitrev.sh` had 'set -e' so if any command failed it would fail and cause copy-builtin to fail (copy-builtin also has `set -e`. This commit also simplifies scripts/make_gitrev.sh to always write a file by using a cleanup function. It also simplifies other areas of the script as well (making it much shorter). Reviewed-by: John Kennedy <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Thode <[email protected]> Closes #8022 Closes #8025
* Create /proc/sys/kernel/spl/gitrev with git hashMatthew Ahrens2018-10-081-0/+54
The existing mechanisms for determining what code is running in the kernel do not always correctly report the git hash. The versions reported there do not reflect changes made since `configure` was run (i.e. incremental builds do not update the version) and they are misleading if git tags are not set up properly. This applies to `modinfo zfs`, `dmesg`, and `/sys/module/zfs/version`. There are complicated requirements on how the existing version is generated. Therefore we are leaving that alone, and adding a new mechanism to record and retrieve the git hash: `cat /proc/sys/kernel/spl/gitrev` The gitrev is re-generated at compile time, when running `make` (including for incremental builds). The value is the output of `git describe` (or "unknown" if not in a git repo or there are uncommitted changes). We're also removing /proc/sys/kernel/spl/version, which was never very useful. Reviewed by: Pavel Zakharov <[email protected]> Reviewed by: Brian Behlendorf <[email protected]> Reviewed by: Tim Chase <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #7931 Closes #7965