From 71fdef5d82c7fd474bcf584e6155d104cc69acda Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 13 Jan 2011 13:27:53 +0100 Subject: [PATCH] scripts/image: create /etc/gitrev and show git rev in ssh splash on development builds Signed-off-by: Stephan Raue --- config/functions | 1 + scripts/image | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/config/functions b/config/functions index f6a27ed13..a2eb65249 100644 --- a/config/functions +++ b/config/functions @@ -111,6 +111,7 @@ get_version() { if [ "$OPENELEC_VERSION" = devel -o "$OPENELEC_VERSION" = debug ]; then GIT_BUILD=`git log --pretty=format:'' | wc -l` + GIT_HASH=`git log -n1 --format=%H` OPENELEC_VERSION=$OPENELEC_VERSION-$BUILD_DATE-r$GIT_BUILD fi diff --git a/scripts/image b/scripts/image index 0737cc1bd..e05fd2ee0 100755 --- a/scripts/image +++ b/scripts/image @@ -64,6 +64,9 @@ mkdir -p $INSTALL echo "$OPENELEC_VERSION" > $INSTALL/etc/version echo "$TARGET_VERSION" > $INSTALL/etc/release echo "$DISTRONAME - Version: $OPENELEC_VERSION" > $INSTALL/etc/openelec-release + if [ -n "$GIT_HASH" ]; then + echo "$GIT_HASH" >> $INSTALL/etc/gitrev + fi # create /etc/issue echo $GREATING0 > $INSTALL/etc/issue @@ -72,6 +75,9 @@ mkdir -p $INSTALL echo $GREATING3 >> $INSTALL/etc/issue echo $GREATING4 >> $INSTALL/etc/issue echo "$DISTRONAME Version: $OPENELEC_VERSION" >> $INSTALL/etc/issue + if [ -n "$GIT_HASH" ]; then + echo "$DISTRONAME git: $GIT_HASH" >> $INSTALL/etc/issue + fi # copy project related files to filesystem if [ -d "$PROJECT_DIR/$PROJECT/filesystem" ]; then