#!/bin/sh
##########################################################################
##                                                                      ##
## Burn the cd                                                          ##
##                                                                      ##
## This program is free software; you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation; either version 2 of the License, or    ##
## (at your option) any later version.                                  ##
##                                                                      ##
##########################################################################

. config_build
. "$SCRIPTS"/misc/lib/lib_fail

echo "----------------------------------"
echo "        burning rescue cd         "
echo "----------------------------------"
echo 
echo

# create the file RESCUECD to identify the rescue cd
touch $TMPDIR/iso/RESCUECD || fail

# create the cd, either burn it or create just the image
if [ $ISOIMAGEONLY = "yes" ]; then
    mkisofs -R -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
	-boot-load-size 4 -boot-info-table $TMPDIR/iso > \
	rescuecd.iso || fail
else
    mkisofs $Z -R -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
	-boot-load-size 4 -boot-info-table $TMPDIR/iso |  \
	cdrecord -eject $SCSIBLANK dev=$SCSIDEV speed=$SCSISPEED - || fail
fi

rm -rf $TMPDIR/iso

echo
