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.
9 QEMU_URI=qemu:///system
11 CONSOLE='console=tty0 console=ttyS0,115200n8'
18 echo >&2 'E: --name/-n needs hostname argument'
26 echo >&2 'E: --ipaddress/-i needs IP address/netmask'
32 echo >&2 'E: missing netmask'
41 echo >&2 'E: --ram/-r needs number (megabytes)'
49 echo >&2 'E: --size/-s needs size argument'
58 if [ -z "${HOSTNAME:-}" ]; then
59 echo >&2 'E: hostname is required'
63 BASEDIR=$(cd ${0%/*}; pwd)
66 tar -C $BASEDIR/preseed/$SUITE -cf $tmpdir/commands.tar commands
68 extra_args="auto $CONSOLE \
69 hostname=${HOSTNAME%%.*} \
70 domain=${HOSTNAME#*.}"
72 if [ -n "$IPADDRESS" ]; then
73 if [ -z "$GATEWAY" ]; then
74 # default to the first IP in the network
75 GATEWAY=$(ipcalc $IPADDRESS | grep HostMin | awk '{print $2}')
77 NETMASK="${IPADDRESS#*/}"
78 IPADDRESS="${IPADDRESS%/*}"
79 : ${NAMESERVER:=$GATEWAY}
81 extra_args="$extra_args netcfg/disable_dhcp=true \
82 netcfg/get_ipaddress=$IPADDRESS \
83 netcfg/get_netmask=$NETMASK \
84 netcfg/get_gateway=$GATEWAY \
85 netcfg/get_nameservers=$NAMESERVER"
88 extra_args="$extra_args netcfg/disable_dhcp=false"
97 if [ -n "$IPADDRESS" ]; then
102 nameserver: $NAMESERVER
112 exec virt-install --connect=$QEMU_URI \
115 --disk pool=default,size=$SIZE \
119 --watchdog i6300esb,action=reset \
120 --os-variant=debian$SUITE \
121 -l $BASEDIR/installer-amd64 \
122 --initrd-inject=$BASEDIR/preseed/$SUITE/preseed.cfg \
123 --initrd-inject=$tmpdir/commands.tar \
124 --extra-args="$extra_args" \