From 3f48d47c618b0b8e74c4cd8176bb46faa2e52664 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Wed, 27 Jul 2011 17:24:37 -0500 Subject: 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 Reviewed-by: MATTHEW S. BARTH Reviewed-by: ADAM R. MUHLE --- src/build/tools/hb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src') 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} $*" } -- cgit v1.2.1