Adding packaging on onos*.zip file.
Modified Version.java to allow 3-segment version.
Changed onos-next to onos as default for ONOS_ROOT.
Change-Id: Ifbde9dfbc7af9a5891e9f41db6932859c0f59660
diff --git a/tools/package/bin/onos-service b/tools/package/bin/onos-service
index 7ce1b15..b9156ec 100755
--- a/tools/package/bin/onos-service
+++ b/tools/package/bin/onos-service
@@ -6,5 +6,7 @@
#export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/}
export JAVA_OPTS="${JAVA_OPTS:--Xms256m -Xmx2048m}"
-cd /opt/onos
-/opt/onos/apache-karaf-$KARAF_VERSION/bin/karaf "$@"
+ONOS_HOME=/opt/onos
+
+[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..
+${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf "$@"