#!/bin/sh -e

HOST_ARCH=`dpkg --print-architecture`
if [ `whoami` != "root" ]
then
   echo "Needs root privileges to loop mount"
   exit
fi

if [ "$1" = "--arch" ]; then
    ARCH=$2
    shift 2
else
    ARCH=$HOST_ARCH
fi

if [ ! -f /usr/share/autoinstall/$ARCH/make-autoinst-disk ]; then
    echo "make-autoinst-disk: unknown architecture $ARCH" >&2
    exit 1
fi

exec /usr/share/autoinstall/$ARCH/make-autoinst-disk $@

echo "make-autoinst-disk: could not exec" >&2
exit 1

# vim:ai:et:sts=4:sw=4:tw=0:
