fix many bugs. see ChangeLog.

This commit is contained in:
okuji 2000-04-02 17:22:53 +00:00
parent fa8457769b
commit eb321e77f7
20 changed files with 594 additions and 407 deletions

View file

@ -1,3 +1,58 @@
2000-04-03 OKUJI Yoshinori <okuji@gnu.org>
* stage2/stage2.c (run_menu) [GRUB_UTIL]: Removed a nested
"#ifdef GRUB_UTIL" ... "#endif".
* stage2/builtins.c (unhide_func): Don't modify SAVED_DRIVE or
SAVED_PARTITION.
(hide_func): Likewise.
* stage2/disk_io.c (set_partition_hidden_flag): Use
CURRENT_DRIVE and CURRENT_PARTITION instead of SAVED_DRIVE and
SAVED_PARTITION. Check if bit 7 in CURRENT_DRIVE is non-zero
instead of if CURRENT_DRIVE is non-zero.
* grub/asmstub.c (init_device_map): Change the message
"Probe devices..." to "Probing devices...". Suggested by Neal H
Walfield.
* stage2/pc_slice.h (PC_SLICE_TYPE_HIDDEN_FLAG): Move the
definition before the PC partition type definitions.
(IS_PC_SLICE_TYPE_FAT): Clear the hidden flag in TYPE before
checking if TYPE is either of the FAT partition types. Reported
by Thomas Schweikle <tschweikle@fiducia.de>.
2000-04-02 OKUJI Yoshinori <okuji@gnu.org>
* stage2/builtins.c (setup_func): Don't read a stage 1.5 to get
the size. Use FILEMAX instead.
If embed_func fails (i.e. ERRNUM is non-zero), goto fail.
2000-04-02 OKUJI Yoshinori <okuji@gnu.org>
Suggested by Neal H Walfield <neal@walfield.org>:
* stage2/common.c (init_bios_info): Removed a nested
"#ifndef STAGE1_5" ... "#endif".
* util/grub-install.in: Quote most of the references to
shell variables by double quotation marks.
(usage): Added a description about the argument.
* stage2/builtins.c (setup_func): Change each of the messages
when running embed_func and install_func. "Run" -> "Running".
If install_func succeeds, print a message ("Done.").
From Frank Mehnert <fm3@os.inf.tu-dresden.de>:
* stage2/char_io.c (convert_to_ascii) [!STAGE1_5]: Accept 'X'
and 'b' as well. If C is 'X' or 'b', then set MULT to 16.
(grub_printf): Set a new variable MASK to 0xFFFFFFFF by default.
Mask *DATAPTR with MASK when calling convert_to_ascii.
(grub_printf) [!STAGE1_5]: Added 'b' and 'X'. If C is 'b', set
MASK to 0xFF and fall through to the case 'u'. 'X' is the same
as 'x'.
From Josip Rodin <joy@cibalia.gkvk.hr>:
* grub.texi: Several awkward English sentences are fixed.
* tutorial.texi: Likewise.
* user-ref.texi: Likewise.
* appendices.texi: Likewise.
2000-03-27 OKUJI Yoshinori <okuji@gnu.org> 2000-03-27 OKUJI Yoshinori <okuji@gnu.org>
* stage1/depcomp: New file. Automake forces to install it. This * stage1/depcomp: New file. Automake forces to install it. This

3
THANKS
View file

@ -14,6 +14,7 @@ Dan J. Walters <djw@cs.utexas.edu>
Edmund GRIMLEY EVANS <edmundo@rano.demon.co.uk> Edmund GRIMLEY EVANS <edmundo@rano.demon.co.uk>
Edward Killips <ekillips@triton.net> Edward Killips <ekillips@triton.net>
Eric Hanchrow <erich@microsoft.com> Eric Hanchrow <erich@microsoft.com>
Frank Mehnert <fm3@os.inf.tu-dresden.de>
Goran Koruga <goran.koruga@hermes.si> Goran Koruga <goran.koruga@hermes.si>
Heiko Schroeder <heiko@pool.informatik.rwth-aachen.de> Heiko Schroeder <heiko@pool.informatik.rwth-aachen.de>
Hisazumi Kenji <nel@soraneko.com> Hisazumi Kenji <nel@soraneko.com>
@ -25,6 +26,7 @@ Kunihiro Ishiguro <kunihiro@zebra.org>
Mark Lundeberg <aa026@pgfn.bc.ca> Mark Lundeberg <aa026@pgfn.bc.ca>
Michael Hohmuth <hohmuth@innocent.com> Michael Hohmuth <hohmuth@innocent.com>
Miles Bader <miles@gnu.org> Miles Bader <miles@gnu.org>
Neal H Walfield <neal@walfield.org>
OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
Pavel Roskin <pavel_roskin@geocities.com> Pavel Roskin <pavel_roskin@geocities.com>
Per Lundberg <plundis@byggdok.se> Per Lundberg <plundis@byggdok.se>
@ -32,4 +34,5 @@ Peter Astrand <altic@lysator.liu.se>
Ramon van Handel <vhandel@chem.vu.nl> Ramon van Handel <vhandel@chem.vu.nl>
Stephen Early <steve@greenend.org.uk> Stephen Early <steve@greenend.org.uk>
Takehiro Suzuki <takehiro@coral.ocn.ne.jp> Takehiro Suzuki <takehiro@coral.ocn.ne.jp>
Thomas Schweikle <tschweikle@fiducia.de>
VaX#n8 <vax@linkdead.paranoia.com> VaX#n8 <vax@linkdead.paranoia.com>

175
configure vendored
View file

