util/genbuild_h: Add gitfile support
`genbuild_h.sh` checks whether it is running from a coreboot's own git worktree to decide whether to use git as the time source. This check fails when `${top}/.git` is a gitfile, e.g. when coreboot is a submodule. Add a proper `git rev-parse` call to check the condition, remove `$top` which is not used anymore. Change-Id: I8bb13d607a01f4f28fa8b165769e0a1f702da362 Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/23256 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
ff4025c5f7
commit
1758fd2a32
|
@ -22,13 +22,11 @@ export LANG=C
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
export TZ=UTC0
|
export TZ=UTC0
|
||||||
|
|
||||||
top=`dirname $0`/../..
|
|
||||||
|
|
||||||
if [ "${BUILD_TIMELESS}" = "1" ]; then
|
if [ "${BUILD_TIMELESS}" = "1" ]; then
|
||||||
GITREV=Timeless
|
GITREV=Timeless
|
||||||
TIMESOURCE="fixed"
|
TIMESOURCE="fixed"
|
||||||
DATE=0
|
DATE=0
|
||||||
elif GIT_DIR="${top}/.git" git status > /dev/null 2>&1; then
|
elif [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
|
||||||
GITREV=$(LANG= git log -1 --format=format:%h)
|
GITREV=$(LANG= git log -1 --format=format:%h)
|
||||||
TIMESOURCE=git
|
TIMESOURCE=git
|
||||||
DATE=$(git log --pretty=format:%ct -1)
|
DATE=$(git log --pretty=format:%ct -1)
|
||||||
|
|
Loading…
Reference in New Issue