diff --git a/config/functions b/config/functions index f6a27ed136..a2eb652494 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 0737cc1bd4..e05fd2ee07 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