@ -897,7 +897,7 @@ fi
PACKAGE=grub PACKAGE=grub
VERSION=0.5.94 VERSION=0.5.95
if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" && if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then test -f $srcdir/config.status; then
@ -930,31 +930,8 @@ if test -z "$install_sh"; then
install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`" install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
fi fi
ac_aux_dir=
for ac_dir in . $srcdir/.; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f $ac_dir/install.sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
elif test -f $ac_dir/shtool; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
{ echo "configure: error: cannot find install-sh or install.sh in . $srcdir/." 1>&2; exit 1; }
fi
ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
echo $ECHO_N "checking host system type... $ECHO_C" 1>&6 echo $ECHO_N "checking host system type... $ECHO_C" 1>&6
echo "configure:958: checking host system type" 1>&5 echo "configure:935: checking host system type" 1>&5
if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
# Make sure we can run config.sub. # Make sure we can run config.sub.
@ -999,7 +976,7 @@ esac
# #
echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" 1>&6 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" 1>&6
echo "configure:1003: checking whether to enable maintainer-specific portions of Makefiles" 1>&5 echo "configure:980: checking whether to enable maintainer-specific portions of Makefiles" 1>&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode" enableval="$enable_maintainer_mode"
@ -1022,7 +999,7 @@ if test "x$enable_maintainer_mode" = xyes; then
# Extract the first word of "perl", so it can be a program name with args. # Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2 set dummy perl; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1026: checking for $ac_word" 1>&5 echo "configure:1003: checking for $ac_word" 1>&5
if test "${ac_cv_path_PERL+set}" = set; then if test "${ac_cv_path_PERL+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1066,7 +1043,7 @@ fi
# #
echo $ECHO_N "checking build system type... $ECHO_C" 1>&6 echo $ECHO_N "checking build system type... $ECHO_C" 1>&6
echo "configure:1070: checking build system type" 1>&5 echo "configure:1047: checking build system type" 1>&5
if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
# Make sure we can run config.sub. # Make sure we can run config.sub.
@ -1109,7 +1086,7 @@ fi
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2 set dummy ${ac_tool_prefix}gcc; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1113: checking for $ac_word" 1>&5 echo "configure:1090: checking for $ac_word" 1>&5
if test "${ac_cv_prog_CC+set}" = set; then if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1147,7 +1124,7 @@ esac
# Extract the first word of "gcc", so it can be a program name with args. # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2 set dummy gcc; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1151: checking for $ac_word" 1>&5 echo "configure:1128: checking for $ac_word" 1>&5
if test "${ac_cv_prog_CC+set}" = set; then if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1180,7 +1157,7 @@ fi
# Extract the first word of "cc", so it can be a program name with args. # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2 set dummy cc; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1184: checking for $ac_word" 1>&5 echo "configure:1161: checking for $ac_word" 1>&5
if test "${ac_cv_prog_CC+set}" = set; then if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1234,7 +1211,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2 set dummy $ac_prog; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1238: checking for $ac_word" 1>&5 echo "configure:1215: checking for $ac_word" 1>&5
if test "${ac_cv_prog_CC+set}" = set; then if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1272,7 +1249,7 @@ done
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works... $ECHO_C" 1>&6 echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works... $ECHO_C" 1>&6
echo "configure:1276: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" 1>&5 echo "configure:1253: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" 1>&5
ac_ext=c ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@ -1283,12 +1260,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 1287 "configure" #line 1264 "configure"
#include "confdefs.h" #include "confdefs.h"
int main(){return(0);} int main(){return(0);}
EOF EOF
if { (eval echo configure:1292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler. # If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then if (./conftest; exit) 2>/dev/null; then
@ -1314,12 +1291,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 77; } { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 77; }
fi fi
echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler... $ECHO_C" 1>&6 echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler... $ECHO_C" 1>&6
echo "configure:1318: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" 1>&5 echo "configure:1295: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" 1>&5
echo "$ECHO_T""$ac_cv_prog_cc_cross" 1>&6 echo "$ECHO_T""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross cross_compiling=$ac_cv_prog_cc_cross
echo $ECHO_N "checking whether we are using GNU C... $ECHO_C" 1>&6 echo $ECHO_N "checking whether we are using GNU C... $ECHO_C" 1>&6
echo "configure:1323: checking whether we are using GNU C" 1>&5 echo "configure:1300: checking whether we are using GNU C" 1>&5
if test "${ac_cv_prog_gcc+set}" = set; then if test "${ac_cv_prog_gcc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1328,7 +1305,7 @@ else
yes; yes;
#endif #endif
EOF EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes ac_cv_prog_gcc=yes
else else
ac_cv_prog_gcc=no ac_cv_prog_gcc=no
@ -1346,7 +1323,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS" ac_save_CFLAGS="$CFLAGS"
CFLAGS= CFLAGS=
echo $ECHO_N "checking whether ${CC-cc} accepts -g... $ECHO_C" 1>&6 echo $ECHO_N "checking whether ${CC-cc} accepts -g... $ECHO_C" 1>&6
echo "configure:1350: checking whether ${CC-cc} accepts -g" 1>&5 echo "configure:1327: checking whether ${CC-cc} accepts -g" 1>&5
if test "${ac_cv_prog_cc_g+set}" = set; then if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1377,7 +1354,7 @@ else
fi fi
echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" 1>&6 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" 1>&6
echo "configure:1381: checking how to run the C preprocessor" 1>&5 echo "configure:1358: checking how to run the C preprocessor" 1>&5
# On Suns, sometimes $CPP names a directory. # On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then if test -n "$CPP" && test -d "$CPP"; then
CPP= CPP=
@ -1393,13 +1370,13 @@ else
# not just through cpp. # not just through cpp.
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 1397 "configure" #line 1374 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:1380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -1411,13 +1388,13 @@ else
CPP="${CC-cc} -E -traditional-cpp" CPP="${CC-cc} -E -traditional-cpp"
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 1415 "configure" #line 1392 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:1398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -1429,13 +1406,13 @@ else
CPP="${CC-cc} -nologo -E" CPP="${CC-cc} -nologo -E"
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 1433 "configure" #line 1410 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:1416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -1462,7 +1439,7 @@ echo "$ECHO_T""$CPP" 1>&6
depcc="$CC" depcc="$CC"
depcpp="$CPP" depcpp="$CPP"
echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" 1>&6 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" 1>&6
echo "configure:1466: checking dependency style of $depcc" 1>&5 echo "configure:1443: checking dependency style of $depcc" 1>&5
if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1516,7 +1493,7 @@ if test "x$with_binutils" != x; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1520: checking for $ac_word" 1>&5 echo "configure:1497: checking for $ac_word" 1>&5
if test "${ac_cv_path_RANLIB+set}" = set; then if test "${ac_cv_path_RANLIB+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1551,7 +1528,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
# Extract the first word of "ranlib", so it can be a program name with args. # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2 set dummy ranlib; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1555: checking for $ac_word" 1>&5 echo "configure:1532: checking for $ac_word" 1>&5
if test "${ac_cv_path_RANLIB+set}" = set; then if test "${ac_cv_path_RANLIB+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1590,7 +1567,7 @@ else
# Extract the first word of "ranlib", so it can be a program name with args. # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2 set dummy ranlib; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1594: checking for $ac_word" 1>&5 echo "configure:1571: checking for $ac_word" 1>&5
if test "${ac_cv_prog_RANLIB+set}" = set; then if test "${ac_cv_prog_RANLIB+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1633,7 +1610,7 @@ if test "x$ac_cv_prog_gcc" = xyes; then
STAGE1_CFLAGS="-O2" STAGE1_CFLAGS="-O2"
GRUB_CFLAGS="-O2" GRUB_CFLAGS="-O2"
echo $ECHO_N "checking whether optimization for size works... $ECHO_C" 1>&6 echo $ECHO_N "checking whether optimization for size works... $ECHO_C" 1>&6
echo "configure:1637: checking whether optimization for size works" 1>&5 echo "configure:1614: checking whether optimization for size works" 1>&5
if test "${size_flag+set}" = set; then if test "${size_flag+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1641,7 +1618,7 @@ else
saved_CFLAGS=$CFLAGS saved_CFLAGS=$CFLAGS
CFLAGS="-Os -g" CFLAGS="-Os -g"
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 1645 "configure" #line 1622 "configure"
#include "confdefs.h" #include "confdefs.h"
int int
@ -1652,7 +1629,7 @@ main ()
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:1656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
size_flag=yes size_flag=yes
else else
@ -1682,7 +1659,7 @@ if test "x$with_binutils" != x; then
# Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
set dummy ${ac_tool_prefix}objcopy; ac_word=$2 set dummy ${ac_tool_prefix}objcopy; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1686: checking for $ac_word" 1>&5 echo "configure:1663: checking for $ac_word" 1>&5
if test "${ac_cv_path_OBJCOPY+set}" = set; then if test "${ac_cv_path_OBJCOPY+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1717,7 +1694,7 @@ else
# Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
set dummy ${ac_tool_prefix}objcopy; ac_word=$2 set dummy ${ac_tool_prefix}objcopy; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
echo "configure:1721: checking for $ac_word" 1>&5 echo "configure:1698: checking for $ac_word" 1>&5
if test "${ac_cv_prog_OBJCOPY+set}" = set; then if test "${ac_cv_prog_OBJCOPY+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1752,7 +1729,7 @@ fi
# Defined in acinclude.m4. # Defined in acinclude.m4.
echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" 1>&6 echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" 1>&6
echo "configure:1756: checking if C symbols get an underscore after compilation" 1>&5 echo "configure:1733: checking if C symbols get an underscore after compilation" 1>&5
if test "${grub_cv_asm_uscore+set}" = set; then if test "${grub_cv_asm_uscore+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1765,7 +1742,7 @@ func (int *list)
} }
EOF EOF
if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'; { (eval echo configure:1769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.s; then if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'; { (eval echo configure:1746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.s; then
true true
else else
{ echo "configure: error: ${CC-cc} failed to produce assembly code" 1>&2; exit 1; } { echo "configure: error: ${CC-cc} failed to produce assembly code" 1>&2; exit 1; }
@ -1790,7 +1767,7 @@ fi
echo "$ECHO_T""$grub_cv_asm_uscore" 1>&6 echo "$ECHO_T""$grub_cv_asm_uscore" 1>&6
echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" 1>&6 echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" 1>&6
echo "configure:1794: checking whether ${OBJCOPY} works for absolute addresses" 1>&5 echo "configure:1771: checking whether ${OBJCOPY} works for absolute addresses" 1>&5
if test "${grub_cv_prog_objcopy_absolute+set}" = set; then if test "${grub_cv_prog_objcopy_absolute+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1802,21 +1779,21 @@ cmain (void)
} }
EOF EOF
if { (eval echo configure:1806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then : if { (eval echo configure:1783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then :
else else
{ echo "configure: error: ${CC-cc} cannot compile C source code" 1>&2; exit 1; } { echo "configure: error: ${CC-cc} cannot compile C source code" 1>&2; exit 1; }
fi fi
grub_cv_prog_objcopy_absolute=yes grub_cv_prog_objcopy_absolute=yes
for link_addr in 2000 8000 7C00; do for link_addr in 2000 8000 7C00; do
if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'; { (eval echo configure:1812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'; { (eval echo configure:1789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then :
else else
{ echo "configure: error: ${CC-cc} cannot link at address $link_addr" 1>&2; exit 1; } { echo "configure: error: ${CC-cc} cannot link at address $link_addr" 1>&2; exit 1; }
fi fi
if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'; { (eval echo configure:1816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'; { (eval echo configure:1793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then :
else else
{ echo "configure: error: ${OBJCOPY-objcopy} cannot create binary files" 1>&2; exit 1; } { echo "configure: error: ${OBJCOPY-objcopy} cannot create binary files" 1>&2; exit 1; }
fi fi
if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'; { (eval echo configure:1820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'; { (eval echo configure:1797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
mv -f conftest conftest.old mv -f conftest conftest.old
else else
grub_cv_prog_objcopy_absolute=no grub_cv_prog_objcopy_absolute=no
@ -1832,7 +1809,7 @@ if test "x$grub_cv_prog_objcopy_absolute" != xyes; then
fi fi
echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" 1>&6 echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" 1>&6
echo "configure:1836: checking whether addr32 must be in the same line as the instruction" 1>&5 echo "configure:1813: checking whether addr32 must be in the same line as the instruction" 1>&5
if test "${grub_cv_asm_prefix_requirement+set}" = set; then if test "${grub_cv_asm_prefix_requirement+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1841,7 +1818,7 @@ else
l1: addr32 movb %al, l1 l1: addr32 movb %al, l1
EOF EOF
if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then
grub_cv_asm_prefix_requirement=yes grub_cv_asm_prefix_requirement=yes
else else
grub_cv_asm_prefix_requirement=no grub_cv_asm_prefix_requirement=no
@ -1869,7 +1846,7 @@ EOF
echo "$ECHO_T""$grub_cv_asm_prefix_requirement" 1>&6 echo "$ECHO_T""$grub_cv_asm_prefix_requirement" 1>&6
echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" 1>&6 echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" 1>&6
echo "configure:1873: checking for .code16 addr32 assembler support" 1>&5 echo "configure:1850: checking for .code16 addr32 assembler support" 1>&5
if test "${grub_cv_asm_addr32+set}" = set; then if test "${grub_cv_asm_addr32+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
@ -1884,7 +1861,7 @@ else
sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s
fi fi
if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then
grub_cv_asm_addr32=yes grub_cv_asm_addr32=yes
else else
grub_cv_asm_addr32=no grub_cv_asm_addr32=no
@ -1899,12 +1876,12 @@ if test "x$grub_cv_asm_addr32" != xyes; then
fi fi
echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" 1>&6 echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" 1>&6
echo "configure:1903: checking if start is defined by the compiler" 1>&5 echo "configure:1880: checking if start is defined by the compiler" 1>&5
if test "${grub_cv_check_start_symbol+set}" = set; then if test "${grub_cv_check_start_symbol+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 1908 "configure" #line 1885 "configure"
#include "confdefs.h" #include "confdefs.h"
int int
@ -1915,7 +1892,7 @@ asm ("incl start")
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:1919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
grub_cv_check_start_symbol=yes grub_cv_check_start_symbol=yes
else else
@ -1938,12 +1915,12 @@ fi
echo "$ECHO_T""$grub_cv_check_start_symbol" 1>&6 echo "$ECHO_T""$grub_cv_check_start_symbol" 1>&6
echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" 1>&6 echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" 1>&6
echo "configure:1942: checking if _start is defined by the compiler" 1>&5 echo "configure:1919: checking if _start is defined by the compiler" 1>&5
if test "${grub_cv_check_uscore_start_symbol+set}" = set; then if test "${grub_cv_check_uscore_start_symbol+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 1947 "configure" #line 1924 "configure"
#include "confdefs.h" #include "confdefs.h"
int int
@ -1954,7 +1931,7 @@ asm ("incl _start")
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
grub_cv_check_uscore_start_symbol=yes grub_cv_check_uscore_start_symbol=yes
else else
@ -1982,12 +1959,12 @@ if test "x$grub_cv_check_start_symbol" != "xyes" \
fi fi
echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" 1>&6 echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" 1>&6
echo "configure:1986: checking if __bss_start is defined by the compiler" 1>&5 echo "configure:1963: checking if __bss_start is defined by the compiler" 1>&5
if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 1991 "configure" #line 1968 "configure"
#include "confdefs.h" #include "confdefs.h"
int int
@ -1998,7 +1975,7 @@ asm ("incl __bss_start")
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:2002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
grub_cv_check_uscore_uscore_bss_start_symbol=yes grub_cv_check_uscore_uscore_bss_start_symbol=yes
else else
@ -2021,12 +1998,12 @@ fi
echo "$ECHO_T""$grub_cv_check_uscore_uscore_bss_start_symbol" 1>&6 echo "$ECHO_T""$grub_cv_check_uscore_uscore_bss_start_symbol" 1>&6
echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" 1>&6 echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" 1>&6
echo "configure:2025: checking if _edata is defined by the compiler" 1>&5 echo "configure:2002: checking if _edata is defined by the compiler" 1>&5
if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 2030 "configure" #line 2007 "configure"
#include "confdefs.h" #include "confdefs.h"
int int
@ -2037,7 +2014,7 @@ asm ("incl _edata")
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:2041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
grub_cv_check_uscore_edata_symbol=yes grub_cv_check_uscore_edata_symbol=yes
else else
@ -2060,12 +2037,12 @@ fi
echo "$ECHO_T""$grub_cv_check_uscore_edata_symbol" 1>&6 echo "$ECHO_T""$grub_cv_check_uscore_edata_symbol" 1>&6
echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" 1>&6 echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" 1>&6
echo "configure:2064: checking if edata is defined by the compiler" 1>&5 echo "configure:2041: checking if edata is defined by the compiler" 1>&5
if test "${grub_cv_check_edata_symbol+set}" = set; then if test "${grub_cv_check_edata_symbol+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 2069 "configure" #line 2046 "configure"
#include "confdefs.h" #include "confdefs.h"
int int
@ -2076,7 +2053,7 @@ asm ("incl edata")
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:2080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
grub_cv_check_edata_symbol=yes grub_cv_check_edata_symbol=yes
else else
@ -2105,12 +2082,12 @@ if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" != "xyes" \
fi fi
echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" 1>&6 echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" 1>&6
echo "configure:2109: checking if end is defined by the compiler" 1>&5 echo "configure:2086: checking if end is defined by the compiler" 1>&5
if test "${grub_cv_check_end_symbol+set}" = set; then if test "${grub_cv_check_end_symbol+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 2114 "configure" #line 2091 "configure"
#include "confdefs.h" #include "confdefs.h"
int int
@ -2121,7 +2098,7 @@ asm ("incl end")
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:2125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
grub_cv_check_end_symbol=yes grub_cv_check_end_symbol=yes
else else
@ -2144,12 +2121,12 @@ fi
echo "$ECHO_T""$grub_cv_check_end_symbol" 1>&6 echo "$ECHO_T""$grub_cv_check_end_symbol" 1>&6
echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" 1>&6 echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" 1>&6
echo "configure:2148: checking if _end is defined by the compiler" 1>&5 echo "configure:2125: checking if _end is defined by the compiler" 1>&5
if test "${grub_cv_check_uscore_end_symbol+set}" = set; then if test "${grub_cv_check_uscore_end_symbol+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 2153 "configure" #line 2130 "configure"
#include "confdefs.h" #include "confdefs.h"
int int
@ -2160,7 +2137,7 @@ asm ("incl _end")
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:2164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
grub_cv_check_uscore_end_symbol=yes grub_cv_check_uscore_end_symbol=yes
else else
@ -2197,14 +2174,14 @@ fi
# Get the filename or the whole disk and open it. # Get the filename or the whole disk and open it.
# Known to work on NetBSD. # Known to work on NetBSD.
echo $ECHO_N "checking for opendisk in -lutil... $ECHO_C" 1>&6 echo $ECHO_N "checking for opendisk in -lutil... $ECHO_C" 1>&6
echo "configure:2201: checking for opendisk in -lutil" 1>&5 echo "configure:2178: checking for opendisk in -lutil" 1>&5
if test "${ac_cv_lib_util_opendisk+set}" = set; then if test "${ac_cv_lib_util_opendisk+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lutil $LIBS" LIBS="-lutil $LIBS"
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 2208 "configure" #line 2185 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -2219,7 +2196,7 @@ opendisk()
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:2223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
ac_cv_lib_util_opendisk=yes ac_cv_lib_util_opendisk=yes
else else
@ -2244,14 +2221,14 @@ fi
# Unless the user specify --without-curses, check for curses. # Unless the user specify --without-curses, check for curses.
if test "x$with_curses" != "xno"; then if test "x$with_curses" != "xno"; then
echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" 1>&6 echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" 1>&6
echo "configure:2248: checking for wgetch in -lncurses" 1>&5 echo "configure:2225: checking for wgetch in -lncurses" 1>&5
if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS" LIBS="-lncurses $LIBS"
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 2255 "configure" #line 2232 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -2266,7 +2243,7 @@ wgetch()
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:2270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
ac_cv_lib_ncurses_wgetch=yes ac_cv_lib_ncurses_wgetch=yes
else else
@ -2288,14 +2265,14 @@ EOF
else else
echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" 1>&6 echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" 1>&6
echo "configure:2292: checking for wgetch in -lcurses" 1>&5 echo "configure:2269: checking for wgetch in -lcurses" 1>&5
if test "${ac_cv_lib_curses_wgetch+set}" = set; then if test "${ac_cv_lib_curses_wgetch+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS" LIBS="-lcurses $LIBS"
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 2299 "configure" #line 2276 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -2310,7 +2287,7 @@ wgetch()
return 0; return 0;
} }
EOF EOF
if { (eval echo configure:2314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
ac_cv_lib_curses_wgetch=yes ac_cv_lib_curses_wgetch=yes
else else
@ -2341,19 +2318,19 @@ for ac_header in string.h strings.h ncurses/curses.h ncurses.h curses.h
do do
ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh` ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
echo $ECHO_N "checking for $ac_header... $ECHO_C" 1>&6 echo $ECHO_N "checking for $ac_header... $ECHO_C" 1>&6
echo "configure:2345: checking for $ac_header" 1>&5 echo "configure:2322: checking for $ac_header" 1>&5
if eval "test \"\${$ac_ac_Header+set}\" = set"; then if eval "test \"\${$ac_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6 echo $ECHO_N "(cached) $ECHO_C" 1>&6
else else
cat >conftest.$ac_ext <<EOF cat >conftest.$ac_ext <<EOF
#line 2351 "configure" #line 2328 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_header> #include <$ac_header>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*

