#!/bin/bash # cd in this command's directory cd $(dirname $0) #Getting the env. as passed by the test framework - mostly MACADDR and NODE_ISO CONFIG=start-qemu.conf if [ ! -e ${CONFIG} ];then echo "File for MAC Address not found" exit 1 fi . $CONFIG #default Value SCRIPT=./qemu-ifup HDA=./FILENAME=hda_5.raw # qemu parameters RAM=520; TAP="tap,script=$SCRIPT"; #check for the creation of new HDA if [ -e "$HDA" ]; then echo "Disk already existing removing it..." rm -rf $HDA fi #Creating new HDA echo "Creating hard disk for Qemu install under $HDA" img=$(qemu-img create $FILENAME 10G) if [ -z "$img" ];then echo "Can't Create disk image..." exit 1 fi echo "New $HDA is created..." #Command for running the Qemu Emulator ARGS="-boot d -cdrom ${NODE_ISO} -hda ${HDA} -m ${RAM} -net nic,macaddr=${MACADDR} -net $TAP -nographic"; echo "Running qemu $ARGS"; qemu $ARGS exit