grub-mkrescue.in revision 2
2N/A# Make GRUB rescue image 2N/A# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. 2N/A# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A# GRUB is free software: you can redistribute it and/or modify 2N/A# it under the terms of the GNU General Public License as published by 2N/A# the Free Software Foundation, either version 3 of the License, or 2N/A# (at your option) any later version. 2N/A# GRUB is distributed in the hope that it will be useful, 2N/A# but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A# GNU General Public License for more details. 2N/A# You should have received a copy of the GNU General Public License 2N/A# Initialize some variables. 2N/AUsage: $self [OPTION] SOURCE... 2N/AMake GRUB rescue image. 2N/A -h, --help print this message and exit 2N/A -v, --version print the version information and exit 2N/A -o, --output=FILE save output in FILE [required] 2N/A --modules=MODULES pre-load specified modules MODULES 2N/A --rom-directory=DIR save rom images in DIR [optional] 2N/A --xorriso=FILE use FILE as xorriso [optional] 2N/A --grub-mkimage=FILE use FILE as grub-mkimage 2N/A$self generates a bootable rescue image with specified source files, source 2N/Adirectories, or mkisofs options listed by: xorriso -as mkisofs -help 2N/AOption -- switches to native xorriso command mode. 2N/AReport bugs to <bug-grub@gnu.org>. 2N/AMail xorriso support requests to <bug-xorriso@gnu.org>. 2N/A echo "$0: option requires an argument -- '$opt'" 1>&2 2N/A# Check the arguments. 2N/A echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" 2N/A # Intentionally undocumented 2N/A source=
"${source} ${option} $@";
break ;;
2N/Aif [
"x${output_image}" = x ] ;
then 2N/A echo "output file must be given" >&
2 2N/Aif test -f
"$1";
then 2N/A echo "$1: Not found." 1>&
2 2N/A if test -f "${input_dir}/${file}"; then 2N/A if ! test -e "${source_directory}"; then 2N/A echo "Enabling $2 support ..." 2N/A cat << EOF > ${memdisk_dir}/boot/grub/grub.cfg 2N/Asearch --fs-uuid --set=root ${iso_uuid} 2N/Aset prefix=(\${root})/boot/grub/${platform} 2N/Asource \$prefix/grub.cfg 2N/Aif [
"${override_dir}" =
"" ] ;
then 2N/A if test -e
"${multiboot_dir}" ;
then 2N/A if test -e
"${coreboot_dir}" ;
then 2N/A if test -e
"${qemu_dir}" ;
then 2N/A if test -e
"${pc_dir}" ;
then 2N/A if test -e
"${efi32_dir}" ;
then 2N/A if test -e
"${efi64_dir}" ;
then 2N/A case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in 2N/A# obtain date-based UUID 2N/Aif test -e
"${pc_dir}" ;
then 2N/A echo "Enabling BIOS support ..." 2N/A --embedded-boot ${embed_img}" 2N/Aif test -e
"${efi64_dir}" ||
test -e
"${efi32_dir}";
then 2N/A # For old macs. Suggested by Peter Jones.