summaryrefslogtreecommitdiffstats
path: root/src/build
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-07-27 17:24:37 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-07-28 11:24:18 -0500
commit3f48d47c618b0b8e74c4cd8176bb46faa2e52664 (patch)
tree1d205f78e0ec8e9080dafc81393eb9c04a5699b4 /src/build
parent4991a039cc2fc8a5ea6c28c21d7c7b07ffeaa36b (diff)
downloadtalos-hostboot-3f48d47c618b0b8e74c4cd8176bb46faa2e52664.tar.gz
talos-hostboot-3f48d47c618b0b8e74c4cd8176bb46faa2e52664.zip
Add sandbox backing build checking to hb script
Change-Id: I2d4c4a09a78befd5ac7a3ed70755c9324e215555 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/218 Tested-by: Jenkins Server Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com> Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com> Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com>
Diffstat (limited to 'src/build')
-rwxr-xr-xsrc/build/tools/hb31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/build/tools/hb b/src/build/tools/hb
index 6e6531b3a..f2cfac8de 100755
--- a/src/build/tools/hb
+++ b/src/build/tools/hb
@@ -6,6 +6,11 @@ execute_in_sandbox()
[ -z "${SANDBOXROOT}" ] && echo "Missing SANDBOXROOT." && exit -1
[ -z "${SANDBOXNAME}" ] && echo "Missing SANDBOXNAME." && exit -1
+ if [ ! -d "${SANDBOXBASE}" ]; then
+ echo "Sandbox does not exist. Create with 'hb simsetup."
+ exit -1
+ fi
+
SANDBOXRC="${SANDBOXROOT}/hbsandboxrc"
WORKON_CMD="workon -rc ${SANDBOXRC} -sb ${SANDBOXNAME} -m ppc "
@@ -65,6 +70,9 @@ hb_helptext()
echo " Copies hostboot images and simics scripts into the"
echo " simics workspace."
echo
+ echo " Options:"
+ echo " --test : Copy test images (as opposed to non-test)."
+ echo
echo " See also:"
echo " simsetup"
;;
@@ -173,6 +181,10 @@ hb_workon()
hb_prime()
{
if [ -n "${SANDBOXBASE}" ]; then
+ if [ ! -d "${SANDBOXBASE}" ]; then
+ echo "Sandbox does not exist. Create with 'hb simsetup."
+ exit -1
+ fi
cpfiles.pl $*
else
echo "SANDBOXBASE not set."
@@ -216,6 +228,25 @@ hb_simsetup()
hb_startsimics()
{
+ [ -z "${SANDBOXBASE}" ] && echo "Missing SANDBOXBASE." && exit -1
+ [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1
+
+ if [ ! -d "${SANDBOXBASE}" ]; then
+ echo "Sandbox does not exist. Create with 'hb simsetup."
+ exit -1
+ fi
+
+ SBDRIVER=`cat ${SANDBOXBASE}/rc_files/sb.conf | \
+ grep "backing_build" | awk '{ print $3 }'`
+ DRIVER=`cat ${HOSTBOOTROOT}/src/build/citest/etc/bbuild`
+
+ if [ ${SBDRIVER} != ${DRIVER} ]; then
+ echo "Driver mismatch between sandbox and src/build/citest/etc/bbuild."
+ echo "Sandbox at ${SBDRIVER}"
+ echo "Update sandbox with 'hb simsetup'."
+ exit -1
+ fi
+
execute_in_sandbox \
"start_simics -machine ${MACHINE:-SALERNO} ${SIMICSOPTIONS} $*"
}
OpenPOWER on IntegriCloud