--- /dev/null
+#!/bin/bash
+# Usage: no command-line args.
+# "arguments" come in environment:
+# TARGET a device filename, IMAGESIZE its size in XXXX what unit?
+# ARCH, DIST, MIRROR
+# HOSTNAME, IP
+
+echo ,"${IMAGESIZE}"$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 "$TARGET"
+
+xen-create-image --image-dev "${TARGET}1" --swap-dev "${TARGET}2" --fs ext3 --ide \
+ --hostname "$HOSTNAME" --ip="$IP" --netmask=255.255.0.0 --gateway=18.181.0.1 \
+ --arch "$ARCH" --dist "$DIST" --mirror "$MIRROR" --cache=yes
+
+exit 0
+sipb-xen-autoinstaller (2.5) unstable; urgency=low
+
+ * Add sipb-xen-autoinstaller-host binary package, to contain
+ autoinstaller for system VMs
+ * Put common files in both binary packages
+
+ -- Greg Price <price@mit.edu> Sun, 28 Sep 2008 16:36:56 -0400
+
sipb-xen-autoinstaller (2.4) unstable; urgency=low
* Switch to using just sipb-database options on the host
Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0), config-package-dev (>= 4.5~)
Standards-Version: 3.7.2
-Package: sipb-xen-autoinstaller-guest
+Package: sipb-xen-autoinstaller-host
Architecture: all
Provides: ${diverted-files}
Conflicts: ${diverted-files}
-Depends: ${misc:Depends}, patch, xen-tools, busybox-static
+Depends: ${misc:Depends}, patch, xen-tools, sipb-xen-dom0
Conflicts: sysvinit, upstart
-Description: SIPB Xen automatic guest-image installer system (guest)
+Description: SIPB Xen automatic guest-image installer system (host)
This is our automatic guest-image installer system.
-Package: sipb-xen-autoinstaller-host
+Package: sipb-xen-autoinstaller-guest
Architecture: all
-Depends: ${misc:Depends}, sipb-xen-host-master
-Description: SIPB Xen automatic guest-image installer system (host)
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Depends: ${misc:Depends}, patch, xen-tools, busybox-static, lvm2
+Conflicts: sysvinit, upstart
+Description: SIPB Xen automatic guest-image installer system (guest)
This is our automatic guest-image installer system.
Build-Depends: @cdbs@
Standards-Version: 3.7.2
+Package: sipb-xen-autoinstaller-host
+Architecture: all
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Depends: ${misc:Depends}, patch, xen-tools, sipb-xen-dom0
+Conflicts: sysvinit, upstart
+Description: SIPB Xen automatic guest-image installer system (host)
+ This is our automatic guest-image installer system.
+
Package: sipb-xen-autoinstaller-guest
Architecture: all
Provides: ${diverted-files}
--- /dev/null
+common/* .
+host/* .
/usr/lib/klibc/bin/ipconfig -d ${x#ip=}
;;
mirror=*)
- MIRROR=${x#mirror=}
+ export MIRROR=${x#mirror=}
;;
dist=*)
- DIST=${x#dist=}
+ export DIST=${x#dist=}
;;
arch=*)
- ARCH=${x#arch=}
+ export ARCH=${x#arch=}
;;
imagesize=*)
- IMAGESIZE=${x#imagesize=}
+ export IMAGESIZE=${x#imagesize=}
;;
noinstall)
exit 0
;;
esac
done
+
mount -t tmpfs none /var/log
mount -t tmpfs none /tmp
+export TARGET=/dev/hda
+export ARCH=${ARCH-amd64}
+export IP=$(ifconfig eth0 | sed -n 's/.*inet addr:\([0-9\.]*\).*/\1/p')
+export HOSTNAME=$(hostname)
-TARGET=/dev/hda
-ARCH=${ARCH-amd64}
-IP=$(ifconfig eth0 | sed -n 's/.*inet addr:\([0-9\.]*\).*/\1/p')
-HOSTNAME=$(hostname)
-
-echo ,${IMAGESIZE}$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 $TARGET
-
-xen-create-image --image-dev ${TARGET}1 --swap-dev ${TARGET}2 --fs ext3 --ide --arch $ARCH --dist $DIST --hostname $HOSTNAME --mirror $MIRROR --ip=$IP --netmask=255.255.0.0 --gateway=18.181.0.1 --cache=yes
+# args passed through environment rather than as 7 positional args
+/usr/sbin/sipb-xen-create-image
busybox poweroff
exit 0