[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#927892: grub-ieee1275-bin: Please add bootinfo.txt for sparc and sparc64



Hi,

John Paul Adrian Glaubitz wrote:
> I have read the genisoimage manpage and I have to admit, I haven't fully understood
> yet how it is supposed to work. It seems we have to specify the bootloader code
> with -G, thus -G cdboot.img. But -B is apparently used to pass a whole directory
> name which means I don't understand how genisoimage knows which is the second stage bootloader.

Dumping here what i learned when Vladimir Serbinko told me how to
do it with xorriso underneath grub-mkrescue:

libisofs/doc/boot_sectors.txt has:
=========================================================================
                      GRUB2 SUN SPARC Core File Address

Sources:
    Mail conversations with Vladimir Serbinenko.

GRUB2 lets libisofs write after the disk label block the address and size of a
data file in the ISO image. E.g. of /boot/grub/sparc64-ieee1275/core.img.
This is combined with a SUN Disk Label which exposes only the single partition
describing the overall ISO filesystem size.

  Byte Range | Value      | Meaning
------------ | ---------- | --------------------------------------------------
 512 -   551 |     opaque | Code and data provided by GRUB2
             |            |
 552 -   559 |     offset | Start byte number of the file. 64-bit big-endian.
             |            |
 560 -   563 |      size  | Number of bytes in the file. 32-bit big-endian.
             |            |
 564 - 32767 |     opaque | Code and data provided by GRUB2
             |            |
------------ | ---------- | --------------------------------------------------

=========================================================================
(There is a section "SUN Disk Label and boot images for SUN SPARC" before
 that special GRUB description.)

man xorrisofs:
=========================================================================

  -B disk_path[,disk_path ...]
        Cause one or more data files on disk to be written after the end
        of  the  ISO  image.  A  SUN Disk Label will be written into the
        first 512 bytes of the ISO  image  which  lists  this  image  as
        partition 1 and the given disk_paths as partition 2 up to 8.
        The disk files should contain suitable boot images for SUN SPARC
        systems.
        The pseudo disk_path  "..."  causes  that  all  empty  partition
        entries  become  copies of the last non-empty entry. If no other
        disk_path is given before "..." then all partitions describe the
        ISO image. In this case, the boot loader code has to be imported
        by option -G.

=========================================================================

util/grub-mkrescue.c does
=========================================================================

  if (source_dirs[GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275]
      && system_area == SYS_AREA_SPARC)
    {
      ...
      xorriso_push ("-G");
      xorriso_push (sysarea_img);
      xorriso_push ("-B");
      xorriso_push (",");
      xorriso_push ("--grub2-sparc-core");
      xorriso_push ("/boot/grub/sparc64-ieee1275/core.img");

=========================================================================

The mkisofs emulation option --grub2-sparc-core does the stuff described
in boot_sectors.txt.


(And i see nice examples of grub_util_fopen() and fwrite(3) by which
 grub-mkrescue could zero the EFI partition's partition table after
 mformat did its work ...)


I hope this helps to get more insight. More background might be known
to Vladimir.


Have a nice day :)

Thomas


Reply to: