bug-xorriso
[Top][All Lists]
Advanced

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

Re: [Bug-xorriso] Mountable ISO and GRUB2


From: Thomas Schmitt
Subject: Re: [Bug-xorriso] Mountable ISO and GRUB2
Date: Sat, 24 Dec 2016 13:21:11 +0100

Hi,

Carlo Caione wrote:
> The output MBR is exactly what we were
> looking for but IIUC this only creates a Legacy Master Boot Record
> (UEFI compliant) mapping the UEFI System Partition but basically it is
> not creating the GPT at all.

Yes. UEFI 2.4:
"5.2 LBA 0 Format
 LBA 0 (i.e. the first logical block) of the hard disk contains either
 * a legacy Master Boot Record (MBR) (see Section 5.2.1)
 * or a protective MBR (see Section 5.2.2).
"

Vladimir's layout follows section 5.2.2i (which in the document then is
labeled "5.2.3"), "mbr_only" follows 5.2.1 (and the real paragraph 5.2.2).


> In the Ubuntu and Fedora cases (for example) I clearly see that the
> ISO image contains the GPT

According to UEFI specs, this GPT is not recognizable by UEFI compliant
software.
"5.2.3 Protective MBR
 A Protective MBR may be located at LBA 0 (i.e. the first logical block)
 of the disk if it is using the GPT disk layout.
 ...
 Table 15.
 ...
 Partition Record  Array of four MBR partition records. Contains:
                   * one partition record as defined Table 16; and
                   * three partition records each set to zero.
 ...
 Table 16. Protective MBR Partition Record protecting the entire disk
 ...
 StartingLBA [...] Set to 0x00000001 (i.e., the LBA of the GPT Partition
                   Header).
 SizeInLBA [...]   Set to the size of the disk minus one.
"

So the mjg MBR is not "Protective", thus the magic number for GPT is
missing, and thus the GPT is just noise.


On the other hand there is the thread
  http://www.syslinux.org/archives/2016-December/025452.html
where Pascal and Ady show evidence that EFI VM firmware from
  https://www.kraxel.org/repos/jenkins/edk2/
indeed interprets the EL Torito catalog on hard disk (!) where it finds
a hard-disk-emulation image for BIOS which contains an MBR, a partition
table and an EFI System Partition.
This firmware then boots into the virtual hard disk and starts the
appropriate /EFI/BOOT/BOOT*.EFI file in the EFI partition.
Absolutely weird.


> https://mjg59.dreamwidth.org/11285.html
> "Why have a GPT at all?"

He was fighting with particular Macs if i get this blog series correctly.
I am not sure whether the GPT was still necessary after he added APM
partition entries to mark EFI System Partition and HFS+ filesystem.

OpenSUSE lives happily without GPT.


> what if we want also to have the GPT in our ISO image?
> (with at least ESP and one GPT partition mapping the whole image)

Well, we could try to achieve a variation of Vladimir's layout which
appends the ESP after the ISO, has -partition_offset 16, and marks
the ISO and the ESP by disjoint GPT partitions.
The partition offset is necessary because a GPT partition cannot start
at block 0.
(Our mileage may vary when we try to compose it by existing xorriso
 versions.)

But as stated previously, GPT has the disadvantage of its backup table
at the end of the _device_. So after copying the image onto an USB stick
one would actually have to start a partition editor and move that backup GPT
to the real end of the device.


Have a nice day :)

Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]