enable the fallback in bios.c, add new options into grub-install.
This commit is contained in:
parent
adcd2008e1
commit
68b1a3d231
11 changed files with 810 additions and 572 deletions
22
ChangeLog
22
ChangeLog
|
@ -1,3 +1,25 @@
|
||||||
|
2000-01-10 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
|
* stage2/bios.c (NO_INT13_FALLBACK): Undefined.
|
||||||
|
(get_diskinfo) [!NO_BUGGY_BIOS_IN_THE_WORLD]: Do not check if
|
||||||
|
bit 0 in DRP.FLAGS is set, because at least one BIOS does not
|
||||||
|
set it correctly. Reported by "Forever shall I be."
|
||||||
|
<zinx@linuxfreak.com>.
|
||||||
|
|
||||||
|
* util/grub-install.in: Handle the new options `--root' and
|
||||||
|
`--grub-shell'.
|
||||||
|
(rootdir): New variable.
|
||||||
|
(usage): Print the help messages about the options --root and
|
||||||
|
--grub-shell.
|
||||||
|
(bootdir): Initialized after the option analysis.
|
||||||
|
(grubdir): Likewise.
|
||||||
|
(device_map): Likewise.
|
||||||
|
(root_device): Set to the result for the directory ROOTDIR
|
||||||
|
instead of "/".
|
||||||
|
* docs/user-ref.texi (Invoking grub-install): Added the
|
||||||
|
descriptions about --root and --grub-shell.
|
||||||
|
* docs/grub-install.8: Regenerated.
|
||||||
|
|
||||||
2000-01-08 OKUJI Yoshinori <okuji@gnu.org>
|
2000-01-08 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
* util/grub-install.in (grubdir_device): New variable.
|
* util/grub-install.in (grubdir_device): New variable.
|
||||||
|
|
56
config.h.in
56
config.h.in
|
@ -24,36 +24,44 @@
|
||||||
/* Defined if _end is defined. */
|
/* Defined if _end is defined. */
|
||||||
#undef HAVE_USCORE_END_SYMBOL
|
#undef HAVE_USCORE_END_SYMBOL
|
||||||
|
|
||||||
/* Define if you have the <curses.h> header file. */
|
|
||||||
#undef HAVE_CURSES_H
|
|
||||||
|
|
||||||
/* Define if you have the <ncurses.h> header file. */
|
|
||||||
#undef HAVE_NCURSES_H
|
|
||||||
|
|
||||||
/* Define if you have the <ncurses/curses.h> header file. */
|
|
||||||
#undef HAVE_NCURSES_CURSES_H
|
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
||||||
|
|
||||||
/* Define if C symbols get an underscore after compilation */
|
|
||||||
#undef HAVE_ASM_USCORE
|
|
||||||
|
|
||||||
/* Define it to "addr32" or "addr32;" to make GAS happy */
|
/* Define it to "addr32" or "addr32;" to make GAS happy */
|
||||||
#undef ADDR32
|
#undef ADDR32
|
||||||
|
|
||||||
/* Define it to "data32" or "data32;" to make GAS happy */
|
/* Define it to "data32" or "data32;" to make GAS happy */
|
||||||
#undef DATA32
|
#undef DATA32
|
||||||
|
|
||||||
|
/* Define if C symbols get an underscore after compilation */
|
||||||
|
#undef HAVE_ASM_USCORE
|
||||||
|
|
||||||
|
/* Define if you have the <curses.h> header file. */
|
||||||
|
#undef HAVE_CURSES_H
|
||||||
|
|
||||||
|
/* Define if you have the `curses' library (-lcurses). */
|
||||||
|
#undef HAVE_LIBCURSES
|
||||||
|
|
||||||
|
/* Define if you have the `ncurses' library (-lncurses). */
|
||||||
|
#undef HAVE_LIBNCURSES
|
||||||
|
|
||||||
|
/* Define if you have the `util' library (-lutil). */
|
||||||
|
#undef HAVE_LIBUTIL
|
||||||
|
|
||||||
|
/* Define if you have the <ncurses/curses.h> header file. */
|
||||||
|
#undef HAVE_NCURSES_CURSES_H
|
||||||
|
|
||||||
|
/* Define if you have the <ncurses.h> header file. */
|
||||||
|
#undef HAVE_NCURSES_H
|
||||||
|
|
||||||
/* Define if opendisk() in -lutil can be used */
|
/* Define if opendisk() in -lutil can be used */
|
||||||
#undef HAVE_OPENDISK
|
#undef HAVE_OPENDISK
|
||||||
|
|
||||||
|
/* Define if you have the <strings.h> header file. */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
|
/* Define if you have the <string.h> header file. */
|
||||||
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#undef VERSION
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.016.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.016.
|
||||||
.TH GRUB-INSTALL "8" "November 1999" "grub-install (GNU GRUB 0.5.94)" FSF
|
.TH GRUB-INSTALL "8" "January 2000" "grub-install (GNU GRUB 0.5.94)" FSF
|
||||||
.SH NAME
|
.SH NAME
|
||||||
grub-install \- install GRUB on your drive
|
grub-install \- install GRUB on your drive
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -13,6 +13,13 @@ print this message and exit
|
||||||
.TP
|
.TP
|
||||||
\fB\-v\fR, \fB\-\-version\fR
|
\fB\-v\fR, \fB\-\-version\fR
|
||||||
print the version information and exit
|
print the version information and exit
|
||||||
|
.TP
|
||||||
|
\fB\-\-root\fR=\fIDIR\fR
|
||||||
|
install GRUB images under the directory DIR
|
||||||
|
instead of the root directory.
|
||||||
|
.TP
|
||||||
|
\fB\-\-grub\-shell\fR=\fIFILE\fR
|
||||||
|
use FILE as the grub shell.
|
||||||
.PP
|
.PP
|
||||||
Reports bugs to <bug-grub@gnu.org>.
|
Reports bugs to <bug-grub@gnu.org>.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.016.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.016.
|
||||||
.TH GRUB "8" "November 1999" "GNU GRUB 0.5.94" FSF
|
.TH GRUB "8" "January 2000" "GNU GRUB 0.5.94" FSF
|
||||||
.SH NAME
|
.SH NAME
|
||||||
GRUB \- the grub shell
|
GRUB \- the grub shell
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.016.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.016.
|
||||||
.TH MBCHK "1" "November 1999" "mbchk (GNU GRUB 0.5.94)" FSF
|
.TH MBCHK "1" "January 2000" "mbchk (GNU GRUB 0.5.94)" 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
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
@set UPDATED 18 November 1999
|
@set UPDATED 30 December 1999
|
||||||
@set EDITION 0.5.94
|
@set EDITION 0.5.94
|
||||||
@set VERSION 0.5.94
|
@set VERSION 0.5.94
|
||||||
|
|
|
@ -1384,6 +1384,19 @@ Print a summary of the command line options and exit.
|
||||||
|
|
||||||
@item --version
|
@item --version
|
||||||
Print the version number of GRUB and exit.
|
Print the version number of GRUB and exit.
|
||||||
|
|
||||||
|
@item --root=@var{dir}
|
||||||
|
Install GRUB images under the directory @var{dir} instead of the root
|
||||||
|
directory. This option is useful when you want to install GRUB into a
|
||||||
|
separate partition and a removable disk.
|
||||||
|
|
||||||
|
@item --grub-shell=@var{file}
|
||||||
|
Use @var{file} as the grub shell. You can append arbitrary options to
|
||||||
|
@var{file} after the filename, like this:
|
||||||
|
|
||||||
|
@example
|
||||||
|
grub-install --grub-shell="grub --read-only" /dev/fd0
|
||||||
|
@end example
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
@set UPDATED 18 November 1999
|
@set UPDATED 30 December 1999
|
||||||
@set EDITION 0.5.94
|
@set EDITION 0.5.94
|
||||||
@set VERSION 0.5.94
|
@set VERSION 0.5.94
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* bios.c - implement C part of low-level BIOS disk input and output */
|
/* bios.c - implement C part of low-level BIOS disk input and output */
|
||||||
/*
|
/*
|
||||||
* GRUB -- GRand Unified Bootloader
|
* GRUB -- GRand Unified Bootloader
|
||||||
* 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
|
||||||
|
@ -76,7 +76,7 @@ biosdisk (int read, int drive, struct geometry *geometry,
|
||||||
|
|
||||||
err = biosdisk_int13_extensions (read + 0x42, drive, &dap);
|
err = biosdisk_int13_extensions (read + 0x42, drive, &dap);
|
||||||
|
|
||||||
#define NO_INT13_FALLBACK 1
|
/* #undef NO_INT13_FALLBACK */
|
||||||
#ifndef NO_INT13_FALLBACK
|
#ifndef NO_INT13_FALLBACK
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
|
@ -158,16 +158,25 @@ get_diskinfo (int drive, struct geometry *geometry)
|
||||||
err = get_diskinfo_int13_extensions (drive, &drp);
|
err = get_diskinfo_int13_extensions (drive, &drp);
|
||||||
if (! err)
|
if (! err)
|
||||||
{
|
{
|
||||||
|
/* How many buggy BIOSes are there in the world...
|
||||||
|
Some BIOSes don't set the flag correctly, even if LBA
|
||||||
|
read/write is supported, so we cannot help assuming
|
||||||
|
that the functions are supported by default and
|
||||||
|
clearing the flag when either of them fails. *sigh* */
|
||||||
|
#ifdef NO_BUGGY_BIOS_IN_THE_WORLD
|
||||||
/* Make sure that LBA read/write functions are supported. */
|
/* Make sure that LBA read/write functions are supported. */
|
||||||
if (drp.flags & 1)
|
if (drp.flags & 1)
|
||||||
{
|
{
|
||||||
|
#endif
|
||||||
geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION;
|
geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION;
|
||||||
|
|
||||||
/* FIXME: when the 2TB limit becomes critical, we must
|
/* FIXME: when the 2TB limit becomes critical, we must
|
||||||
change the type of TOTAL_SECTORS to unsigned long
|
change the type of TOTAL_SECTORS to unsigned long
|
||||||
long. */
|
long. */
|
||||||
total_sectors = drp.total_sectors & ~0L;
|
total_sectors = drp.total_sectors & ~0L;
|
||||||
|
#ifdef NO_BUGGY_BIOS_IN_THE_WORLD
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,8 @@ host_vendor=@host_vendor@
|
||||||
pkgdatadir=${datadir}/${PACKAGE}/${host_cpu}-${host_vendor}
|
pkgdatadir=${datadir}/${PACKAGE}/${host_cpu}-${host_vendor}
|
||||||
|
|
||||||
grub_shell=${sbindir}/grub
|
grub_shell=${sbindir}/grub
|
||||||
bootdir=/boot
|
|
||||||
grubdir=${bootdir}/grub
|
|
||||||
device_map=${grubdir}/device.map
|
|
||||||
log_file=/tmp/grub-install.log.$$
|
log_file=/tmp/grub-install.log.$$
|
||||||
|
rootdir=
|
||||||
|
|
||||||
install_device=
|
install_device=
|
||||||
debug=no
|
debug=no
|
||||||
|
@ -47,6 +45,9 @@ Install GRUB on your drive.
|
||||||
|
|
||||||
-h, --help print this message and exit
|
-h, --help print this message and exit
|
||||||
-v, --version print the version information and exit
|
-v, --version print the version information and exit
|
||||||
|
--root=DIR install GRUB images under the directory DIR
|
||||||
|
instead of the root directory.
|
||||||
|
--grub-shell=FILE use FILE as the grub shell.
|
||||||
|
|
||||||
Reports bugs to <bug-grub@gnu.org>.
|
Reports bugs to <bug-grub@gnu.org>.
|
||||||
EOF
|
EOF
|
||||||
|
@ -117,6 +118,10 @@ for option; do
|
||||||
-v | --version)
|
-v | --version)
|
||||||
echo "grub-install (GNU GRUB ${VERSION})"
|
echo "grub-install (GNU GRUB ${VERSION})"
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
|
--root=*)
|
||||||
|
rootdir=`echo $option | sed 's/--root=//'` ;;
|
||||||
|
--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 ;;
|
||||||
|
@ -134,6 +139,11 @@ if test $debug = yes; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Initialize these directories here, since ROOTDIR was initialized.
|
||||||
|
bootdir=${rootdir}/boot
|
||||||
|
grubdir=${bootdir}/grub
|
||||||
|
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
|
||||||
|
@ -197,7 +207,7 @@ fi
|
||||||
# Get the root drive.
|
# Get the root drive.
|
||||||
# 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 / | 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue