#!/bin/sh

DISK0IMAGE=$1
BOOTIMAGE=$2
ARCH=`uname -p`
if [ $ARCH = i386 ];then
	ZIP=/home/mattw/info-zip/zip22_x86/zip
else
        ZIP=/opt/info-zip/zip22/zip
fi


if [ `/usr/ucb/whoami` != "root" ]; then
        echo "You Must be root."
        exit 1
fi
if [ ! "$BOOTIMAGE" -o "$1" = '-h' -o "$BOOTIMAGE" = '-help' ]; then
        echo "Usage: install_kiosk [Solaris boot image absolute path]."
        exit 1
fi

echo "		Installing KIOSK ..."

if [ ! -d $DISK0IMAGE/webstart/kiosk ];then
	mkdir $DISK0IMAGE/webstart/kiosk
fi

chmod 777 $DISK0IMAGE/webstart/kiosk
find kiosk -name SCCS -prune -o -print | cpio -odum -O $BOOTIMAGE/webstart/boot/kiosk.cpio

$ZIP $BOOTIMAGE/webstart/boot/kiosk.cpio.zip $BOOTIMAGE/webstart/boot/kiosk.cpio
rm $BOOTIMAGE/webstart/boot/kiosk.cpio
