Don't hardcode netmask and gateway
authorGreg Brockman <gdb@mit.edu>
Sat, 2 Jan 2010 04:48:19 +0000 (23:48 -0500)
committerGreg Brockman <gdb@mit.edu>
Sat, 2 Jan 2010 04:48:19 +0000 (23:48 -0500)
svn path=/trunk/packages/invirt-autoinstaller/; revision=2844

common/usr/sbin/invirt-create-image
debian/changelog
debian/control

index a813e75..a00561b 100644 (file)
@@ -5,15 +5,25 @@
 #  FSSIZE the desired filesystem size in mebibytes (rest will be swap)
 #  ARCH, DIST, MIRROR
 #  HOSTNAME, IP
 #  FSSIZE the desired filesystem size in mebibytes (rest will be swap)
 #  ARCH, DIST, MIRROR
 #  HOSTNAME, IP
+#
+# Optional: GATEWAY, NETMASK.  These default to values in invirt-getconf, if installed
 
 set -e
 
 
 set -e
 
+if [ "$GATEWAY" = "" ]; then
+    GATEWAY=$(invirt-getconf autoinstaller.gateway)
+fi
+
+if [ "$NETMASK" = "" ]; then
+    NETMASK=$(invirt-getconf autoinstaller.netmask)
+fi
+
 echo ,"${FSSIZE}"$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 "$TARGET"
 
 dmsetup info "$TARGET" 2>/dev/null && kpartx -a "$TARGET"
 
 xen-create-image --image-dev "${TARGET}1" --swap-dev "${TARGET}2" --fs ext3 --ide \
 echo ,"${FSSIZE}"$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 "$TARGET"
 
 dmsetup info "$TARGET" 2>/dev/null && kpartx -a "$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 \
+ --hostname "$HOSTNAME" --ip="$IP" --netmask="$NETMASK" --gateway="$GATEWAY" \
  --arch "$ARCH" --dist "$DIST" --mirror "$MIRROR" --cache=yes --verbose
 
 dmsetup info "$TARGET" 2>/dev/null && kpartx -d "$TARGET"
  --arch "$ARCH" --dist "$DIST" --mirror "$MIRROR" --cache=yes --verbose
 
 dmsetup info "$TARGET" 2>/dev/null && kpartx -d "$TARGET"
index bdd5899..ac448e7 100644 (file)
@@ -1,3 +1,9 @@
+invirt-autoinstaller (0.0.33) unstable; urgency=low
+
+  * Don't hardcode netmask and gateway
+
+ -- Greg Brockman <gdb@mit.edu>  Fri, 01 Jan 2010 23:31:55 -0500
+
 invirt-autoinstaller (0.0.32) unstable; urgency=low
 
   * Revert 0.0.31 - it didn't work, and left autoinstalled VMs that used
 invirt-autoinstaller (0.0.32) unstable; urgency=low
 
   * Revert 0.0.31 - it didn't work, and left autoinstalled VMs that used
index 725fcb8..8d1a753 100644 (file)
@@ -17,6 +17,6 @@ Package: invirt-autoinstaller-guest
 Architecture: all
 Provides: ${diverted-files}
 Conflicts: ${diverted-files}, sysvinit, upstart, xen-hypervisor
 Architecture: all
 Provides: ${diverted-files}
 Conflicts: ${diverted-files}, sysvinit, upstart, xen-hypervisor
-Depends: ${misc:Depends}, patch, xen-tools, busybox-static, lvm2, kpartx, aptitude
+Depends: ${misc:Depends}, patch, xen-tools, busybox-static, lvm2, kpartx, aptitude, invirt-base
 Description: SIPB Xen automatic guest-image installer system (guest)
  This is our automatic guest-image installer system.
 Description: SIPB Xen automatic guest-image installer system (guest)
  This is our automatic guest-image installer system.