Sketching cluster related stuff with Madan..
diff --git a/tools/build/envDefaults b/tools/build/envDefaults
new file mode 100644
index 0000000..71d4cf4
--- /dev/null
+++ b/tools/build/envDefaults
@@ -0,0 +1,22 @@
+# Environmental defaults for ONOS build, package and test
+
+# Root of the ONOS source tree
+export ONOS_ROOT=${ONOS_ROOT:-~/onos-next}
+
+# M2 repository and Karaf gold bits
+export M2_REPO=${M2_REPO:-~/.m2/repository}
+export KARAF_ZIP=${KARAF_ZIP:-~/Downloads/apache-karaf-3.0.1.zip}
+export KARAF_DIST=$(basename $KARAF_ZIP .zip)
+
+# ONOS Version and onos.tar.gz staging environment
+export ONOS_VERSION=${ONOS_VERSION:-1.0.0-SNAPSHOT}
+export ONOS_STAGE_ROOT=${ONOS_STAGE_ROOT:-/tmp}
+export ONOS_BITS=onos-$ONOS_VERSION
+export ONOS_STAGE=$ONOS_STAGE_ROOT/$ONOS_BITS
+export ONOS_TAR=$ONOS_STAGE.tar.gz
+
+# Defaults for ONOS testing using remote machines.
+export ONOS_INSTALL_DIR="/opt/onos"     # Installation directory on remote
+export OCI="${OCI:-192.168.56.101}"     # ONOS Controller Instance
+export ONOS_USER="sdn"                  # ONOS user on remote system
+export ONOS_PWD="rocks"                 # ONOS user password on remote system
diff --git a/tools/build/onos-package b/tools/build/onos-package
new file mode 100755
index 0000000..5918306
--- /dev/null
+++ b/tools/build/onos-package
@@ -0,0 +1,50 @@
+#!/bin/bash
+#-------------------------------------------------------------------------------
+# Packages ONOS distributable into onos.tar.gz
+#-------------------------------------------------------------------------------
+
+[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
+. $ONOS_ROOT/tools/build/envDefaults
+
+# Bail on any errors
+set -e
+
+rm -fr $ONOS_STAGE # Remove this when package script is completed
+
+# Make sure we have the original apache karaf bits first
+[ ! -d $M2_REPO ] && echo "M2 repository $M2_REPO not found" && exit 1
+[ ! -f $KARAF_ZIP ] && echo "Apache Karaf bits $KARAF_ZIP not found" && exit 1
+[ -d $ONOS_STAGE ] && echo "ONOS stage $ONOS_STAGE already exists" && exit 1
+
+# Create the stage directory and warp into it
+mkdir -p $ONOS_STAGE
+cd $ONOS_STAGE
+
+# Unroll the Apache Karaf bits, prune them and make ONOS top-level directories.
+unzip -q $KARAF_ZIP && rm -rf $KARAF_DIST/demos
+mkdir bin
+
+# Stage the ONOS admin scripts and patch in Karaf service wrapper extras
+cp -r $ONOS_ROOT/tools/package/bin .
+cp -r $ONOS_ROOT/tools/package/wrapper/* $KARAF_DIST
+
+# Stage the ONOS bundles
+mkdir -p $KARAF_DIST/system/org/onlab 
+cp -r $M2_REPO/org/onlab $KARAF_DIST/system/org/
+
+# Patch the Apache Karaf distribution file to add ONOS features repository
+perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.onlab.onos/onos-features/$ONOS_VERSION/xml/features|" \
+    $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg 
+
+# Patch the Apache Karaf distribution file to load ONOS features
+perl -pi.old -e 's|^(featuresBoot=.*)|\1,wrapper,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-tvue|' \
+    $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg 
+
+# Patch the Apache Karaf distribution with ONOS branding bundle
+cp $M2_REPO/org/onlab/onos/onos-branding/$ONOS_VERSION/onos-branding-*.jar \
+    $ONOS_STAGE/$KARAF_DIST/lib
+
+# Now package up the ONOS tar file
+cd $ONOS_STAGE_ROOT
+COPYFILE_DISABLE=1 tar zcf $ONOS_TAR $ONOS_BITS
+ls -l $ONOS_TAR >&2