start udev in guest autoinstaller
[invirt/packages/invirt-autoinstaller.git] / guest / etc / init.d / rcS.sipb-xen
old mode 100644 (file)
new mode 100755 (executable)
index 9431cd6..f96dba2
@@ -1,38 +1,40 @@
 #!/bin/bash
-for x in $(cat /proc/cmdline); do
+eval "set -- $(cat /proc/cmdline)"
+for x; do
     case $x in
        ip=*)
        /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 FSSIZE=${x#imagesize=}
        ;;
-       noinstall)
+       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
+/etc/init.d/udev start
 
-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