#!/bin/sh

# newdom <size> <image> <ip> <root details>  
# newdom 262144 ../../../xenolinux-2.4.16-kdb/arch/xeno/boot/image 128.232.35.240 root=/dev/nfs nfsroot=/usr/groups/srgboot/xxx/roots/root0
# newdom 262144 ../../../xenolinux-2.4.16-kdb/arch/xeno/boot/image 128.232.35.240 root=/dev/xhda7 


VIFINIT=./vifinit
DOM_BUILDER=./domain_builder

SIZE=${1:?"size missing"}
IMAGE=${2:?"image missing"}
IP=${3:?"IP missing"}

shift; shift; shift

echo ARGS $*

$DOM_BUILDER $SIZE $IMAGE 1 $*
DOM=$?

echo DOM= $DOM

$VIFINIT $DOM 0 $IP


