version: allow stating the coreboot revision in .coreboot-version

If .git doesn't exist, try to fetch the coreboot version from a file, before
falling back to a hard-code.

Change-Id: Idee8019c9a2b766fe69535367614c5254498335a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10908
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Patrick Georgi 2015-07-13 20:43:28 +02:00 committed by Patrick Georgi
parent 260a01f2cb
commit 492a07593b
2 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.config .config
.config.old .config.old
.coreboot-version
.xcompile .xcompile
.ccwrap .ccwrap
build/ build/

View File

@ -23,7 +23,9 @@ GIT:=$(shell [ -d "$(top)/.git" ] && command -v git)
# misleadingly named, this is the coreboot version # misleadingly named, this is the coreboot version
export KERNELVERSION := $(strip $(if $(GIT),\ export KERNELVERSION := $(strip $(if $(GIT),\
$(shell git describe --dirty --always || git describe),\ $(shell git describe --dirty --always || git describe),\
4.0$(KERNELREVISION))) $(if $(wildcard $(top)/.coreboot-version),\
$(shell cat $(top)/.coreboot-version),\
coreboot-unknown$(KERNELREVISION))))
####################################################################### #######################################################################
# Basic component discovery # Basic component discovery