# Install GRUB on your drive.
# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
# Initialize some variables.
transform="@program_transform_name@"
pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
grub_prefix=`echo /boot/grub | sed ${transform}`
# Usage: usage
# Print the usage.
cat <<EOF
Usage: $self [OPTION] install_device
Install GRUB on your drive.
-h, --help print this message and exit
-v, --version print the version information and exit
--modules=MODULES pre-load specified modules MODULES
--net-directory=DIR root directory of TFTP server
--subdir=DIR relative subdirectory on network server
--grub-mkimage=FILE use FILE as grub-mkimage
$self copies GRUB images into net_directory/subdir/target_cpu-platform
Report bugs to <bug-grub@gnu.org>.
EOF
}
opt=$1
shift
if test $# -eq 0; then
exit 1
fi
echo $1
}
# Check the arguments.
while test $# -gt 0
do
option=$1
shift
-h | --help)
exit 0 ;;
-v | --version)
echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
exit 0 ;;
--modules)
--modules=*)
--subdir)
--subdir=*)
# This is an undocumented feature...
--debug)
# Intentionally undocumented
shift
export PATH
;;
export PATH
;;
-*)
exit 1
;;
*)
if test "x$install_device" != x; then
echo "More than one install_devices?" 1>&2
exit 1
fi
install_device="${option}" ;;
esac
done
set $grub_mkimage dummy
if test -f "$1"; then
:
else
echo "$1: Not found." 1>&2
exit 1
fi
# Create the GRUB directory if it is not present.
{
input_dir="$1"
platform="$2"
grubdir="${rootdir}/${subdir}/${platform}"
fi
done
fi
done
for file in ${pkglib_DATA}; do
if test -f "${input_dir}/${file}"; then
fi
done
fi
done
if [ "x${debug_image}" != x ]; then
config_opt="-c ${grubdir}/load.cfg "
fi
ext=0 ;;
*) echo Unsupported platform ${platform};
exit 1;;
esac
cat << EOF > ${grubdir}/grub.cfg
source ${subdir}/grub.cfg
EOF
$grub_mkimage ${config_opt} -d "${input_dir}" -O ${mkimage_target} --output=${grubdir}/core.$ext --prefix=$prefix $modules $netmodules tftp || exit 1
echo "Netboot directory for ${platform} created. Configure your DHCP server to point to ${subdir}/${platform}/core.$ext"
}
if [ "${override_dir}" = "" ] ; then
if test -e "${pc_dir}" ; then
fi
if test -e "${ppc_dir}" ; then
fi
if test -e "${sparc_dir}" ; then
fi
if test -e "${i386_ieee1275_dir}" ; then
fi
if test -e "${efi32_dir}" ; then
fi
if test -e "${efi64_dir}" ; then
fi
if test -e "${itanium_dir}" ; then
fi
else
source "${override_dir}"/modinfo.sh
fi
# Bye.
exit 0