factor out common autoinstaller code for both guest and host
authorGreg Price <price@mit.edu>
Sun, 28 Sep 2008 20:40:06 +0000 (16:40 -0400)
committerGreg Price <price@mit.edu>
Sun, 28 Sep 2008 20:40:06 +0000 (16:40 -0400)
svn path=/trunk/packages/sipb-xen-autoinstaller/; revision=929

17 files changed:
common/usr/lib/xen-tools/debian.d/91-make-fstab [moved from guest/usr/lib/xen-tools/debian.d/91-make-fstab with 100% similarity]
common/usr/lib/xen-tools/debian.d/97-setup-grub [moved from guest/usr/lib/xen-tools/debian.d/97-setup-grub with 100% similarity]
common/usr/lib/xen-tools/debian.d/patches/common.diff [moved from guest/usr/lib/xen-tools/debian.d/patches/common.diff with 100% similarity]
common/usr/lib/xen-tools/debian.d/patches/inittab.diff [moved from guest/usr/lib/xen-tools/debian.d/patches/inittab.diff with 100% similarity]
common/usr/lib/xen-tools/edgy.d/91-make-fstab [moved from guest/usr/lib/xen-tools/edgy.d/91-make-fstab with 100% similarity]
common/usr/lib/xen-tools/edgy.d/97-setup-grub [moved from guest/usr/lib/xen-tools/edgy.d/97-setup-grub with 100% similarity]
common/usr/lib/xen-tools/edgy.d/patches/common.diff [moved from guest/usr/lib/xen-tools/edgy.d/patches/common.diff with 100% similarity]
common/usr/lib/xen-tools/edgy.d/patches/event.d.diff [moved from guest/usr/lib/xen-tools/edgy.d/patches/event.d.diff with 100% similarity]
common/usr/lib/xen-tools/patches/common.diff [moved from guest/usr/lib/xen-tools/patches/common.diff with 100% similarity]
common/usr/lib/xen-tools/patches/event.d.diff [moved from guest/usr/lib/xen-tools/patches/event.d.diff with 100% similarity]
common/usr/sbin/sipb-xen-create-image [new file with mode: 0644]
debian/changelog
debian/control
debian/control.in
debian/sipb-xen-autoinstaller-guest.install
debian/sipb-xen-autoinstaller-host.install [new file with mode: 0644]
guest/etc/init.d/rcS.sipb-xen

diff --git a/common/usr/sbin/sipb-xen-create-image b/common/usr/sbin/sipb-xen-create-image
new file mode 100644 (file)
index 0000000..f0f685a
--- /dev/null
@@ -0,0 +1,14 @@
+#!/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
index abb993d..9d6492a 100644 (file)
@@ -1,3 +1,11 @@
+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
index f8fee41..424ff19 100644 (file)
@@ -5,17 +5,20 @@ Maintainer: SIPB Xen Project <sipb-xen@mit.edu>
 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.
index 2646c7a..0f7c4d2 100644 (file)
@@ -5,6 +5,15 @@ Maintainer: SIPB Xen Project <sipb-xen@mit.edu>
 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}
diff --git a/debian/sipb-xen-autoinstaller-host.install b/debian/sipb-xen-autoinstaller-host.install
new file mode 100644 (file)
index 0000000..27acdc4
--- /dev/null
@@ -0,0 +1,2 @@
+common/* .
+host/* .
index 9431cd6..ff605d6 100644 (file)
@@ -5,34 +5,33 @@ for x in $(cat /proc/cmdline); do
        /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