The initial git availability check ran in the kernel directory instead
of the Jailhouse source tree. Fix it by moving the cd before it. Also
quote the input path properly at this chance.
Reported-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
echo "/* Auto-generated - leave alone and don't commit! */"
echo ""
+cd "$1" > /dev/null
+
if ! git rev-parse 2>/dev/null; then
- version="`cat $1/VERSION`"
+ version="`cat VERSION`"
else
- cd $1 > /dev/null
describe="`git describe --long --dirty --match "v[0-9].[0-9]*"`"
version="`echo $describe | sed -e 's/\([^-]*\)-\(.*\)/\1 (\2)/'`"
- cd - > /dev/null
fi
+cd - > /dev/null
+
echo "#define JAILHOUSE_VERSION \"$version\""