. $MYPWD/../locations.include
TREE=$1
if [ ! -d $1 ]; then
    echo "First parameter must be the directory to place at the root of the CD"
    exit 1
fi

DEST=$2
if [ -z "$2" ]; then
    echo "Second parameter must be the name of the final iso image."
    exit 1
fi

echo "Creating $2 from $1..."
cd $TREE
BOOTIMG="images/SL/boot.img"
echo "Boot image is" $BOOTIMG
BOOTOPTS="-no-emul-boot"

# Create the image (This is for disk 1)

mkisofs \
	-A "$VERSION DISC1" \
	-V "$VERSION" \
	-R -V -v -v -J -T \
	-x ./lost+found \
        $BOOTOPTS \
 	-b $BOOTIMG \
	-o $DEST \
	.	
