Changed the format on the header, and changed ocache default.

Wanted to make it more readable since there are quite a few variables.
To satisfy existing systems modified the default directory for the
ocache to be located under ${WORKSPACE}/openbmc to maintain function on
some machines that use old defaults. Made a slight change to the cp of
images so now it grabs the whole /deploy directory in case we want sdks.

Change-Id: I1d16bd5ac8c328832d08ba8cc61e79d03228ad95
Signed-off-by: Alanny Lopez <alanny.lopez@ibm.com>
diff --git a/build-setup.sh b/build-setup.sh
index c6251c9..26ff826 100755
--- a/build-setup.sh
+++ b/build-setup.sh
@@ -1,23 +1,41 @@
-#!/bin/bash
-
-# This build script is for running the Jenkins builds using Docker or Kubernetes.
+###############################################################################
 #
-# It expects a few variables which are part of Jenkins build job matrix:
-#   target = barreleye|palmetto|qemu
-#   distro = fedora|ubuntu
-#   imgtag = tag of the Ubuntu or Fedora image to use (default latest)
-#   obmcdir = <name of OpenBMC src dir> (default /tmp/openbmc)
-#   sscdir = directory that will be used for shared state cache
-#   WORKSPACE = <location of base OpenBMC/OpenBMC repo>
-#   BITBAKE_OPTS = <optional, set to "-c populate_sdk" or whatever other
-#                   BitBake options you'd like to pass into the build>
+# This build script is for running the OpenBMC builds as containers with the
+# option of launching the containers with Docker or Kubernetes.
 #
-# There are some optional variables that are related to launching the build
-#   launch = job|pod, what way the build container will be launched. If left
-#            blank launches user docker run, job or pod will launch the
-#            appropriate kind to kubernetes via kubernetes-launch.sh
-#   imgname = defaults to a relatively long but descriptive name, can be
-#             changed or passed to give a specific name to created image
+###############################################################################
+#
+# Variables used for Jenkins build job matrix:
+#  target       = barreleye|palmetto|witherspoon|firestone|garrison|evb-ast2500
+#                 zaius|romulus|qemu
+#  distro       = fedora|ubuntu
+#  imgtag       = Varies by distro. latest|16.04|14.04|trusty|xenial; 23|24|25
+#  ocache       = Path of the OpenBMC repo cache that is used to speed up git
+#                 clones, default directory location "${WORKSPACE}/openbmc"
+#  obmcdir      = Path of the OpenBMC directory, where the build occurs inside
+#                 the container cannot be placed on external storage default
+#                 directory location "/tmp/openbmc"
+#  sscdir       = Path of the BitBake shared-state cache directoy, will default
+#                 to directory "/home/${USER}", used to speed up builds.
+#  WORKSPACE    = Path of the workspace directory where some intermediate files
+#                 and the images will be saved to.
+#
+# Optional Variables:
+#  launch       = job|pod
+#                 Can be left blank to launch via Docker if not using
+#                 Kubernetes to launch the container.
+#                 Job lets you keep a copy of job and container logs on the
+#                 api, can be useful if not using Jenkins as you can run the
+#                 job again via the api without needing this script.
+#                 Pod launches a container which runs to completion without
+#                 saving anything to the api when it completes.
+#  imgname      = Defaults to a relatively long but descriptive name, can be
+#                 changed or passed to give a specific name to created image.
+#  http_proxy   = The HTTP address for the proxy server you wish to connect to.
+#  BITBAKE_OPTS = Set to "-c populate_sdk" or whatever other bitbake options
+#                 you'd like to pass into the build.
+#
+###############################################################################
 
 # Trace bash processing. Set -e so when a step fails, we fail the build
 set -xeo pipefail
@@ -26,10 +44,10 @@
 target=${target:-qemu}
 distro=${distro:-ubuntu}
 imgtag=${imgtag:-latest}
-ocache=${ocache:-/home/openbmc}
 obmcdir=${obmcdir:-/tmp/openbmc}
 sscdir=${sscdir:-${HOME}}
 WORKSPACE=${WORKSPACE:-${HOME}/${RANDOM}${RANDOM}}
+ocache=${ocache:-${WORKSPACE}/openbmc}
 launch=${launch:-}
 http_proxy=${http_proxy:-}
 PROXY=""
@@ -259,7 +277,7 @@
 bitbake ${BITBAKE_OPTS} obmc-phosphor-image
 
 # Copy images out of internal obmcdir into workspace directory
-cp -R ${obmcdir}/build/tmp/deploy/images ${WORKSPACE}/images/
+cp -R ${obmcdir}/build/tmp/deploy ${WORKSPACE}/deploy/
 
 EOF_SCRIPT
 
@@ -307,4 +325,4 @@
 fi
 
 # Timestamp for build
-echo "Build completed, $(date)"
+echo "Build completed, $(date)"
\ No newline at end of file