Toward The New Bootdisk Howto, part 6

(Making a GRUB rescue disk)

It is time to make something almost useful. This is the explanation how to make your own GRUB (version 1) boot disk.

By downloading the next version of the package Strelka (0.5.2) you will get a script which would download GRUB, unpack it, compile it and generate 98K big (or small 😉 ) GRUB boot image. You should just run the program ./getsoftware-stable.py inside of unpacked directory and after the process you will get disk image at disks/disk0.img.

After that you may run it by using qemu: qemu -fda disks/disk0.img -no-kqemu -m 256 -boot a.

Process

Here is the short explanation of what program is doing (note that this is not an explanation of the whole program which may do a couple of more and not so important things):

  1. It is downloading GRUB from ftp://alpha.gnu.org/gnu/grub/grub-0.97.tar.gz.
  2. Then it is unpacking it inside of the directory build/grub-0.97.
  3. After that script build_grub_disk.sh is running ./configure and make.
  4. The same script is generating disk image by using the command cat build/grub-0.97/stage1/stage1 build/grub-0.97/stage2/stage2 > disks/disk.img.

If you don’t know how to use programs wget and tar, please read documentation. Both of the programs are the part of GNU system and you may choose one of the manual variant: wget manual page and tar manual page.

If you don’t know to use GNU configure and build system, please read the Ian Lance Taylor’s manual.

GRUB files

There is a good manual for the first generation GRUB, also at the GNU’s site. However, there is no any useful documentation for the second generation GRUB. Because of that I decided to use the first generation GRUB for the beginning. At the some stage of the drive we will switch to the second generation GRUB again.

If your distribution is using GRUB you may just cat /boot/grub/stage1 and /boot/grub/stage2 files into one disk image. However, we want to build the system independent of the architecture or boot loader and even independent of kernel. So, basically, the first goal was to make those to files by compiling.

File stage1 contains boot sector and file stage2 contains the rest of the GRUB. Actually, it contains GRUB itself.

As you could see, making simple rescue GRUB disk is quite simple. If you want to put it on floppy disk, you should do just cat disks/disk0.img > /dev/fd0 (of course, with floppy disk inside of your disk drive).

However, making disk with grub, kernel and busybox is somewhat more complex.


Collaboration

You may join the discussion group (which is still not active), as well as you may contact me (millosh@gmail.com).


Contents:

  1. Toward The New Bootdisk Howto, part 1 (The Beginning of The Road)
  2. Toward The New Bootdisk Howto, part 2 (A Scratch for The Road, part 1)
  3. Toward The New Bootdisk Howto, part 3 (A Scratch for The Road, part 2)
  4. Toward The New Bootdisk Howto, part 4 (A Scratch for The Road, part 3: kernels 1)
  5. Toward The New Bootdisk Howto, part 5 (A Scratch for The Road, part 4: kernels 2)
  6. Toward The New Bootdisk Howto, part 6 (Making a GRUB rescue disk)

Advertisements

~ by millosh on September 30, 2007.

4 Responses to “Toward The New Bootdisk Howto, part 6”

  1. […] Toward The New Bootdisk Howto, part 6 (Making a GRUB rescue disk) […]

  2. […] Toward The New Bootdisk Howto, part 6 (Making a GRUB rescue disk) […]

  3. […] 2007 GRUB2 is not perfectly stable yet as well as there are no useful documentation. So, try to make GRUB [1] rescue disk (or USB flash), boot it (read GRUB manual) and install GRUB1 when the system […]

  4. wow what a great how to what is it about is it about how to read?

Comments are closed.

 
%d bloggers like this: