Re: grub2 BIOS booting iso and code

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

 



Hi,

i wrote:
> > xorrisofs option --mbr-force-bootable

Chris Murphy wrote:
> with the bit set it means older versions of
> Tianocore or anything based on Tianocore up until maybe 6 months ago,
> won't boot.

Is this maybe about the code snippet of Tianocore which Alexander E.
Patrakov showed in the course of the grub-bug thread of 2015/16 ?

  https://marc.info/?l=grub-bug&m=145052969801875&w=2
  "
  OK, Tiano Core validates the protective partition as follows:

  //
  // Verify that the Protective MBR is valid
  //
  for (Index = 0; Index < MAX_MBR_PARTITIONS; Index++) {
    if (ProtectiveMbr->Partition[Index].BootIndicator == 0x00 &&
        ProtectiveMbr->Partition[Index].OSIndicator == PMBR_GPT_PARTITION &&
        UNPACK_UINT32 (ProtectiveMbr->Partition[Index].StartingLBA) == 1
        ) {
      break;
    }
  }
  if (Index == MAX_MBR_PARTITIONS) {
    goto Done;  // i.e. not valid
  }

  So here is an alternative suggestion: don't mark the protective partition,
  create another dummy MBR partition of type 0x00, mark it as bootable.
  "

That's what --mbr-force-bootable does.
The shown code will find type 0xEE == PMBR_GPT_PARTITION in partition 1
with boot/active flag == 0x00 and be happy.

Others which are more picky will hopefully ignore partitions of type 0x00.
UEFI 2.8 , 5.2.1 Legacy Master Boot Record (MBR) says:
  "The following test must be performed to determine if a legacy MBR is
   valid:
   * The Signature must be 0xaa55.
   * A Partition Record that contains an OSType value of zero or a
     SizeInLBA value of zero may be ignored."

For now, "may be ignored" seems to be enough of protection against trouble.


An alternative to --mbr-force-bootable could be to offer a 16-byte file
for download together with the instructions to patch it into a pure and
specs conformant ISO with GPT. Of course, only if a 10 year old laptop
refuses to recognize the original ISO on USB stick.

The bytes would have to be

  { 128, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0 }

Assumed the file is named "dummy_mbr_part2.img" the patch instruction
would be

   dd if=dummy_mbr_part2.img of=boot-grub2-f36.iso \
      conv=notrunc bs=1 seek=462 count=16

-------------------------------------------------------------------------

Ubuntu is testing this for you since about a year. :))

Afaik the first official ISO of this layout was
  ubuntu-21.04-desktop-amd64.iso
and they did _not_ revoke it half a year later with
  ubuntu-21.10-desktop-amd64.iso

  $ xorriso -indev ubuntu-21.10-desktop-amd64.iso -report_system_area plain
  ...
  Volume id    : 'Ubuntu 21.10 amd64'
  System area options: 0x00004201
  System area summary: MBR protective-msdos-label grub2-mbr cyl-align-off GPT
  ISO image size/512 : 6086880
  Partition offset   : 16
  MBR heads per cyl  : 0
  MBR secs per head  : 0
  MBR partition table:   N Status  Type        Start       Blocks
  MBR partition      :   1   0x00  0xee            1      6086879
  MBR partition      :   2   0x80  0x00            0            1
  GPT                :   N  Info
  ...

  $ /sbin/fdisk -l ubuntu-21.10-desktop-amd64.iso

  Disk ubuntu-21.10-desktop-amd64.iso: 2.9 GiB, 3116482560 bytes, 6086880 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: gpt
  Disk identifier: EF83665C-2F29-48D6-8C3F-80F5A69CFEB7

  Device                            Start     End Sectors  Size Type
  ubuntu-21.10-desktop-amd64.iso1      64 6077751 6077688  2.9G Microsoft basic da
  ubuntu-21.10-desktop-amd64.iso2 6077752 6086215    8464  4.1M EFI System
  ubuntu-21.10-desktop-amd64.iso3 6086216 6086815     600  300K Microsoft basic da

-------------------------------------------------------------------------

Whatever, we do not yet know for sure whether the boot failure with the
Dell XPS 15 L502X is caused by the lack of a boot/active flag.

We also don't know yet whether the failure with "CD-R and an HP Compaq 8510w"
that was reported by Brandon Nielsen is due to drive-media problems with
the CD-R or due to problems with the ISO.


Have a nice day :)

Thomas
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux