factor out common autoinstaller code for both guest and host
[invirt/packages/invirt-autoinstaller.git] / common / usr / sbin / sipb-xen-create-image
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