[Debian-NP-Commits] r281 - people/vagrant/simple-cdd

Vagrant Cascadian debian-np-devel@lists.alioth.debian.org
Sun, 28 Nov 2004 13:40:04 -0700


Author: vagrant-guest
Date: Sun Nov 28 13:38:51 2004
New Revision: 281

Modified:
   people/vagrant/simple-cdd/qemu-test
Log:
little more error checking.


Modified: people/vagrant/simple-cdd/qemu-test
==============================================================================
--- people/vagrant/simple-cdd/qemu-test	(original)
+++ people/vagrant/simple-cdd/qemu-test	Sun Nov 28 13:38:51 2004
@@ -9,19 +9,39 @@
 
 . CONF.sh
 
+test "-r" qemu-test.conf && . qemu-test.conf
+
 hd_img=$HOME/nobackup/qemu.hd.img
 cd_img=$OUT/sarge-i386-1.raw
 mem=96
 
+qemu_opts="-nographic -user-net"
+
+if [ -n "$mem" ]; then
+  qemu_opts="$qemu_opts -m $mem"
+fi
+
+if [ -n "$hd_img" ] && [ -r "$hd_img" ]; then
+  qemu_opts="$qemu_opts -hda $hd_img"
+else
+  echo "WARNING: hard drive image not readable: $hd_img"
+fi
+
+if [ -n "$cd_img" ] && [ -r "$cd_img" ]; then
+  qemu_opts="$qemu_opts -cdrom $cd_img"
+else
+  echo "WARNING: CD image not readable: $cd_img"
+fi
+
 # build the CD image
 ./build-simple-cdd 
 
 # boot the installer
-qemu -nographic -user-net -m $mem -hda $hd_img -cdrom $cd_img -boot d 
+qemu $qemu_opts -boot d 
 
 # take a break and start fresh
 sleep 5 
 reset
 
 # boot to the installed system
-qemu -nographic -user-net -m $mem -hda $hd_img -cdrom $cd_img -boot c 
+qemu $qemu_opts -boot d