while [ -n "$1" ]; do
case "$1" in
+ (--debug)
+ DEBUG=1
+ ;;
(-n|--name)
shift
if [ -z "$1" ]; then
tmpdir=$(mktemp -d)
tar -C $BASEDIR/preseed/$SUITE -cf $tmpdir/commands.tar commands
-extra_args="auto $CONSOLE \
+extra_kargs="auto $CONSOLE \
hostname=${HOSTNAME%%.*} \
domain=${HOSTNAME#*.}"
+extra_opts=
+if [ -n "$DEBUG" ]; then
+ extra_opts='--debug'
+fi
+
if [ -n "$IPADDRESS" ]; then
if [ -z "$GATEWAY" ] && [ -x $(command -v ipcalc) ]; then
# default to the first IP in the network
IPADDRESS="${IPADDRESS%/*}"
: ${NAMESERVER:=$GATEWAY}
- extra_args="$extra_args netcfg/disable_dhcp=true \
+ extra_kargs="$extra_kargs netcfg/disable_dhcp=true \
netcfg/get_ipaddress=$IPADDRESS \
netcfg/get_netmask=$NETMASK \
netcfg/get_gateway=$GATEWAY \
BRIDGE=wan
else
- extra_args="$extra_args netcfg/disable_dhcp=false"
+ extra_kargs="$extra_kargs netcfg/disable_dhcp=false"
BRIDGE=virt-br
fi
virsh --connect=$QEMU_URI vol-create-as $STORAGE_POOL virt-$HOSTNAME ${DISK}G
if [ $WIPE = 1 ]; then
+ echo >&2 "Wiping disk…"
virsh --connect=$QEMU_URI vol-wipe --pool $STORAGE_POOL --algorithm zero virt-$HOSTNAME
fi
-l $BASEDIR/installer-amd64 \
--initrd-inject=$BASEDIR/preseed/$SUITE/preseed.cfg \
--initrd-inject=$tmpdir/commands.tar \
- --noautoconsole --autostart \
- --extra-args="$extra_args" \
+ --prompt --noautoconsole --autostart \
+ --extra-args="$extra_kargs" \
"$@"
virsh --connect=$QEMU_URI console $HOSTNAME
-if [ $RESTART = 1]; then
+if [ $RESTART = 1 ]; then
virsh --connect=$QEMU_URI "start $HOSTNAME; console $HOSTNAME"
fi