#!/bin/sh
################################################################################
# $Id:$
################################################################################
#  Copyright (C) 2004 The Regents of the University of California.
#  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
#  Written by Makia Minich <makia@llnl.gov>
#  UCRL-CODE-155916
#
#  This file is part of GeDI, a diskless image management tool.
#  For details, see <http://www.llnl.gov/linux/gedi/>.
#
#  GeDI 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.
#
#  GeDI is distributed in the hope that it will be useful, but WITHOUT ANY
#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
#  details.
#
#  You should have received a copy of the GNU General Public License along
#  with GeDI; if not, write to the Free Software Foundation, Inc.,
#  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
################################################################################
#
# Install a kernel for use.

# Source function library.
. /etc/gedi/variables

usage()
{
   echo "USAGE: $0 [OPTION]... <diskless image>"
   echo ""
   echo "Options:"
   echo "      -h          Print out this help statement."
}

while getopts h opt ; do
   case "$opt" in
      h) usage ; exit 0 ;;
   esac
done

shift $(($OPTIND-1))

if [ ! -z "$1" -a -d "${IMAGE}/${1}" ] ; then
   IMAGE_TYPE=$1
else
   usage
   echo "Type specified is not available."
   exit 1
fi

chroot ${IMAGE}/${IMAGE_TYPE} ${CLIENT_LIBDIR}/update_pxe_files -d
