All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
8 QEMU_URI=qemu:///system
10 CONSOLE='console=tty0 console=ttyS0,115200n8'
17 echo >&2 'E: --name/-n needs hostname argument'
25 echo >&2 'E: --ipaddress/-i needs IP address/netmask'
31 echo >&2 'E: missing netmask'
40 echo >&2 'E: --ram/-r needs number (megabytes)'
48 echo >&2 'E: --size/-s needs size argument'
57 if [ -z "${HOSTNAME:-}" ]; then
58 echo >&2 'E: hostname is required'
62 BASEDIR=$(cd ${0%/*}; pwd)
65 tar -C $BASEDIR/preseed/$SUITE -cf $tmpdir/commands.tar commands
67 extra_args="auto $CONSOLE \
68 hostname=${HOSTNAME%%.*} \
69 domain=${HOSTNAME#*.}"
71 if [ -n "$IPADDRESS" ]; then
72 if [ -z "$GATEWAY" ]; then
73 # default to the first IP in the network
74 GATEWAY=$(ipcalc $IPADDRESS | grep HostMin | awk '{print $2}')
76 NETMASK="${IPADDRESS#*/}"
77 IPADDRESS="${IPADDRESS%/*}"
78 : ${NAMESERVER:=$GATEWAY}
80 extra_args="$extra_args netcfg/disable_dhcp=true \
81 netcfg/get_ipaddress=$IPADDRESS \
82 netcfg/get_netmask=$NETMASK \
83 netcfg/get_gateway=$GATEWAY \
84 netcfg/get_nameservers=$NAMESERVER"
87 extra_args="$extra_args netcfg/disable_dhcp=false"
96 if [ -n "$IPADDRESS" ]; then
101 nameserver: $NAMESERVER
111 exec virt-install --connect=$QEMU_URI \
114 --disk pool=default,size=$SIZE \
118 --watchdog i6300esb,action=reset \
119 --os-variant=debian$SUITE \
120 -l $BASEDIR/installer-amd64 \
121 --initrd-inject=$BASEDIR/preseed/$SUITE/preseed.cfg \
122 --initrd-inject=$tmpdir/commands.tar \
123 --extra-args="$extra_args" \