View file

@ -25,9 +25,8 @@ configurable in BIOS setting utility. Read the manual for your BIOS
for more information. for more information.
Furthermore, some operating systems (i.e. DOS) cannot access any large Furthermore, some operating systems (i.e. DOS) cannot access any large
disk, so the problem is not solved by any kind of boot loader. As long disk, so the problem is not solved by any kind of boot loader. GNU/Hurd
as I know, at least GNU/Hurd and GNU/Linux can boot from such a large and GNU/Linux can surely boot from such a large disk.
disk.
@item Can I put Stage2 into a partition which is over 1024 cylinders? @item Can I put Stage2 into a partition which is over 1024 cylinders?
@ -132,9 +131,9 @@ developers haven't seen it by their own eyes. This is why it is
desirable that you investigate the cause seriously if you have the desirable that you investigate the cause seriously if you have the
skill. skill.
@item Why doesn't Linux (FreeBSD, NetBSD, etc.) become Multiboot-compliant? @item Why don't Linux, FreeBSD, NetBSD, etc. become Multiboot-compliant?
Please ask the maintainers. If all free kernels were Please ask the relevant maintainers. If all free kernels were
Multiboot-compliant (@pxref{Top, Multiboot Specification, Motivation, Multiboot-compliant (@pxref{Top, Multiboot Specification, Motivation,
multiboot, The Multiboot Specification}), the world would be an multiboot, The Multiboot Specification}), the world would be an
utopia@dots{} utopia@dots{}

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020.
.TH GRUB-INSTALL "8" "February 2000" "grub-install (GNU GRUB 0.5.94)" FSF .TH GRUB-INSTALL "8" "April 2000" "grub-install (GNU GRUB 0.5.95)" FSF
.SH NAME .SH NAME
grub-install \- install GRUB on your drive grub-install \- install GRUB on your drive
.SH SYNOPSIS .SH SYNOPSIS
@ -21,6 +21,8 @@ instead of the root directory.
\fB\-\-grub\-shell\fR=\fIFILE\fR \fB\-\-grub\-shell\fR=\fIFILE\fR
use FILE as the grub shell. use FILE as the grub shell.
.PP .PP
INSTALL_DEVICE can be a GRUB device name or a system device filename.
.PP
Reports bugs to <bug-grub@gnu.org>. Reports bugs to <bug-grub@gnu.org>.
.SH "SEE ALSO" .SH "SEE ALSO"
The full documentation for The full documentation for

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020.
.TH GRUB "8" "February 2000" "GNU GRUB 0.5.94" FSF .TH GRUB "8" "April 2000" "GNU GRUB 0.5.95" FSF
.SH NAME .SH NAME
GRUB \- the grub shell GRUB \- the grub shell
.SH SYNOPSIS .SH SYNOPSIS

View file

@ -14,6 +14,10 @@
@syncodeindex pg cp @syncodeindex pg cp
@syncodeindex tp cp @syncodeindex tp cp
@footnotestyle separate
@paragraphindent 3
@finalout
@dircategory Kernel @dircategory Kernel
@direntry @direntry
* GRUB: (grub). The GRand Unified Bootloader * GRUB: (grub). The GRand Unified Bootloader
@ -51,12 +55,12 @@ into another language, under the above conditions for modified versions.
@titlepage @titlepage
@sp 10 @sp 10
@title The GRUB Manual @title The GRUB Manual
@subtitle The GRand Unified Bootloader, version @value{VERSION}, @value{UPDATED}.
@author Gordon Matzigkeit @author Gordon Matzigkeit
@author OKUJI Yoshinori @author OKUJI Yoshinori
@c The following two commands start the copyright page. @c The following two commands start the copyright page.
@page @page
@vskip 0pt plus 1filll @vskip 0pt plus 1filll
@vskip 0pt plus 1filll
Copyright @copyright{} 1996 Erich Boleyn Copyright @copyright{} 1996 Erich Boleyn
Copyright @copyright{} 1999, 2000 Free Software Foundation, Inc. Copyright @copyright{} 1999, 2000 Free Software Foundation, Inc.
@ -81,26 +85,28 @@ by Free Software Foundation.
@node Top @node Top
@top GRUB @top GRUB
This file documents GNU GRUB, the Grand Unified Bootloader. This This is the documentation of GNU GRUB, the GRand Unified Bootloader,
edition documents version @value{VERSION}. a flexible and powerful boot loader program for @sc{pc}s.
This edition documents version @value{VERSION}.
@end ifnottex @end ifnottex
@menu @menu
Part I: The Tutorial Manual Part I: The Tutorial Manual
* Overview:: Starting to use GRUB * Overview:: What exactly GRUB is and how to use it
* Filename:: How to write filenames * Naming convention:: Names of your drives in GRUB
* Installation:: How to install GRUB on your drive * Installation:: Installing GRUB on your drive
* Boot:: How to boot your operating systems * Booting:: How to boot different operating systems
* Network:: Downloading OS images from a network * Network:: Downloading OS images from a network
* Configuration:: Writing your configuration file * Configuration:: Writing your own configuration file
Part II: The User Reference Manual Part II: The User Reference Manual
* Introduction:: Capturing the spirit of GRUB * Introduction:: Capturing the spirit of GRUB
* Filesystem:: Filesystem syntax and semantics * Filesystem:: Filesystem syntax and semantics
* Interface:: The menu and the command-line * Interface:: The menu and the command-line
* Command:: The list of available builtin commands * Commands:: The list of available builtin commands
* Troubleshooting:: Error messages produced by GRUB * Troubleshooting:: Error messages produced by GRUB
* Invoking the grub shell:: How to use the grub shell * Invoking the grub shell:: How to use the grub shell
* Invoking grub-install:: How to use the GRUB installer * Invoking grub-install:: How to use the GRUB installer

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020.
.TH MBCHK "1" "February 2000" "mbchk (GNU GRUB 0.5.94)" FSF .TH MBCHK "1" "April 2000" "mbchk (GNU GRUB 0.5.95)" FSF
.SH NAME .SH NAME
mbchk \- check the format of a Multiboot kernel mbchk \- check the format of a Multiboot kernel
.SH SYNOPSIS .SH SYNOPSIS

