X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-autoinstaller.git/blobdiff_plain/f7e92d5179e6b400c34b897fcbdfd8a61b08b68f..04a85e82bb3cd2929c4ebb0e8df2a97c73eb4890:/guest/etc/init.d/rcS.sipb-xen diff --git a/guest/etc/init.d/rcS.sipb-xen b/guest/etc/init.d/rcS.sipb-xen index 9431cd6..ff605d6 100644 --- a/guest/etc/init.d/rcS.sipb-xen +++ b/guest/etc/init.d/rcS.sipb-xen @@ -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