. locations.include
#check that /dev/console is not a serial console.  There is a bug that 
#causes anaconda-runtime/readmap to fail if /dev/console is serial
#If readmap fails then the installer cannot find keyboard files
#console=`consoletype </dev/console`
#if [ $console == "serial" ]; then
#   echo "There is a bug that causes anaconda-runtime/getmap to fail if"
#   echo "/dev/console is a serial device.  So exiting "
#   exit 1
#fi
#Lets customize the isolinux files.  Need to do this now so that they make
#it on the boot.iso which is built in buildinstall .
if [ -s /$TREE/sites/$SITE/build/isolinux/boot.msg ] ; then
 cp /$TREE/sites/$SITE/build/isolinux/boot.msg /$TREE/sites/$SITE/isolinux/boot.msg
fi
if [ -s /$TREE/sites/$SITE/build/isolinux/isolinux.cfg ] ; then
 cp /$TREE/sites/$SITE/build/isolinux/isolinux.cfg /$TREE/sites/$SITE/isolinux/isolinux.cfg
fi
if [ -s /$TREE/sites/$SITE/build/isolinux/splash.lss ] ; then
 cp /$TREE/sites/$SITE/build/isolinux/splash.lss /$TREE/sites/$SITE/isolinux/splash.lss
fi
#
#
if [ -d $TREE/isolinux ] ; then
  /bin/rm -r $TREE/isolinux
fi

#/usr/lib/anaconda-runtime/pkgorder $TREE/sites/$SITE/ ${ARCH} $SITERPMDIR > $TREE/build/base/pkgorder-$SITE
if [ -s ./buildinstall ] ; then
  sh -x ./buildinstall --pkgorder ../../base/pkgorder-$SITE --version $VERSION --product "Scientific Linux $VERSION ($SITE)" --release $RELEASE --prodpath sites/$SITE/$DEFAULT --discs "1,2,3,4,5,6" $TREE
else
  sh -x /usr/lib/anaconda-runtime//buildinstall --pkgorder ../../base/pkgorder-$SITE --version $VERSION --product "Scientific Linux $VERSION ($SITE)" --release $RELEASE --prodpath sites/$SITE/$DEFAULT --discs "1,2,3,4,5,6" $TREE
fi
if [ ! -d $TREE/images/$SITE ] ; then
  cd $TREE/images
  ln -s ../sites/$SITE/images $SITE 
fi

echo "Now fixing up images"
if [ ! -d /mnt/sltmp ] ; then
	mkdir /mnt/sltmp
fi

if [ $ARCH == "x86_64" ]; then

    echo "no customized boot images for $ARCH for now..."
 
else
#commented out because cannot change contents of a .iso image by just mounting
#and writing
#  mount -o loop $TREE/images/$DEFAULT/boot.iso /mnt/sltmp
  if [ $ARCH == "i386" ]; then
	echo "nothing to change now"
  fi 
fi 
