X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-autoinstaller.git/blobdiff_plain/0d0b6587c5d55462ed4fcae062e492f1cd8cf594..d4c669fb06d9aec3e5778a3b63de23b60b8f6c3a:/common/usr/sbin/sipb-xen-create-image?ds=sidebyside diff --git a/common/usr/sbin/sipb-xen-create-image b/common/usr/sbin/sipb-xen-create-image index ffba79d..2e71fde 100644 --- a/common/usr/sbin/sipb-xen-create-image +++ b/common/usr/sbin/sipb-xen-create-image @@ -1,18 +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 -kpartx -a "$TARGET" # should be no-op in guest +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 \ - --arch "$ARCH" --dist "$DIST" --mirror "$MIRROR" --cache=yes + --arch "$ARCH" --dist "$DIST" --mirror "$MIRROR" --cache=yes --verbose -kpartx -d $VOLUME +dmsetup info "$TARGET" 2>/dev/null && kpartx -d "$TARGET" exit 0