View file

@ -1,3 +1,3 @@
@set UPDATED 30 December 1999 @set UPDATED 2 April 2000
@set EDITION 0.5.94 @set EDITION 0.5.95
@set VERSION 0.5.94 @set VERSION 0.5.95

View file

@ -5,28 +5,32 @@ Briefly, a @dfn{boot loader} is the first software program that runs when
a computer starts. It is responsible for loading and transferring a computer starts. It is responsible for loading and transferring
control to the operating system @dfn{kernel} software (such as the Linux control to the operating system @dfn{kernel} software (such as the Linux
or GNU Hurd kernel). The kernel, in turn, initializes the rest of the or GNU Hurd kernel). The kernel, in turn, initializes the rest of the
operating system (usually GNU). operating system (e.g. a GNU system).
GRUB can load a wide variety of free operating systems as well as GRUB can load a wide variety of free operating systems, as well as
chain-loading@footnote{@dfn{chain-load} is the mechanism for loading chain-loading@footnote{@dfn{chain-load} is the mechanism for loading
unsupported operating systems by loading another boot loader.} unsupported operating systems by loading another boot loader. It is
proprietary operating systems. The important feature in GRUB typically used for loading DOS or Windows} proprietary operating
is flexibility; GRUB can understand filesystems and kernel executable systems.
formats, so you can load an arbitrary operating system as you like
without recording the position of your kernel on the disk.
Therefore, you have to specify the drive/partition where your kernel The important feature in GRUB is flexibility; GRUB understands
resides and the filename at hand. If you don't want to type the filesystems and kernel executable formats, so you can load an arbitrary
drive and the filename every time, the menu interface (@pxref{Menu}) operating system the way you like, without recording the physical
will help you. GRUB loads a configuration file (@pxref{Configuration}) position of your kernel on the disk.
if found and provides the menu so that you can select which OS is booted
at ease. Of course, you can enter the command-line interface
(@pxref{Command line}) whenever you like.
In the following chapters, we teach you how to specify a Therefore, you have to specify the drive (and the partition) where your
drive/partition and a filename (@pxref{Filename}), how to install GRUB kernel resides and the filename at hand. If you don't want to type in
on your drive (@pxref{Installation}), and how to boot your OSes the drive and the filename every time, you can set it up in a simple
(@pxref{Boot}), step by step. configuration file (@pxref{Configuration}). GRUB will locate and load
it, and provide a nice menu interface (@pxref{Menu interface}) through
which you can easily select which OS it boots. Of course, you can enter
the command-line interface (@pxref{Command line}) whenever you like, or
you can edit specific menu entries prior to using them.
In the following chapters, you will learn how to specify a drive or a
partition, and a file name (@pxref{Naming convention}) to GRUB, how to
install GRUB on your drive (@pxref{Installation}), and how to boot your
OSes (@pxref{Booting}), step by step.
@c @node Fundamentals @c @node Fundamentals
@ -36,32 +40,37 @@ on your drive (@pxref{Installation}), and how to boot your OSes
@c copyright problem will be solved. @c copyright problem will be solved.
@node Filename @node Naming convention
@chapter Filename @chapter Naming convention
Now is the time when you should learn the device syntax used in GRUB, so The device syntax used in GRUB is a wee bit different from what you may
that you can specify a drive/partition. See this example: have seen before in your operating system(s), and you need to know it so
that you can specify a drive/partition.
Look at the following examples and explanations:
@example @example
(fd0) (fd0)
@end example @end example
This means the first floppy disk drive. GRUB requires that the device First of all, GRUB requires that the device name is enclosed with
name is enclosed with @samp{(} and @samp{)}. The number @samp{0} is the @samp{(} and @samp{)}. The @samp{fd} part means that it is a floppy
drive number, which is counted from @emph{zero}. In this case, GRUB uses disk. The number @samp{0} is the drive number, which is counted from
the whole floppy disk. @emph{zero}. This expression means that GRUB will use the whole floppy
disk.
@example @example
(hd0,1) (hd0,1)
@end example @end example
This means the second partition of the first hard disk drive. The first Here, @samp{hd} means it is a hard disk drive. The first integer
integer @samp{0} indicates the drive number, that is, the first hard @samp{0} indicates the drive number, that is, the first hard disk, while
disk, while the second integer @samp{1} indicates the partition number the second integer, @samp{1}, indicates the partition number (or the
(or the @sc{pc} slice number in the BSD terminology). Note that the @sc{pc} slice number in the BSD terminology). Once again, please note
partition numbers are counted from @emph{zero} but not from one. In this that the partition numbers are counted from @emph{zero}, not from
case, GRUB uses the partition of the disk instead of the whole one. This expression means the second partition of the first hard disk
disk. drive. In this case, GRUB uses one partition of the disk, instead of the
whole disk.
@example @example
(hd0,4) (hd0,4)
@ -69,62 +78,70 @@ disk.
This specifies the first @dfn{extended partition} of the first hard disk This specifies the first @dfn{extended partition} of the first hard disk
drive. Note that the partition numbers for extended partitions are drive. Note that the partition numbers for extended partitions are
counted from @samp{4}, whether your disks has four primary partitions or counted from @samp{4}, regardless of the actual number of primary
less. partitions on your hard disk.
@example @example
(hd1,a) (hd1,a)
@end example @end example
This means the BSD @samp{a} partition of the second hard disk. If you This means the BSD @samp{a} partition of the second hard disk. If you
need to specify which @sc{pc} slice number should be used, use a device need to specify which @sc{pc} slice number should be used, use something
like @samp{(hd1,0,a)}. If the @sc{pc} slice number is omitted, GRUB like this: @samp{(hd1,0,a)}. If the @sc{pc} slice number is omitted,
searches for the first @sc{pc} slice which has a BSD @samp{a} partition. GRUB searches for the first @sc{pc} slice which has a BSD @samp{a}
partition.
Note that GRUB does @emph{not} distinguish IDE from SCSI; just count the Of course, to actually access the disks or partitions with GRUB, you
drive numbers from zero. Normally, any IDE drive number is less than any need to use the device specification in a command, like @samp{root
SCSI drive number, but this is not true if you exchange the boot (fd0)} or @samp{unhide (hd0,2)}. To help you find out which number is a
sequence between IDE and SCSI in your BIOS. But do not worry. In the partition you want, the GRUB command-line (@pxref{Command line}) options
GRUB command-line (@pxref{Command line}), you can always use the have argument completion. That means that, for example, you only need to
@key{TAB} completion which displays the list of drives, the list of the type @samp{root (}, followed by a @key{TAB}, and GRUB will display the
partitions of a drive, or the list of the filenames on a partition, list of drives, partitions, or filenames, so it should be quite easy to
depending on where you push the @key{TAB} key in the command-line. So it determine the name of your target partition, even with minimal knowledge
should be possible to determine which drive and which partition are what of the syntax.
you seek for.
Now the question is how to specify a file. Again, see this example: Note that GRUB does @emph{not} distinguish IDE from SCSI - it simply
counts the drive numbers from zero, regardless of their type. Normally,
any IDE drive number is less than any SCSI drive number, although that
is not true if you change the boot sequence by swapping IDE and SCSI
drives in your BIOS.
Now the question is, how to specify a file? Again, see this example:
@example @example
(hd0,0)/vmlinuz (hd0,0)/vmlinuz
@end example @end example
This specifies the file whose name is @samp{vmlinuz} on the first This specifies the file named @samp{vmlinuz}, found on the first
partition of the first hard disk drive. Isn't that easy? All you should partition of the first hard disk drive. Note that the argument
do is type the absolute filename. If you are tired of typing the completion works with file names, too.
whole filename, press the @key{TAB} key. @kbd{@key{TAB}}
completes the filename if it is unique. Otherwise, it displays the list
of the candidates.
OK, the next chapter introduces how to install GRUB on your drive. That was easy, admit it. Do read the next chapter, to find out how to
actually install GRUB on your drive.
@node Installation @node Installation
@chapter Installation @chapter Installation
At first, install GRUB by @code{make install} (@pxref{Obtaining and First, you need to have GRUB itself properly installed on your system,
Building GRUB}) or by the GRUB package for your OS. If this is done, (@pxref{Obtaining and Building GRUB}) either from the source tarball, or
let's install GRUB on your drive. There are two ways to install GRUB: as a package for your OS.
using the grub shell (@pxref{Invoking the grub shell}) on a UNIX-like OS
and using the native Stage 2. The two ways are almost the same, but the
main difference is that the grub shell might probe a wrong BIOS drive on
a UNIX-like OS. If you install GRUB on a UNIX-like OS, make sure that
you have a boot floppy disk so that you can rescue your computer when it
crashes.
Anyhow, copy your GRUB images (@file{stage1}, @file{stage2}, and To use GRUB, you need to install it on your drive. There are two ways of
@file{*stage1_5}) to the directory @file{/boot/grub} before staring to doing that - either using the grub shell (@pxref{Invoking the grub
install GRUB. Normally, the images are installed under the directory shell}) on a UNIX-like OS, or by using the native Stage 2. These are
@file{/usr/share/grub/i386-pc}. quite similar, however, the shell might probe a wrong BIOS drive, so
better be careful.
Also, if you install GRUB on a UNIX-like OS, please make sure that you
have an emergency boot disk ready, so that you can rescue your computer
if, by any chance, your hard drive becomes unusable (unbootable).
GRUB comes with boot images, which are normally installed in the
@file{/usr/share/grub/i386-pc} directory. You need to copy the files
@file{stage1}, @file{stage2}, and @file{*stage1_5} to the directory
@file{/boot/grub}.
@menu @menu
* Installing GRUB on a floppy:: * Installing GRUB on a floppy::
@ -135,12 +152,17 @@ install GRUB. Normally, the images are installed under the directory
@node Installing GRUB on a floppy @node Installing GRUB on a floppy
@section Installing GRUB on a floppy @section Installing GRUB on a floppy
To create a GRUB boot floppy, you need to take the @file{stage1} and
@file{stage2} files from @file{/boot/grub} directory, and write them to
the first and the second block of the floppy disk.
@quotation @quotation
@strong{Caution:} This procedure will destroy any data currently stored @strong{Caution:} This procedure will destroy any data currently stored
on the floppy. on the floppy.
@end quotation @end quotation
It is easy to create a GRUB boot floppy. Just follow this below: On a UNIX like operating system, that is done with the following
commands:
@example @example
@group @group
@ -158,42 +180,43 @@ The device filename may be different. Consult the manual for your OS.
@quotation @quotation
@strong{Caution:} Installing GRUB's stage1 in this manner will erase the @strong{Caution:} Installing GRUB's stage1 in this manner will erase the
normal boot-sector used by an OS. GRUB can boot GNU Mach, Linux, normal boot-sector used by an OS.
FreeBSD, NetBSD, and OpenBSD directly, so this may be
desired. Generally, it is a good idea to back up the first sector of the
partition on which you are installing GRUB's stage1. This isn't as
important if you are installing GRUB on the first sector of a hard disk,
since it's easy to reinitialize it (by running @code{FDISK /MBR} from
DOS).
@end quotation @end quotation
OK, now reboot your computer with a GRUB boot floppy inserted if you GRUB can currently boot GNU Mach, Linux, FreeBSD, NetBSD, and OpenBSD
decide to install GRUB in the native environment. That's definitely directly, so using it on a boot sector should be okay. But generally, it
desirable. However, if you don't want to reboot your computer, run the would be a good idea to back up the first sector of the partition on
program @file{/sbin/grub} (@pxref{Invoking the grub shell}). which you are installing GRUB's stage1. This isn't as important if you
are installing GRUB on the first sector of a hard disk, since it's easy
to reinitialize it (e.g. by running @samp{FDISK /MBR} from DOS).
In both, GRUB will show the command-line interface (@pxref{Command If you decide to install GRUB in the native environment, which is
definitely desirable, you'll either need to create the GRUB boot disk,
and reboot your computer with it, or run the grub shell (@pxref{Invoking
the grub shell}) as the super-user (@samp{root}).
Once started, GRUB will show the command-line interface (@pxref{Command
line}). First, set the GRUB's @dfn{root device}@footnote{Note that line}). First, set the GRUB's @dfn{root device}@footnote{Note that
GRUB's root device is not your OS's root partition; if you need to GRUB's root device does not neccessarily have to be your OS's root
specify a root partition for your OS, add the argument into the command partition; if you need to specify a root partition for your OS, add the
@command{kernel}.} to the partition which has your GRUB images, like argument into the command @command{kernel}.} to the partition which has
this: your GRUB images, like this:
@example @example
grub> root (hd0,0) grub> root (hd0,0)
@end example @end example
If you are not sure where the images exist, use the command If you are not sure which partition actually holds these files, use the
@command{find}: @command{find} command, like this:
@example @example
grub> find /boot/grub/stage1 grub> find /boot/grub/stage1
@end example @end example
This will search for the filename @file{/boot/grub/stage1} and show the This will search for the filename @file{/boot/grub/stage1} and show the
devices which contain the image. devices which contain the file.
If you set the root device correctly, run the command Once you've set the root device correctly, run the command
@command{setup}: @command{setup}:
@example @example
@ -213,12 +236,13 @@ If you install GRUB into a partition or a drive except for the first
one, you must chain-load GRUB from another boot loader. Refer the manual one, you must chain-load GRUB from another boot loader. Refer the manual
for the boot loader to know how to chain-load GRUB. for the boot loader to know how to chain-load GRUB.
That's all. Now you can boot GRUB without a GRUB floppy, so let's see That's all there is to it: now you can boot GRUB without a GRUB
how to boot your operating systems from GRUB in the next chapter. floppy. See the next chapter to find out how to boot your operating
systems from GRUB.
@node Boot @node Booting
@chapter Boot @chapter Booting
For Multiboot-compliant kernels, GRUB can load them in a consistent way, For Multiboot-compliant kernels, GRUB can load them in a consistent way,
but, for some free operating systems, you need to use some OS-specific but, for some free operating systems, you need to use some OS-specific
@ -269,8 +293,8 @@ the command @command{root}.
Load the kernel image by the command @command{kernel}. Load the kernel image by the command @command{kernel}.
@item @item
Load the modules by the command @command{module} or If you need modules, load them with the command @command{module} or
@command{modulenounzip} as you need. @command{modulenounzip}.
@item @item
Run the command @command{boot}. Run the command @command{boot}.
@ -342,14 +366,16 @@ Here, we describe some caveats on several operating systems.
@subsection GNU/Hurd @subsection GNU/Hurd
Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is
nothing special. But do not forget that you specify a root partition to nothing special about it. But do not forget that you have to specify a
the kernel. root partition to the kernel.
First, set GRUB's root device to the same drive as @enumerate
GNU/Hurd's. Probably @code{find /boot/gnumach} or such will help @item
you. Set GRUB's root device to the same drive as GNU/Hurd's. Probably the
command @code{find /boot/gnumach} or similar can help you.
Second, load the kernel and the module, like this: @item
Load the kernel and the module, like this:
@example @example
@group @group
@ -358,35 +384,40 @@ grub> module /boot/serverboot
@end group @end group
@end example @end example
And, finally, run the command @command{boot}. @item
Run the command @command{boot}.
@end enumerate
@node GNU/Linux @node GNU/Linux
@subsection GNU/Linux @subsection GNU/Linux
It is relatively easy to boot GNU/Linux from GRUB, because booting It is relatively easy to boot GNU/Linux from GRUB, because it somewhat
GNU/Linux somewhat resembles booting a Multiboot-compliant OS. resembles booting a Multiboot-compliant OS.
First, set GRUB's root device to the same drive as @enumerate
GNU/Linux's. Probably @code{find /vmlinuz} or such will help @item
you. Set GRUB's root device to the same drive as GNU/Linux's. Probably the
command @code{find /vmlinuz} or similar can help you.
Second, load the kernel: @item
Load the kernel:
@example @example
grub> kernel /vmlinuz root=/dev/hda1 grub> kernel /vmlinuz root=/dev/hda1
@end example @end example
If you need to specify some kernel parameters, just append them to the If you need to specify some kernel parameters, just append them to the
command. An example is to set @option{vga} to @samp{ext}: command. For example, to set @option{vga} to @samp{ext}, do this:
@example @example
grub> kernel /vmlinuz root=/dev/hda1 vga=ext grub> kernel /vmlinuz root=/dev/hda1 vga=ext
@end example @end example
See the documentation in the Linux source tree, for the complete See the documentation in the Linux source tree for the complete
information on the available options. information on the available options.
@item
If you use initrd, execute the command @command{initrd} after If you use initrd, execute the command @command{initrd} after
@command{kernel}: @command{kernel}:
@ -394,16 +425,17 @@ If you use initrd, execute the command @command{initrd} after
grub> initrd /initrd grub> initrd /initrd
@end example @end example
And, finally, run the command @command{boot}. @item
Finally, run the command @command{boot}.
@end enumerate
@node FreeBSD @node FreeBSD
@subsection FreeBSD @subsection FreeBSD
GRUB can directly load both kernel formats, ELF and a.out, but this is GRUB can directly load both kernel formats, ELF and a.out, but this is
deprecated, since FreeBSD's bootstrap interface is sometimes changed deprecated, since FreeBSD's bootstrap interface sometimes changes
heavily and so GRUB can't guarantee to pass kernel parameters heavily, so GRUB can't guarantee to pass kernel parameters correctly.
correctly.
Thus, we'd recommend loading the very flexible loader Thus, we'd recommend loading the very flexible loader
@file{/boot/loader} instead. See this example: @file{/boot/loader} instead. See this example:
@ -420,42 +452,43 @@ grub> boot
@node NetBSD @node NetBSD
@subsection NetBSD @subsection NetBSD
GRUB can load NetBSD a.out directly, by the following steps: GRUB can load NetBSD a.out directly, follow these steps:
@enumerate @enumerate
@item @item
Set GRUB's root device by @command{root}. Set GRUB's root device with @command{root}.
@item @item
Load the kernel by @command{kernel}. Load the kernel with @command{kernel}.
@item @item
Run @command{boot}. Run @command{boot}.
@end enumerate @end enumerate
For now, however, GRUB doesn't allow you to pass kernel parameters, so For now, however, GRUB doesn't allow you to pass kernel parameters, so
it may be better to chain-load it instead. @xref{Chain-loading}, for it may be better to chain-load it instead, for more information please
more information. see @xref{Chain-loading}.
@node OpenBSD @node OpenBSD
@subsection OpenBSD @subsection OpenBSD
The boot instructions are exactly the same as NetBSD (@pxref{NetBSD}). The booting instructions are exactly the same as for NetBSD
(@pxref{NetBSD}).
@node DOS/Windows @node DOS/Windows
@subsection DOS/Windows @subsection DOS/Windows
GRUB doesn't support DOS or Windows directly, so you must chain-load GRUB doesn't support booting DOS or Windows directly, so you must
them (@pxref{Chain-loading}). However, their boot loaders have some chain-load them (@pxref{Chain-loading}). However, their boot loaders
critical deficiencies, so the general methods may not be enough. have some critical deficiencies, so the general methods may not be
enough.
If you have installed DOS (or Windows) on a non-first hard disk, the If you have installed DOS (or Windows) on a non-first hard disk, you
disk swapping technique is necessary, because it cannot boot any disks have to use the disk swapping technique, because that OS cannot boot
but the first one. The solution used in GRUB is the command from any disks but the first one. The solution used in GRUB is the
@command{map} (@pxref{Command}). For example, if the installed disk is command @command{map} (@pxref{Commands}), like this:
the second hard disk, swap it for the first hard disk:
@example @example
@group @group
@ -464,23 +497,24 @@ grub> map (hd1) (hd0)
@end group @end group
@end example @end example
This performs the @dfn{virtual} exchange between the two disks. This performs a @dfn{virtual} swap between your first and second hard
drive.
@strong{Caution:} This is effective only if DOS (or Windows) uses BIOS @strong{Caution:} This is effective only if DOS (or Windows) uses BIOS
to access the swapped disks. If it uses a special driver for them, to access the swapped disks. If it uses a special driver for them,
probably this doesn't work. it probably won't work.
Another problem arises if you install more than one sets of DOS/Windows Another problem arises if you install more than one sets of DOS/Windows
into one disk, because they could be confused if there are more than one onto one disk, because they could be confused if there are more than one
primary partitions for DOS/Windows. Certainly you should avoid this way, primary partitions for DOS/Windows. Certainly you should avoid doing
but there is a solution if you do want to do so. Use the partition this, but there is a solution if you do want to do so. Use the partition
hiding/unhiding technique. hiding/unhiding technique.
If GRUB @dfn{hide}s a DOS (or Windows) partition, then it ignores the If GRUB @dfn{hide}s a DOS (or Windows) partition, then it ignores the
partition. If GRUB @dfn{unhide}s a DOS (or Windows) partition, it partition. If GRUB @dfn{unhide}s a DOS (or Windows) partition, it
detects the partition. Thus, if you have installed DOS (or Windows) into detects the partition. Thus, if you have installed DOS (or Windows) on
the first partition and the second partition of the first hard disk, the first partition and the second partition of the first hard disk,
follow these below when booting the first: to boot the first copy, do the following:
@example @example
@group @group
@ -497,8 +531,8 @@ grub> boot
@node SCO UnixWare @node SCO UnixWare
@subsection SCO UnixWare @subsection SCO UnixWare
The boot loader in SCO UnixWare is known by the fact that its signature It is known that the signature in the boot loader for SCO UnixWare is
is wrong. So you will need to specify the option @option{--force} to wrong, so you will have to specify the option @option{--force} to
@command{chainloader}, like this: @command{chainloader}, like this:
@example @example
@ -514,19 +548,18 @@ grub> boot
@node Network @node Network
@chapter Downloading OS images from a network @chapter Downloading OS images from a network
Although GRUB is a disk-based boot loader, it provides you some network Although GRUB is a disk-based boot loader, it does provide some network
support. To using the network support, you need to enable at least one support. To using the network support, you need to enable at least one
network driver in the build process. See the file network driver in the build process. For more information please see
@file{netboot/README.netboot} in the source distribution, for more @file{netboot/README.netboot} in the source distribution.
information.
First, you have to set up servers in your network. The servers GRUB First, you have to set up servers in your network. GRUB requires a
requires are a server which assigns an IP address and a file server. The server that will assign an IP address, and a file server. The former is
former is one of a BOOTP server, a DHCP server and a RARP server. RARP either BOOTP, DHCP or a RARP server (RARP is deprecated, since it cannot
is deprecated, since it cannot serve much information. For the latter, serve much information). For the latter, only TFTP is supported at the
only TFTP is supported at the moment. It is not necessary to run both moment. It is not necessary to run both the servers on one computer. How
the servers on one computer. How to configure the servers is beyond the to configure the servers is beyond the scope of this document, so please
scope of this document, so please refer to their own manuals. refer to the manuals specific to those protocols/servers.
Second, run @command{bootp}, @command{dhcp} and @command{rarp} for Second, run @command{bootp}, @command{dhcp} and @command{rarp} for
BOOTP, DHCP and RARP, respectively. Each command will show an assigned BOOTP, DHCP and RARP, respectively. Each command will show an assigned
@ -534,9 +567,9 @@ IP address, a netmask, an IP address for your TFTP server and a
gateway. If any of the addresses is wrong or it causes an error, gateway. If any of the addresses is wrong or it causes an error,
probably the configuration of your servers isn't set up properly. probably the configuration of your servers isn't set up properly.
Lastly, download your OS images from your network. The network can be Finally, download your OS images from your network. The network can be
accessed by the network drive @samp{(nd)}. Everything else is similar to accessed using the network drive @samp{(nd)}. Everything else is very
the normal instructions (@pxref{Boot}). similar to the normal instructions (@pxref{Booting}).
Here is an example: Here is an example:
@ -559,51 +592,174 @@ grub> boot
@node Configuration @node Configuration
@chapter Configuration @chapter Configuration
Probably it is bothersome to type the commands to boot your OS. So You probably noticed that you need to type several commands to boot your
GRUB provides the menu interface (@pxref{Menu}) so that you can just OS. There's a solution to that - GRUB provides a menu interface
select an item from the menu. (@pxref{Menu interface}) from which you can select an item (using arrow
keys) which will do everything to boot an OS.
To enable the menu, write a configuration file and save it in To enable the menu, you need a configuration file,
@file{/boot/grub/menu.lst}. Here is a sample configuration file: @file{/boot/grub/menu.lst}. We'll analyze an example file.
The file first contains some general settings, the menu interface
related options. You can put these commands (@pxref{Menu-specific
commands}) before any of the items (starting with @command{title}).
@example @example
@include menu.lst @group
#
# Sample boot menu configuration file
#
@end group
@end example @end example
As you see, each entry begins with the special command @command{title} and As you may have guessed, these lines are comments. Lines starting with a
the action is described after it. Note that you may not write the hash character (@samp{#}), and blank lines, are ignored by GRUB.
command @command{boot} at each of the entries, since GRUB automatically
executes the command @command{boot} if it loads an OS successfully.
The argument for the command @command{title} is used to display the @example
message about the entry. Since @command{title} displays the argument as @group
it is, you can write any words as you like. # By default, boot the first entry.
default 0
@end group
@end example
You can write the menu interface specific commands (@pxref{Menu-specific The first entry (here, counting starts with number zero, not one!) will
commands}) before any @command{title}. There are several commands you be the default choice.
can use in there, but we describe a few of them. The complete
descriptions can be found in @ref{Command}.
The command @command{default} specifies which entry will be selected @example
when you do not select an entry explicitly. The argument is the entry # Boot automatically after 30 secs.
number. GRUB counts the entries from zero, so the number of the first timeout 30
entry is @samp{0}, the number of the second entry is @samp{1}, @dots{} @end example
The default entry will be executed when you do not select any entry As the comment says, GRUB will boot automatically in 30 seconds, unless
during certain seconds, which is defined by the command interrupted with a keypress.
@command{timeout}. So in the example above, the timeout is 30 seconds.
The command @command{fallback} is used only if the default entry @example
fails. If GRUB executes the default entry and it fails, then it executes @group
the @dfn{fallback} entry. The argument is the same meaning as the one # Fallback to the second entry.
for @command{default}. This command is rarely used. fallback 1
@end group
@end example
In the last entry, @command{color} is used. This command is somewhat If, for any reason, the default entry doesn't work, fall back to the
special because it can be used both in the command-line and in the second one (this is rarely used, for obvious reasons).
menu (@pxref{General commands}). GRUB has such several commands. The
command @command{color} changes the menu colors. It is best to run the
command actually to understand what happens.
We hope that you now understand how to use GRUB. To understand more Note that the complete descriptions of these commands, which are menu
about GRUB, see the User Reference Manual (@pxref{Introduction}). Have interface specific, can be found in @pxref{Menu-specific
fun! commands}. Other descriptions can be found in @ref{Commands}.
Now, on to the actual OS definitions. You will see that each entry
begins with a special command, @command{title}, and the action is
described after it. Note that there is no command @command{boot} at the
end of each item. That is because GRUB automatically executes
@command{boot} if it loads other commands successfully.
The argument for the command @command{title} is used to display a short
title/description of the entry in the menu. Since @command{title}
displays the argument as is, you can write basically anything in there.
@example
@group
# For booting the GNU Hurd
title GNU/Hurd
root (hd0,0)
kernel /boot/gnumach.gz root=hd0s1
module /boot/serverboot.gz
@end group
@end example
This boots GNU/Hurd from the first hard disk.
@example
@group
# For booting Linux
title GNU/Linux
kernel (hd1,0)/vmlinuz root=/dev/hdb1
@end group
@end example
This boots GNU/Linux, but from the second hard disk.
@example
@group
# For booting Mach (getting kernel from floppy)
title Utah Mach4 multiboot
root (hd0,2)
pause Insert the diskette now!!
kernel (fd0)/boot/kernel root=hd0s3
module (fd0)/boot/bootstrap
@end group
@end example
This boots Mach with a kernel on a floppy, but the root filesystem at
hd0s3. It also contains a @command{pause} line, which will cause GRUB to
display a prompt and delay, before actually executing the rest of the
commands and booting.
@example
@group
# For booting FreeBSD
title FreeBSD
root (hd0,2,a)
kernel /boot/loader
@end group
@end example
This item will boot FreeBSD kernel loaded from the @samp{a} partition of
the third @sc{pc} slice of the first hard disk.
@example
@group
# For booting OS/2
title OS/2
root (hd0,1)
makeactive
# chainload OS/2 bootloader from the first sector
chainloader +1
# This is similar to "chainload", but loads a specific file
#chainloader /boot/chain.os2
@end group
@end example
This will boot OS/2, using a chain-loader.
@example
@group
# For booting Windows NT or Windows95
title Windows NT / Windows 95 boot menu
root (hd0,0)
makeactive
chainloader +1
# For loading DOS if Windows NT is installed
# chainload /bootsect.dos
@end group
@end example
The same as the above, just for Windows.
@example
@group
# For installing GRUB into the hard disk
title Install GRUB into the hard disk
root (hd0,0)
setup (hd0)
@end group
@end example
This will just (re)install GRUB on the hard disk.
@example
# Change the colors.
title Change the colors
color light-green/brown blink-red/blue
@end example
In the last entry, the command @command{color} is used, to change the
menu colors (try it!). This command is somewhat special, because it can
be used both in the command-line and in the menu (@pxref{General
commands}). GRUB has several such commands, see the user reference.
We hope that you now understand how to use the basic features of
GRUB. To learn more about GRUB, see the User Reference Manual
(@pxref{Introduction}).
Have fun!

View file

@ -83,7 +83,7 @@ GRUB fully supports the Multiboot feature of loading multiple modules.
@item Configuration File @item Configuration File
Supports a human-readable text configuration file with preset boot Supports a human-readable text configuration file with preset boot
commands. The list of commands (@pxref{Command}) are a superset of commands. The list of commands (@pxref{Commands}) are a superset of
those supported on the command line. An example command file is provided those supported on the command line. An example command file is provided
in @ref{Configuration}. in @ref{Configuration}.
@ -98,7 +98,7 @@ is available to edit any preset commands, or write a new boot command
set from scratch. If no command file is present, GRUB drops to set from scratch. If no command file is present, GRUB drops to
the command line. the command line.
The list of commands (@pxref{Command}) are a subset of those supported The list of commands (@pxref{Commands}) are a subset of those supported
for command files. Editing commands closely resemble the Bash command for command files. Editing commands closely resemble the Bash command
line (@pxref{Command Line Editing, Bash, Command Line Editing, features, line (@pxref{Command Line Editing, Bash, Command Line Editing, features,
Bash Features}), with @key{TAB}-completion of commands, devices, Bash Features}), with @key{TAB}-completion of commands, devices,
@ -205,7 +205,7 @@ accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish
between IDE, ESDI, SCSI, or others. You must know yourself which BIOS between IDE, ESDI, SCSI, or others. You must know yourself which BIOS
device is equivalent to which OS device. Normally, that will be clear if device is equivalent to which OS device. Normally, that will be clear if
you see the files in a device or use the command @command{find} you see the files in a device or use the command @command{find}
(@pxref{Command}). (@pxref{Commands}).
@menu @menu
* Device syntax:: How to specify devices * Device syntax:: How to specify devices
@ -311,7 +311,7 @@ the command line interface.
@menu @menu
* Command line:: The flexible command line interface. * Command line:: The flexible command line interface.
* Menu:: The simple menu interface. * Menu interface:: The simple menu interface.
* Menu entry editor:: Editing a menu entry. * Menu entry editor:: Editing a menu entry.
@end menu @end menu
@ -323,7 +323,7 @@ The command line interface provides a prompt and after it an editable
text area much like a command line in Unix or DOS. Each command is text area much like a command line in Unix or DOS. Each command is
immediately executed after it is entered @footnote{However, this immediately executed after it is entered @footnote{However, this
behavior will be changed in the future version, in a user-invisible behavior will be changed in the future version, in a user-invisible
way.}. The commands (@pxref{Command}) are a subset of those available in way.}. The commands (@pxref{Commands}) are a subset of those available in
the configuration file, used with exactly the same syntax. the configuration file, used with exactly the same syntax.
Cursor movement and editing of the text on the line can be done via a Cursor movement and editing of the text on the line can be done via a
@ -384,7 +384,7 @@ filesystem. This is because TFTP doesn't support filename listing for
the security. the security.
@node Menu @node Menu interface
@section The simple menu interface @section The simple menu interface
The menu interface is quite easy to use. Its commands are both The menu interface is quite easy to use. Its commands are both
@ -427,7 +427,7 @@ To delete a line, hit the key @key{d}. Although GRUB does not support
returning to the main menu. returning to the main menu.
@node Command @node Commands
@chapter The list of available commands @chapter The list of available commands
In this chapter, we list the available commands, both in the In this chapter, we list the available commands, both in the
@ -1270,7 +1270,7 @@ You can use the command @command{grub} for installing GRUB under your
operating systems and for a testbed when you add a new feature into GRUB operating systems and for a testbed when you add a new feature into GRUB
or when fix a bug. @command{grub} is almost the same as the Stage 2, or when fix a bug. @command{grub} is almost the same as the Stage 2,
and, in fact, it shares the source code with the Stage 2 and you can use and, in fact, it shares the source code with the Stage 2 and you can use
the same commands (@pxref{Command}) in @command{grub}. It is emulated by the same commands (@pxref{Commands}) in @command{grub}. It is emulated by
replacing BIOS calls with UNIX system calls and libc functions. replacing BIOS calls with UNIX system calls and libc functions.
The command @command{grub} accepts the following options: The command @command{grub} accepts the following options:

View file

@ -1,3 +1,3 @@
@set UPDATED 30 December 1999 @set UPDATED 2 April 2000
@set EDITION 0.5.94 @set EDITION 0.5.95
@set VERSION 0.5.94 @set VERSION 0.5.95

View file

@ -331,7 +331,8 @@ init_device_map (void)
/* Print something as the user does not think GRUB has been crashed. */ /* Print something as the user does not think GRUB has been crashed. */
fprintf (stderr, fprintf (stderr,
"Probe devices to guess BIOS drives. This may take a long time.\n"); "Probing devices to guess BIOS drives. "
"This may take a long time.\n");
if (device_map_file) if (device_map_file)
/* Try to open the device map file to write the probed data. */ /* Try to open the device map file to write the probed data. */

View file

@ -1294,23 +1294,12 @@ static struct builtin builtin_help =
static int static int
hide_func (char *arg, int flags) hide_func (char *arg, int flags)
{ {
unsigned long tmp_drive = saved_drive;
unsigned long tmp_partition = saved_partition;
if (! set_device (arg)) if (! set_device (arg))
return 1; return 1;
saved_partition = current_partition;
saved_drive = current_drive;
if (! set_partition_hidden_flag (1)) if (! set_partition_hidden_flag (1))
{
saved_drive = tmp_drive;
saved_partition = tmp_partition;
return 1; return 1;
}
saved_drive = tmp_drive;
saved_partition = tmp_partition;
return 0; return 0;
} }
@ -2533,6 +2522,7 @@ setup_func (char *arg, int flags)
char cmd_arg[256]; char cmd_arg[256];
char device[16]; char device[16];
char *buffer = (char *) RAW_ADDR (0x100000); char *buffer = (char *) RAW_ADDR (0x100000);
static void sprint_device (int drive, int partition) static void sprint_device (int drive, int partition)
{ {
grub_sprintf (device, "(%cd%d", grub_sprintf (device, "(%cd%d",
@ -2633,6 +2623,8 @@ setup_func (char *arg, int flags)
/* OK, check if the Stage 1.5 exists. */ /* OK, check if the Stage 1.5 exists. */
if (grub_open (stage1_5_map[i].name)) if (grub_open (stage1_5_map[i].name))
{ {
int blocksize = (filemax + SECTOR_SIZE - 1) / SECTOR_SIZE;
grub_close (); grub_close ();
grub_strcpy (config_file, stage2); grub_strcpy (config_file, stage2);
grub_strcpy (stage2, stage1_5_map[i].name); grub_strcpy (stage2, stage1_5_map[i].name);
@ -2645,26 +2637,22 @@ setup_func (char *arg, int flags)
grub_sprintf (cmd_arg, "%s %s", stage2, device); grub_sprintf (cmd_arg, "%s %s", stage2, device);
/* Notify what will be run. */ /* Notify what will be run. */
grub_printf (" Run \"embed %s\"\n", cmd_arg); grub_printf (" Running \"embed %s\"\n", cmd_arg);
embed_func (cmd_arg, flags); embed_func (cmd_arg, flags);
if (! errnum) if (! errnum)
{ {
int len;
/* Need to know the size of the Stage 1.5. */
grub_seek (0);
len = grub_read (buffer, -1);
/* Construct the blocklist representation. */ /* Construct the blocklist representation. */
grub_sprintf (stage2, "%s1+%d", grub_sprintf (stage2, "%s1+%d", device, blocksize);
device,
(len + SECTOR_SIZE - 1) / SECTOR_SIZE);
/* Need to prepend the device name to the /* Need to prepend the device name to the
configuration filename. */ configuration filename. */
sprint_device (image_drive, image_partition); sprint_device (image_drive, image_partition);
grub_sprintf (buffer, "%s%s", device, config_file); grub_sprintf (buffer, "%s%s", device, config_file);
grub_strcpy (config_file, buffer); grub_strcpy (config_file, buffer);
} }
else
goto fail;
} }
else if (grub_strcmp (fsys, "ffs") == 0) else if (grub_strcmp (fsys, "ffs") == 0)
{ {
@ -2705,7 +2693,7 @@ setup_func (char *arg, int flags)
#endif /* ! NO_BUGGY_BIOS_IN_THE_WORLD */ #endif /* ! NO_BUGGY_BIOS_IN_THE_WORLD */
/* Notify what will be run. */ /* Notify what will be run. */
grub_printf (" Run \"install %s\"\n", cmd_arg); grub_printf (" Running \"install %s\"\n", cmd_arg);
/* Make sure that SAVED_DRIVE and SAVED_PARTITION are identical /* Make sure that SAVED_DRIVE and SAVED_PARTITION are identical
with IMAGE_DRIVE and IMAGE_PARTITION, respectively. */ with IMAGE_DRIVE and IMAGE_PARTITION, respectively. */
@ -2713,7 +2701,8 @@ setup_func (char *arg, int flags)
saved_partition = image_partition; saved_partition = image_partition;
/* Run the command. */ /* Run the command. */
install_func (cmd_arg, flags); if (! install_func (cmd_arg, flags))
grub_printf ("Done.\n");
fail: fail:
saved_drive = tmp_drive; saved_drive = tmp_drive;
@ -2872,23 +2861,12 @@ static struct builtin builtin_title =
static int static int
unhide_func (char *arg, int flags) unhide_func (char *arg, int flags)
{ {
unsigned long tmp_drive = saved_drive;
unsigned long tmp_partition = saved_partition;
if (! set_device (arg)) if (! set_device (arg))
return 1; return 1;
saved_partition = current_partition;
saved_drive = current_drive;
if (! set_partition_hidden_flag (0)) if (! set_partition_hidden_flag (0))
{
saved_drive = tmp_drive;
saved_partition = tmp_partition;
return 1; return 1;
}
saved_drive = tmp_drive;
saved_partition = tmp_partition;
return 0; return 0;
} }

View file

@ -2,7 +2,7 @@
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 1996 Erich Boleyn <erich@uruk.org> * Copyright (C) 1996 Erich Boleyn <erich@uruk.org>
* Copyright (C) 1999 Free Software Foundation, Inc. * Copyright (C) 1999, 2000 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -40,7 +40,7 @@ convert_to_ascii (char *buf, int c,...)
char *ptr = buf; char *ptr = buf;
#ifndef STAGE1_5 #ifndef STAGE1_5
if (c == 'x') if (c == 'x' || c == 'X' || c == 'b')
mult = 16; mult = 16;
if ((num & 0x80000000uL) && c == 'd') if ((num & 0x80000000uL) && c == 'd')
@ -80,6 +80,7 @@ grub_printf (const char *format,...)
{ {
int *dataptr = (int *) &format; int *dataptr = (int *) &format;
char c, *ptr, str[16]; char c, *ptr, str[16];
unsigned long mask = 0xFFFFFFFF;
dataptr++; dataptr++;
@ -91,11 +92,16 @@ grub_printf (const char *format,...)
switch (c = *(format++)) switch (c = *(format++))
{ {
#ifndef STAGE1_5 #ifndef STAGE1_5
case 'b':
mask = 0xFF;
/* Fall down intentionally! */
case 'd': case 'd':
case 'x': case 'x':
case 'X':
#endif #endif
case 'u': case 'u':
*convert_to_ascii (str, c, *((unsigned long *) dataptr++)) = 0; *convert_to_ascii (str, c, *((unsigned long *) dataptr++) & mask)
= 0;
ptr = str; ptr = str;

View file

@ -2,7 +2,7 @@
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 1996 Erich Boleyn <erich@uruk.org> * Copyright (C) 1996 Erich Boleyn <erich@uruk.org>
* Copyright (C) 1999 Free Software Foundation, Inc. * Copyright (C) 1999, 2000 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -197,9 +197,7 @@ init_bios_info (void)
mbi.mem_upper = memtmp; mbi.mem_upper = memtmp;
} }
#ifndef STAGE1_5
saved_mem_upper = mbi.mem_upper; saved_mem_upper = mbi.mem_upper;
#endif
/* /*
* Initialize other Multiboot Info flags. * Initialize other Multiboot Info flags.

View file

@ -358,12 +358,13 @@ make_saved_active (void)
return 1; return 1;
} }
/* Hide/Unhide CURRENT_PARTITION. */
int int
set_partition_hidden_flag (int hidden) set_partition_hidden_flag (int hidden)
{ {
if (saved_drive) if (current_drive & 0x80)
{ {
int part = saved_partition >> 16; int part = current_partition >> 16;
if (part > 3) if (part > 3)
{ {
@ -371,7 +372,7 @@ set_partition_hidden_flag (int hidden)
return 0; return 0;
} }
if (! rawread (saved_drive, 0, 0, SECTOR_SIZE, (char *) SCRATCHADDR)) if (! rawread (current_drive, 0, 0, SECTOR_SIZE, (char *) SCRATCHADDR))
return 0; return 0;
if (hidden) if (hidden)
@ -380,7 +381,7 @@ set_partition_hidden_flag (int hidden)
PC_SLICE_TYPE (SCRATCHADDR, part) &= ~PC_SLICE_TYPE_HIDDEN_FLAG; PC_SLICE_TYPE (SCRATCHADDR, part) &= ~PC_SLICE_TYPE_HIDDEN_FLAG;
buf_track = -1; buf_track = -1;
if (biosdisk (BIOSDISK_WRITE, saved_drive, &buf_geom, if (biosdisk (BIOSDISK_WRITE, current_drive, &buf_geom,
0, 1, SCRATCHSEG)) 0, 1, SCRATCHSEG))
{ {
errnum = ERR_WRITE; errnum = ERR_WRITE;

View file

@ -1,7 +1,7 @@
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 1996 Erich Boleyn <erich@uruk.org> * Copyright (C) 1996 Erich Boleyn <erich@uruk.org>
* Copyright (C) 1999 Free Software Foundation, Inc. * Copyright (C) 1999, 2000 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -97,6 +97,9 @@
* Known PC partition types are defined here. * Known PC partition types are defined here.
*/ */
/* This is not a flag actually, but used as if it were a flag. */
#define PC_SLICE_TYPE_HIDDEN_FLAG 0x10
#define PC_SLICE_TYPE_NONE 0 #define PC_SLICE_TYPE_NONE 0
#define PC_SLICE_TYPE_FAT12 1 #define PC_SLICE_TYPE_FAT12 1
#define PC_SLICE_TYPE_FAT16_LT32M 4 #define PC_SLICE_TYPE_FAT16_LT32M 4
@ -110,13 +113,16 @@
#define PC_SLICE_TYPE_EXT2FS 0x83 #define PC_SLICE_TYPE_EXT2FS 0x83
/* For convinience. */ /* For convinience. */
/* Check if TYPE is a FAT partition type. Clear the hidden flag before
the check, to allow the user to mount a hidden partition in GRUB. */
#define IS_PC_SLICE_TYPE_FAT(type) \ #define IS_PC_SLICE_TYPE_FAT(type) \
(((type) == PC_SLICE_TYPE_FAT12) \ ({ int _type = (type) & ~PC_SLICE_TYPE_HIDDEN_FLAG; \
|| ((type) == PC_SLICE_TYPE_FAT16_LT32M) \ _type == PC_SLICE_TYPE_FAT12 \
|| ((type) == PC_SLICE_TYPE_FAT16_GT32M) \ || _type == PC_SLICE_TYPE_FAT16_LT32M \
|| ((type) == PC_SLICE_TYPE_FAT16_LBA) \ || _type == PC_SLICE_TYPE_FAT16_GT32M \
|| ((type) == PC_SLICE_TYPE_FAT32) \ || _type == PC_SLICE_TYPE_FAT16_LBA \
|| ((type) == PC_SLICE_TYPE_FAT32_LBA)) || _type == PC_SLICE_TYPE_FAT32 \
|| _type == PC_SLICE_TYPE_FAT32_LBA; })
#define IS_PC_SLICE_TYPE_EXTENDED(type) \ #define IS_PC_SLICE_TYPE_EXTENDED(type) \
(((type) == PC_SLICE_TYPE_EXTENDED) \ (((type) == PC_SLICE_TYPE_EXTENDED) \
@ -136,9 +142,6 @@
#define IS_PC_SLICE_TYPE_BSD(type) IS_PC_SLICE_TYPE_BSD_WITH_FS(type,0) #define IS_PC_SLICE_TYPE_BSD(type) IS_PC_SLICE_TYPE_BSD_WITH_FS(type,0)
/* This is not a flag actually, but used as if it were a flag. */
#define PC_SLICE_TYPE_HIDDEN_FLAG 0x10
/* /*
* *BSD-style disklabel & partition definitions. * *BSD-style disklabel & partition definitions.
* *

View file

@ -479,9 +479,7 @@ restart:
if (c == 'q') if (c == 'q')
{ {
/* The same as ``quit''. */ /* The same as ``quit''. */
#ifdef GRUB_UTIL
stop (); stop ();
#endif
} }
#endif #endif
} }

View file

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
# Install GRUB on your drive. # Install GRUB on your drive.
# Copyright (C) 1999 Free Software Foundation, Inc. # Copyright (C) 1999, 2000 Free Software Foundation, Inc.
# #
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -49,6 +49,8 @@ Install GRUB on your drive.
instead of the root directory. instead of the root directory.
--grub-shell=FILE use FILE as the grub shell. --grub-shell=FILE use FILE as the grub shell.
INSTALL_DEVICE can be a GRUB device name or a system device filename.
Reports bugs to <bug-grub@gnu.org>. Reports bugs to <bug-grub@gnu.org>.
EOF EOF
} }
@ -58,26 +60,26 @@ EOF
# This part is OS-specific. # This part is OS-specific.
convert () { convert () {
# First, check if the device file exists. # First, check if the device file exists.
if test ! -e $1; then if test ! -e "$1"; then
echo "$1: Not found." 1>&2 echo "$1: Not found." 1>&2
exit 1 exit 1
fi fi
# Break the device name into the disk part and the partition part. # Break the device name into the disk part and the partition part.
case $host_os in case "$host_os" in
linux*) linux*)
tmp_disk=`echo $1 | sed 's%[0-9]*$%%'` tmp_disk=`echo "$1" | sed 's%[0-9]*$%%'`
tmp_part=`echo $1 | sed "s%$tmp_disk%%"` ;; tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
gnu*) gnu*)
tmp_disk=`echo $1 | sed 's%s[0-9]*[a-g]?%%'` tmp_disk=`echo "$1" | sed 's%s[0-9]*[a-g]?%%'`
tmp_part=`echo $1 | sed "s%$tmp_disk%%"` ;; tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
*) *)
echo "grub-install does not support your OS yet." 1>&2 echo "grub-install does not support your OS yet." 1>&2
exit 1 ;; exit 1 ;;
esac esac
# Get the drive name. # Get the drive name.
tmp_drive=`grep -v '^#' $device_map | grep $tmp_disk \ tmp_drive=`grep -v '^#' $device_map | grep "$tmp_disk" \
| sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%'` | sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%'`
# If not found, print an error message and exit. # If not found, print an error message and exit.
@ -89,23 +91,24 @@ convert () {
if test "x$tmp_part" != x; then if test "x$tmp_part" != x; then
# If a partition is specified, we need to translate it into the # If a partition is specified, we need to translate it into the
# GRUB's syntax. # GRUB's syntax.
case $host_os in case "$host_os" in
linux*) linux*)
echo $tmp_drive | sed "s%)$%,`expr $tmp_part - 1`)%" ;; echo "$tmp_drive" | sed "s%)$%,`expr $tmp_part - 1`)%" ;;
gnu*) gnu*)
tmp_pc_slice=`echo $tmp_part | sed "s%s\([0-9]*\)[a-g]?%\1%"` tmp_pc_slice=`echo "$tmp_part" | sed "s%s\([0-9]*\)[a-g]?%\1%"`
tmp_bsd_partition=`echo $tmp | sed "s%s[0-9]*\([a-g]?\)%\1%"` tmp_bsd_partition=`echo "$tmp_part" \
tmp_drive=`echo $tmp_drive \ | sed "s%s[0-9]*\([a-g]?\)%\1%"`
| sed "s%)%,\`expr $tmp_pc_slice - 1\`)%"` tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"`
if test "x$tmp_bsd_partition" != x; then if test "x$tmp_bsd_partition" != x; then
tmp_drive=`echo $tmp_drive \ tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,\`sed y%abcdefg%0123456%\`)%"` | sed "s%)%,\`sed y%abcdefg%0123456%\`)%"`
fi fi
echo $tmp_drive ;; echo "$tmp_drive" ;;
esac esac
else else
# If no partition is specified, just print the drive name. # If no partition is specified, just print the drive name.
echo $tmp_drive echo "$tmp_drive"
fi fi
} }
@ -119,9 +122,9 @@ for option; do
echo "grub-install (GNU GRUB ${VERSION})" echo "grub-install (GNU GRUB ${VERSION})"
exit 0 ;; exit 0 ;;
--root-directory=*) --root-directory=*)
rootdir=`echo $option | sed 's/--root-directory=//'` ;; rootdir=`echo "$option" | sed 's/--root-directory=//'` ;;
--grub-shell=*) --grub-shell=*)
grub_shell=`echo $option | sed 's/--grub-shell=//'` ;; grub_shell=`echo "$option" | sed 's/--grub-shell=//'` ;;
# This is an undocumented feature... # This is an undocumented feature...
--debug) --debug)
debug=yes ;; debug=yes ;;
@ -145,17 +148,17 @@ grubdir=${bootdir}/grub
device_map=${grubdir}/device.map device_map=${grubdir}/device.map
# Check if GRUB is installed # Check if GRUB is installed
if test ! -f $grub_shell; then if test ! -f "$grub_shell"; then
echo "${grub_shell}: Not found." 1>&2 echo "${grub_shell}: Not found." 1>&2
exit 1 exit 1
fi fi
if test ! -f $pkgdatadir/stage1; then if test ! -f "$pkgdatadir/stage1"; then
echo "${pkgdatadir}/stage1: Not found." 1>&2 echo "${pkgdatadir}/stage1: Not found." 1>&2
exit 1 exit 1
fi fi
if test ! -f $pkgdatadir/stage2; then if test ! -f "$pkgdatadir/stage2"; then
echo "${pkgdatadir}/stage2: Not found." 1>&2 echo "${pkgdatadir}/stage2: Not found." 1>&2
exit 1 exit 1
fi fi
@ -164,11 +167,11 @@ fi
# Stage 1.5 does not exist. # Stage 1.5 does not exist.
# Create the GRUB directory if it is not present. # Create the GRUB directory if it is not present.
test -d $bootdir || mkdir $bootdir test -d "$bootdir" || mkdir "$bootdir"
test -d $grubdir || mkdir $grubdir test -d "$grubdir" || mkdir "$grubdir"
# Create the device map file if it is not present. # Create the device map file if it is not present.
if test ! -f $device_map; then if test ! -f "$device_map"; then
# Create a safe temporary file. # Create a safe temporary file.
test -x /bin/tempfile && log_file=`tempfile --prefix=grub` test -x /bin/tempfile && log_file=`tempfile --prefix=grub`
@ -190,7 +193,7 @@ if test "x$install_device" = x; then
else else
case "$install_device" in case "$install_device" in
/dev/*) /dev/*)
install_drive=`convert $install_device` install_drive=`convert "$install_device"`
# I don't know why, but some shells wouldn't die if exit is # I don't know why, but some shells wouldn't die if exit is
# called in a function. # called in a function.
if test "x$install_drive" = x; then if test "x$install_drive" = x; then
@ -208,15 +211,16 @@ fi
# For now, this uses the program `df' to get the device name, but is # For now, this uses the program `df' to get the device name, but is
# this really portable? # this really portable?
root_device=`df ${rootdir} | grep /dev/ | sed 's%.*\(/dev/[a-z0-9]*\).*%\1%'` root_device=`df ${rootdir} | grep /dev/ | sed 's%.*\(/dev/[a-z0-9]*\).*%\1%'`
root_drive=`convert $root_device` root_drive=`convert "$root_device"`
if test "x$root_drive" = x; then if test "x$root_drive" = x; then
exit 1 exit 1
fi fi
# Check if the root directory exists in the same device as the grub # Check if the root directory exists in the same device as the grub
# directory. # directory.
grubdir_device=`df ${grubdir} | grep /dev/ | sed 's%.*\(/dev/[a-z0-9]*\).*%\1%'` grubdir_device=`df ${grubdir} | grep /dev/ \
if test $grubdir_device != $root_device; then | sed 's%.*\(/dev/[a-z0-9]*\).*%\1%'`
if test "x$grubdir_device" != "x$root_device"; then
# For now, cannot deal with this situation. # For now, cannot deal with this situation.
cat <<EOF 1&>2 cat <<EOF 1&>2
You must set the root directory by the option --root-directory, because You must set the root directory by the option --root-directory, because