Changeset 2798 in /cluster/svnroot


Ignore:
Timestamp:
Nov 4, 2010 12:27:54 AM (10 years ago)
Author:
skylar
Message:

doesn't quite work yet, need to deal with tar extraction (#529)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar-devel/bin/setup_dev_vm

    r2797 r2798  
    2323# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2424
    25 function system_wrapper() {
    26         CMD=$1
    27         shift
    28         ARGS=$@
    29 
    30         OUT=$(${CMD} ${ARGS})
    31         RC=$?
    32         if test ${RC} -ne 0; then
    33                 fatal "${CMD} ${ARGS} failed, ${RC}: ${OUT}"
    34         fi
    35 }
     25set -xe
    3626
    3727function fatal() {
    3828        MSG=$1
    3929       
    40         echo ${MSG} >&2
     30        echo "$(basename $0): ${MSG}" >&2
    4131       
    4232        exit 2
     
    5141        test ${ARCH} = "i686" ||
    5242        test ${ARCH} = "athlon"; then
     43        ARCH=i386
    5344        VB_OS=Debian
    5445elif test ${ARCH} = "x86_64"; then
    55         VB_OS=Debian64
     46        ARCH=amd64
     47        VB_OS=Debian_64
    5648else
    5749        fatal "${ARCH} not known architecture!"
     
    5951fi
    6052
    61 IMG_URL="http://bigfe.cluster.earlham.edu/bccd-vboxdev/bccd-vboxdev.${ARCH}.tar.bz2"
     53FILE=bccd-vboxdev.${ARCH}.tar.bz2
     54IMG_URL="http://bigfe.cluster.earlham.edu/bccd-vboxdev/${FILE}"
    6255VDI_PATH=/var/lib/vbox
    6356VBDEV_NAME=bccd-vboxdev
    6457
    6558if ! test -d ${VDI_PATH}; then
    66         system_wrapper mkdir -p ${VDI_PATH}
     59        mkdir -p ${VDI_PATH}
    6760fi
    6861
    6962pushd ${VDI_PATH}
    70 system_wrapper wget -c ${IMG_URL}{,.md5}
     63wget -c ${IMG_URL}{,.md5}
     64md5sum -c ${FILE}.md5
    7165popd
    7266
    73 system_wrapper VBoxManage createvm --name bccd-vboxdev --ostype ${OS}
     67# Don't die if grep can't find VM
     68set +e
     69VBoxManage list|grep -q \"${VBDEV_NAME}\"
     70if test $? -eq 0; then
     71        fatal "${VBDEV_NAME} already exists!"
     72fi
     73set -e
     74
     75VBoxManage createvm --name ${VBDEV_NAME} --ostype ${VB_OS} --register
     76
     77VBoxManage modifyvm ${VBDEV_NAME} --memory 1024 --nic1 bridged \
     78        --nictype1 82545EM --bridgeadapter1 eth0 --vrdp on \
     79        --vrdpaddress 127.0.0.1 --vrdpport 4001 --vrdpauthtype null --boot1 disk
     80
     81VBoxManage storagectl ${VBDEV_NAME} --name sata0 --add sata \
     82        --controller IntelAHCI --sataportcount 4
     83
     84VBoxManage openmedium disk ${VDI_PATH}/${FILE}
     85
     86VBoxManage storageattach ${VBDEV_NAME}--storagectl sata0 --port 0 --type hdd --medium ${VDI_PATH}/${FILE} --device 0
Note: See TracChangeset for help on using the changeset viewer.