#!/bin/sh
# 	$Id: 81.mkiso.sh,v 1.3 2004/10/18 18:56:55 saturnero Exp $	

set -u

. ./config.sh

if [ \! -x /usr/local/bin/mkisofs ]; then
    echo "Missing mkisofs. Please install sysutils/cdrtools from ports collection"
    exit 1
fi\

echo "Saving mtree structure..."
cd $LOCALDIR
mtree -Pcp $FREESBIEBASEDIR | bzip2 -9 > FreeSBIE.root.dist.bz2
mv FreeSBIE.root.dist.bz2 $FREESBIEBASEDIR/dist/

cp $LOCALDIR/files/boot.catalog $FREESBIEBASEDIR/boot

cd $FREESBIEBASEDIR

/usr/local/bin/mkisofs -b boot/cdboot -no-emul-boot -c boot/boot.catalog -R -J -V FreeSBIE -o $PATHISO .
echo "------------------------------------------------------------"
echo "Your FreeSBIE iso is ready to fly and is located in"
echo "$PATHISO."
echo "If you have got an IDE/ATAPI cd burner you"
echo "can use burncd(1) in order to burn it."
echo "If you want to modify your iso later (e.g.: add/remove"
echo "packages), remember to run 9.restorefs.sh (directly or"
echo "from the dialog) before."
echo "------------------------------------------------------------"
