3
3
# Install GRUB on your drive.
4
# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
4
# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
6
# This file is free software; you can redistribute it and/or modify it
7
# under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
6
# GRUB is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
# General Public License for more details.
11
# GRUB is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
17
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20
19
# Initialize some variables.
21
20
transform="@program_transform_name@"
219
# Then the partition map module.
220
partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir}`
221
if test "x$partmap_module" = x -a "x$modules" = x; then
222
echo "Auto-detection of a partition map module failed." 1>&2
223
echo "Please specify the module with the option \`--modules' explicitly." 1>&2
221
# Then the partition map module. In order to support partition-less media,
222
# this command is allowed to fail (--target=fs already grants us that the
223
# filesystem will be accessible).
224
partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null`
227
226
# _chain is often useful
228
modules="$modules $fs_module $partmap_module _chain"
227
modules="$modules $fs_module $partmap_module biosdisk _chain"
230
$grub_mkimage --output=${grubdir}/core.img $modules || exit 1
229
$grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}` $modules || exit 1
232
231
# Now perform the installation.
233
232
$grub_setup --directory=${grubdir} --device-map=${device_map} \