2004-04-18 Yoshinori K. Okuji <okuji@enbug.org>

* docs/grub.texi (Making a GRUB bootable CD-ROM): New section.

	* stage2/disk_io.c (set_device): Use CH instead of *DEVICE to
	test the first character of DEVICE, because DEVICE is
	incremented.
	Reported by Bernhard Treutwein.
This commit is contained in:
okuji 2004-04-18 12:39:39 +00:00
parent 4e69adb6ab
commit de89ab8289
3 changed files with 77 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2004-04-18 Yoshinori K. Okuji <okuji@enbug.org>
* docs/grub.texi (Making a GRUB bootable CD-ROM): New section.
* stage2/disk_io.c (set_device): Use CH instead of *DEVICE to
test the first character of DEVICE, because DEVICE is
incremented.
Reported by Bernhard Treutwein.
2004-04-15 Yoshinori K. Okuji <okuji@enbug.org> 2004-04-15 Yoshinori K. Okuji <okuji@enbug.org>
* netboot/fsys_tftp.c (buf_fill): Cast 1 to unsigned short * netboot/fsys_tftp.c (buf_fill): Cast 1 to unsigned short

View file

@ -485,6 +485,7 @@ directory}, and the directory where the boot loader needs to find them
* Creating a GRUB boot floppy:: * Creating a GRUB boot floppy::
* Installing GRUB natively:: * Installing GRUB natively::
* Installing GRUB using grub-install:: * Installing GRUB using grub-install::
* Making a GRUB bootable CD-ROM::
@end menu @end menu
@ -665,6 +666,61 @@ unless you are very familiar with the internals of GRUB. Installing a
boot loader on a running OS may be extremely dangerous. boot loader on a running OS may be extremely dangerous.
@node Making a GRUB bootable CD-ROM
@section Making a GRUB bootable CD-ROM
GRUB supports the @dfn{no emulation mode} in the El Torito
specification@footnote{El Torito is a specification for bootable CD
using BIOS functions.}. This means that you can use the whole CD-ROM
from GRUB and you don't have to make a floppy or hard disk image file.
For booting from a CD-ROM, GRUB uses a special Stage 2 called
@file{stage2_eltoriro}. All you need to have in your bootable CD-ROM
are this @file{stage2_eltorito} and optionally a config file
@file{menu.lst}. You don't need to use @file{stage1} or @file{stage2},
because El Torito is quite different from the standard boot process.
Here is an example of procedures to make a bootable CD-ROM
image. First, make a top directory for the bootable image, say,
@samp{iso}:
@example
$ @kbd{mkdir iso}
@end example
Make a directory for GRUB:
@example
$ @kbd{mkdir -p iso/boot/grub}
@end example
Copy the file @file{stage2_eltorito}:
@example
$ @kbd{cp /usr/share/grub/i386-pc/stage2_eltorito iso/boot/grub}
@end example
Then, make the config file @file{menu.lst} under @file{iso/boot/grub}
(@pxref{Configuration}), and copy files and directories to the
directory @file{iso} as you wish.
Finally, make a ISO9660 image file like this:
@example
$ @kbd{mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \
-boot-load-size 1 -boot-info-table -o grub.iso iso}
@end example
This produces a file named @file{grub.iso}, which then can be burned
into a CD (or a DVD).
Note that you can use the device @samp{(cd)} to access a CD-ROM in your
config file. But you won't have to use this feature, because GRUB
automatically sets the root device to @samp{(cd)} when booted from a
CD-ROM. So it is not necessary to specify the device name explicitly,
unless you want to access other drives as well.
@node Booting @node Booting
@chapter Booting @chapter Booting
@ -1504,8 +1560,9 @@ different passwords for different entries.
@chapter GRUB image files @chapter GRUB image files
GRUB consists of several images: two essential stages, optional stages GRUB consists of several images: two essential stages, optional stages
called @dfn{Stage 1.5}, and two network boot images. Here is a short called @dfn{Stage 1.5}, one image for bootable CD-ROM, and two network
overview of them. @xref{Internals}, for more details. boot images. Here is a short overview of them. @xref{Internals}, for
more details.
@table @file @table @file
@item stage1 @item stage1
@ -1544,6 +1601,11 @@ While Stage 2 cannot generally be embedded in a fixed area as the size
is so large, Stage 1.5 can be installed into the area right after an MBR, is so large, Stage 1.5 can be installed into the area right after an MBR,
or the boot loader area of a ReiserFS or a FFS. or the boot loader area of a ReiserFS or a FFS.
@item stage2_eltorito
This is a boot image for CD-ROMs using the @dfn{no emulation mode} in
El Torito specification. This is identical to Stage 2, except that
this boots up without Stage 1 and sets up a special drive @samp{(cd)}.
@item nbgrub @item nbgrub
This is a network boot image for the Network Image Proposal used by some This is a network boot image for the Network Image Proposal used by some
network boot loaders, such as Etherboot. This is mostly the same as network boot loaders, such as Etherboot. This is mostly the same as
@ -1617,6 +1679,9 @@ If you enabled the network support, the special drive, @samp{(nd)}, is
also available. Before using the network drive, you must initialize the also available. Before using the network drive, you must initialize the
network. @xref{Network}, for more information. network. @xref{Network}, for more information.
If you boot GRUB from a CD-ROM, @samp{(cd)} is available. @xref{Making
a GRUB bootable CD-ROM}, for details.
@node File name syntax @node File name syntax
@section How to specify files @section How to specify files

View file

@ -1011,7 +1011,7 @@ set_device (char *device)
else else
#endif /* SUPPORT_NETBOOT */ #endif /* SUPPORT_NETBOOT */
{ {
if (*device == 'c' && cdrom_drive != GRUB_INVALID_DRIVE) if (ch == 'c' && cdrom_drive != GRUB_INVALID_DRIVE)
current_drive = cdrom_drive; current_drive = cdrom_drive;
else else
{ {