first cut at on-host installer
authorGreg Price <price@mit.edu>
Sun, 28 Sep 2008 21:11:53 +0000 (17:11 -0400)
committerGreg Price <price@mit.edu>
Sun, 28 Sep 2008 21:11:53 +0000 (17:11 -0400)
svn path=/trunk/packages/sipb-xen-autoinstaller/; revision=931

common/usr/sbin/sipb-xen-create-image
debian/changelog
host/usr/sbin/sipb-xen-install [new file with mode: 0644]

index f0f685a..ffba79d 100644 (file)
@@ -7,8 +7,12 @@
 
 echo ,"${IMAGESIZE}"$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 "$TARGET"
 
 
 echo ,"${IMAGESIZE}"$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 "$TARGET"
 
+kpartx -a "$TARGET"    # should be no-op in guest
+
 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
 
 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
 
+kpartx -d $VOLUME
+
 exit 0
 exit 0
index 9d6492a..d8000a9 100644 (file)
@@ -1,10 +1,10 @@
 sipb-xen-autoinstaller (2.5) unstable; urgency=low
 
 sipb-xen-autoinstaller (2.5) unstable; urgency=low
 
-  * Add sipb-xen-autoinstaller-host binary package, to contain
-    autoinstaller for system VMs
+  * Add sipb-xen-autoinstaller-host binary package
   * Put common files in both binary packages
   * Put common files in both binary packages
+  * Add beginnings of an installer script in -host package
 
 
- -- Greg Price <price@mit.edu>  Sun, 28 Sep 2008 16:36:56 -0400
+ -- Greg Price <price@mit.edu>  Sun, 28 Sep 2008 17:07:51 -0400
 
 sipb-xen-autoinstaller (2.4) unstable; urgency=low
 
 
 sipb-xen-autoinstaller (2.4) unstable; urgency=low
 
diff --git a/host/usr/sbin/sipb-xen-install b/host/usr/sbin/sipb-xen-install
new file mode 100644 (file)
index 0000000..b7d9c66
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# If this script is interrupted, it may not clean up after itself.
+# In particular, it may leave ${TARGET}1 mounted somewhere in tmp.
+# Unmount it, then kpartx -d $TARGET to clean up.
+
+export PATH #WTF?
+
+export HOSTNAME="$2"
+export DIST="$3"
+export MIRROR="$4"
+export IMAGESIZE="$5"
+export IP="$6"
+
+export ARCH=amd64
+
+#LVSIZE=`lvs --noheadings --units M --nosuffix -o Size /dev/xenvg/d_foobar_hda | sed 's/\..*//'`
+
+if [ -z "$IP" ]; then
+    IP=`host $HOSTNAME.xvm.mit.edu | sed 's/.* //' | head -n 1`
+fi
+
+export TARGET=/dev/mapper/xenvg-d_$(echo "$HOSTNAME" | sed -e 's/-/--/g')_hda
+
+/usr/sbin/sipb-xen-create-image
+