mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-18 02:38:56 +00:00
881a87ecba
As done in the linux kernel, the U-Boot version (U_BOOT_VERSION) of all unreleased (untagged) U-Boot images will be automatically extended upon compiletime with a part of the GIT commit ID and possibly with "dirty" if uncommited changes are detected. Here an example for the resulting version: "U-Boot 1.1.4-g3457ac18-dirty" The version is now maintained in the toplevel Makefile and the version headers are autogenerated. Patch by Stefan Roese, 9 Feb 2006
22 lines
486 B
Bash
Executable file
22 lines
486 B
Bash
Executable file
#!/bin/sh
|
|
# Print additional version information for non-release trees.
|
|
|
|
usage() {
|
|
echo "Usage: $0 [srctree]" >&2
|
|
exit 1
|
|
}
|
|
|
|
cd "${1:-.}" || usage
|
|
|
|
# Check for git and a git repo.
|
|
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
|
|
# Do we have an untagged version?
|
|
if [ "`git name-rev --tags HEAD`" = "HEAD undefined" ]; then
|
|
printf '%s%s' -g `echo "$head" | cut -c1-8`
|
|
fi
|
|
|
|
# Are there uncommitted changes?
|
|
if git diff-files | read dummy; then
|
|
printf '%s' -dirty
|
|
fi
|
|
fi
|