* docs/grub.texi (Making a GRUB bootable CD-ROM): Update to describe

grub-mkrescue.
This commit is contained in:
Colin Watson 2011-01-28 17:01:28 +00:00
parent 3281d3d6d4
commit 800f188183
2 changed files with 28 additions and 25 deletions

View file

@ -1,3 +1,8 @@
2011-01-28 Colin Watson <cjwatson@ubuntu.com>
* docs/grub.texi (Making a GRUB bootable CD-ROM): Update to describe
grub-mkrescue.
2011-01-24 Vladimir Serbinenko <phcoder@gmail.com> 2011-01-24 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkimage.c (generate_image): Refuse to create the images * util/grub-mkimage.c (generate_image): Refuse to create the images

View file

@ -651,15 +651,22 @@ 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, from GRUB and you don't have to make a floppy or hard disk image file,
which can cause compatibility problems. which can cause compatibility problems.
For booting from a CD-ROM, GRUB uses a special Stage 2 called For booting from a CD-ROM, GRUB uses a special image called
@file{stage2_eltorito}. The only GRUB files you need to have in your @file{cdboot.img}, which is concatenated with @file{core.img}. The
bootable CD-ROM are this @file{stage2_eltorito} and optionally a config file @file{core.img} used for this should be built with at least the
@file{grub.cfg}. You don't need to use @file{stage1} or @file{stage2}, @samp{iso9660} and @samp{biosdisk} modules. Your bootable CD-ROM will
because El Torito is quite different from the standard boot process. usually also need to include a configuration file @file{grub.cfg} and some
other GRUB modules.
Here is an example of procedures to make a bootable CD-ROM To make a simple generic GRUB rescue CD, you can use the
image. First, make a top directory for the bootable image, say, @command{grub-mkrescue} program:
@samp{iso}:
@example
$ @kbd{grub-mkrescue -o grub.iso}
@end example
You will often need to include other files in your image. To do this, first
make a top directory for the bootable image, say, @samp{iso}:
@example @example
$ @kbd{mkdir iso} $ @kbd{mkdir iso}
@ -671,33 +678,24 @@ Make a directory for GRUB:
$ @kbd{mkdir -p iso/boot/grub} $ @kbd{mkdir -p iso/boot/grub}
@end example @end example
Copy the file @file{stage2_eltorito}:
@example
$ @kbd{cp /usr/lib/grub/i386-pc/stage2_eltorito iso/boot/grub}
@end example
If desired, make the config file @file{grub.cfg} under @file{iso/boot/grub} If desired, make the config file @file{grub.cfg} under @file{iso/boot/grub}
(@pxref{Configuration}), and copy any files and directories for the disc to the (@pxref{Configuration}), and copy any files and directories for the disc to the
directory @file{iso/}. directory @file{iso/}.
Finally, make a ISO9660 image file like this: Finally, make the image:
@example @example
$ @kbd{mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \ $ @kbd{grub-mkrescue -o grub.iso iso}
-boot-load-size 4 -boot-info-table -o grub.iso iso}
@end example @end example
This produces a file named @file{grub.iso}, which then can be burned This produces a file named @file{grub.iso}, which then can be burned
into a CD (or a DVD). @kbd{mkisofs} has already set up the disc to boot into a CD (or a DVD), or written to a USB mass storage device.
from the @kbd{boot/grub/stage2_eltorito} file, so there is no need to
setup GRUB on the disc. (Note that the @kbd{-boot-load-size 4} bit is
required for compatibility with the BIOS on many older machines.)
You can use the device @samp{(cd)} to access a CD-ROM in your The root device will be set up appropriately on entering your
config file. This is not required; GRUB automatically sets the root device @file{grub.cfg} configuration file, so you can refer to file names on the CD
to @samp{(cd)} when booted from a CD-ROM. It is only necessary to refer to without needing to use an explicit device name. This makes it easier to
@samp{(cd)} if you want to access other drives as well. produce rescue images that will work on both optical drives and USB mass
storage devices.
@node Device map @node Device map