#!/bin/sh

DISK0IMAGE=$1
#MEDIAKIT=$2
#ARCH=`uname -p`

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

echo "		Installing Products ..."

echo "		Installing os files ..."
#cd products/$ARCH/os
cd products/os
mkdir -p $DISK0IMAGE/webstart/os
chmod 777 $DISK0IMAGE/webstart/os
find . -name SCCS  -prune -o -print | cpio -dump $DISK0IMAGE/webstart/os
cd ..

	echo "		Installing media_kits ..."
if [ -d media_kits ]; then
	cd media_kits
	mkdir -p $DISK0IMAGE/webstart/media_kits
	chmod 777 $DISK0IMAGE/webstart/media_kits
	find . -name SCCS  -prune -o -print | cpio -dump $DISK0IMAGE/webstart/media_kits
	cd ..
else 
	echo "		No media_kits directory found..."
fi

