X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-autoinstaller.git/blobdiff_plain/04a85e82bb3cd2929c4ebb0e8df2a97c73eb4890..c0606e676ee62671e74640cb7fb5bffc8b6b1abd:/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 index f0f685a..5f867ad 100644 --- a/common/usr/sbin/sipb-xen-create-image +++ b/common/usr/sbin/sipb-xen-create-image @@ -1,14 +1,21 @@ #!/bin/bash # Usage: no command-line args. # "arguments" come in environment: -# TARGET a device filename, IMAGESIZE its size in XXXX what unit? +# TARGET a device filename +# FSSIZE the desired filesystem size in megabytes (rest will be swap) # ARCH, DIST, MIRROR # HOSTNAME, IP -echo ,"${IMAGESIZE}"$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 "$TARGET" +set -e + +echo ,"${FSSIZE}"$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 "$TARGET" + +dmsetup info "$TARGET" && 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 \ - --arch "$ARCH" --dist "$DIST" --mirror "$MIRROR" --cache=yes + --arch "$ARCH" --dist "$DIST" --mirror "$MIRROR" --cache=yes --verbose + +dmsetup info "$TARGET" && kpartx -d "$TARGET" exit 0