Thomas Schmitt 2020-07-07 14:22:02 +00:00
parent 43dc929445
commit 3987594df6

406
ReportSystemArea.md Normal file

@ -0,0 +1,406 @@
xorriso commands `-report_system_area` and `-report_el_torito` forward
boot information which libisofs obtains when loading an ISO image.
This information directs the boot firmware of various computer hardware
to the initial programs of boot loaders.
For example from `archlinux-2013.11.01-dual.iso`
```
System area options: 0x00000102
System area summary: MBR isohybrid cyl-align-on GPT
ISO image size/512 : 1056768
Partition offset : 0
MBR heads per cyl : 64
MBR secs per head : 32
MBR partition table: N Status Type Start Blocks
MBR partition : 1 0x80 0x00 0 1056768
MBR partition : 2 0x00 0xef 84432 63488
MBR partition path : 2 /EFI/archiso/efiboot.img
GPT : N Info
GPT disk GUID : d04d2f9e3a4e314f9764b381e526f4ce
GPT entry array : 2 248 overlapping
GPT lba range : 64 1056704 1056767
GPT partition name : 1 490053004f00480079006200720069006400
GPT partname local : 1 ISOHybrid
GPT partition GUID : 1 d04d2f9e3a4e314f9766b381e526f4ce
GPT type GUID : 1 a2a0d0ebe5b9334487c068b6b72699c7
GPT partition flags: 1 0x1000000000000001
GPT start and size : 1 0 1056704
GPT partition name : 2 490053004f004800790062007200690064003100
GPT partname local : 2 ISOHybrid1
GPT partition GUID : 2 d04d2f9e3a4e314f9767b381e526f4ce
GPT partition flags: 2 0x1000000000000001
GPT start and size : 2 84432 63488
GPT partition path : 2 /EFI/archiso/efiboot.img
El Torito catalog : 42 1
El Torito cat path : /isolinux/boot.cat
El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA
El Torito boot img : 1 BIOS y none 0x0000 0x00 4 20078
El Torito boot img : 2 UEFI y none 0x0000 0x00 63488 21108
El Torito img opts : 1 boot-info-table isohybrid-suitable
El Torito img path : 1 /isolinux/isolinux.bin
El Torito img path : 2 /EFI/archiso/efiboot.img
```
The output format is described by `-report_system_area help` and
`-report_el_torito help`,
or by the help texts of `iso_image_report_system_area()` and
`iso_image_report_el_torito()`:
```
------------------------------------------------------------------------------
With -report_system_area "plain":
------------------------------------------------------------------------------
Report format for recognized System Area data.
No text will be reported if no System Area was loaded or if it was
entirely filled with 0-bytes.
Else there will be at least these three lines:
System area options: hex
see libisofs.h, parameter of iso_write_opts_set_system_area().
System area summary: word ... word
human readable interpretation of system area options and other info
The words are from the set:
{ MBR, CHRP, PReP, GPT, APM, MIPS-Big-Endian, MIPS-Little-Endian,
SUN-SPARC-Disk-Label, HP-PA-PALO,
protective-msdos-label, isohybrid, grub2-mbr,
cyl-align-{auto,on,off,all}, not-recognized, }
The acronyms indicate boot data for particular hardware/firmware.
protective-msdos-label is an MBR conformant to specs of GPT.
isohybrid is an MBR implementing ISOLINUX isohybrid functionality.
grub2-mbr is an MBR with GRUB2 64 bit address patching.
cyl-align-on indicates that the ISO image MBR partition ends at a
cylinder boundary. cyl-align-all means that more MBR partitions
exist and all end at a cylinder boundary.
not-recognized tells about unrecognized non-zero system area data.
ISO image size/512 : decimal
size of ISO image in block units of 512 bytes.
If an MBR is detected, with at least one partition entry of non-zero size,
then there may be:
Partition offset : decimal
if not 0 then a second ISO 9660 superblock was found to which MBR
partition 1 is pointing.
MBR heads per cyl : decimal
conversion factor between MBR C/H/S address and LBA. 0=inconsistent.
MBR secs per head : decimal
conversion factor between MBR C/H/S address and LBA. 0=inconsistent.
MBR partition table: N Status Type Start Blocks
headline for MBR partition table.
MBR partition : X hex hex decimal decimal
gives partition number, status byte, type byte, start block,
and number of blocks. 512 bytes per block.
MBR partition path : X path
the path of a file in the ISO image which begins at the partition
start block of partition X.
PReP boot partition: decimal decimal
gives start block and size of a PReP boot partition in ISO 9660
block units of 2048 bytes.
GUID Partition Table can coexist with MBR:
GPT : N Info
headline for GPT partition table. The fields are too wide for a
neat table. So they are listed with a partition number and a text.
GPT CRC should be : <hex> to match first 92 GPT header block bytes
GPT CRC found : <hex> matches all 512 bytes of GPT header block
libisofs-1.2.4 to 1.2.8 had a bug with the GPT header CRC. So
libisofs is willing to recognize GPT with the buggy CRC. These
two lines inform that most partition editors will not accept it.
GPT array CRC wrong: should be <hex>, found <hex>
GPT entry arrays are accepted even if their CRC does not match.
In this case, both CRCs are reported by this line.
GPT backup problems: text
reports about inconsistencies between main GPT and backup GPT.
The statements are comma separated:
Implausible header LBA <decimal>
Cannot read header block at 2k LBA <decimal>
Not a GPT 1.0 header of 92 bytes for 128 bytes per entry
Head CRC <hex> wrong. Should be <hex>
Head CRC <hex> wrong. Should be <hex>. Matches all 512 block bytes
Disk GUID differs (<hex_digits>)
Cannot read array block at 2k LBA <decimal>
Array CRC <hex> wrong. Should be <hex>
Entries differ for partitions <decimal> [... <decimal>]
GPT disk GUID : hex_digits
32 hex digits giving the byte string of the disk's GUID
GPT entry array : decimal decimal word
start block of partition entry array and number of entries. 512 bytes
per block. The word may be "separated" if partitions are disjoint,
"overlapping" if they are not. In future there may be "nested"
as special case where all overlapping partitions are superset and
subset, and "covering" as special case of disjoint partitions
covering the whole GPT block range for partitions.
GPT lba range : decimal decimal decimal
addresses of first payload block, last payload block, and of the
GPT backup header block. 512 bytes per block.
GPT partition name : X hex_digits
up to 144 hex digits giving the UTF-16LE name byte string of
partition X. Trailing 16 bit 0-characters are omitted.
GPT partname local : X text
the name of partition X converted to the local character set.
This line may be missing if the name cannot be converted, or is
empty.
GPT partition GUID : X hex_digits
32 hex digits giving the byte string of the GUID of partition X.
GPT type GUID : X hex_digits
32 hex digits giving the byte string of the type GUID of partition X.
GPT partition flags: X hex
64 flag bits of partition X in hex representation.
Known bit meanings are:
bit0 = "System Partition" Do not alter.
bit2 = Legacy BIOS bootable (MBR partition type 0x80)
bit60= read-only
GPT start and size : X decimal decimal
start block and number of blocks of partition X. 512 bytes per block.
GPT partition path : X path
the path of a file in the ISO image which begins at the partition
start block of partition X.
Apple partition map can coexist with MBR and GPT:
APM : N Info
headline for human readers.
APM block size : decimal
block size of Apple Partition Map. 512 or 2048. This applies to
start address and size of all partitions in the APM.
APM gap fillers : decimal
tells the number of partitions with name "Gap[0-9[0-9]]" and type
"ISO9660_data".
APM partition name : X text
the name of partition X. Up to 32 characters.
APM partition type : X text
the type string of partition X. Up to 32 characters.
APM start and size : X decimal decimal
start block and number of blocks of partition X.
APM partition path : X path
the path of a file in the ISO image which begins at the partition
start block of partition X.
If a MIPS Big Endian Volume Header is detected, there may be:
MIPS-BE volume dir : N Name Block Bytes
headline for human readers.
MIPS-BE boot entry : X upto8chr decimal decimal
tells name, 512-byte block address, and byte count of boot entry X.
MIPS-BE boot path : X path
tells the path to the boot image file in the ISO image which belongs
to the block address given by boot entry X.
If a DEC Boot Block for MIPS Little Endian is detected, there may be:
MIPS-LE boot map : LoadAddr ExecAddr SegmentSize SegmentStart
headline for human readers.
MIPS-LE boot params: decimal decimal decimal decimal
tells four numbers which are originally derived from the ELF header
of the boot file. The first two are counted in bytes, the other two
are counted in blocks of 512 bytes.
MIPS-LE boot path : path
tells the path to the boot file in the ISO image which belongs to the
address given by SegmentStart.
MIPS-LE elf offset : decimal
tells the relative 512-byte block offset inside the boot file:
SegmentStart - FileStartBlock
If a SUN SPARC Disk Label is present:
SUN SPARC disklabel: text
tells the disk label text.
SUN SPARC secs/head: decimal
tells the number of sectors per head.
SUN SPARC heads/cyl: decimal
tells the number of heads per cylinder.
SPARC GRUB2 core : decimal decimal
tells byte address and byte count of the GRUB2 SPARC core file.
SPARC GRUB2 path : path
tells the path to the data file in the ISO image which belongs to the
address given by core.
If a HP-PA PALO boot sector version 4 or 5 is present:
PALO header version: decimal
tells the PALO header version: 4 or 5.
HP-PA cmdline : text
tells the command line for the kernels.
HP-PA boot files : ByteAddr ByteSize Path
headline for human readers.
HP-PA 32-bit kernel: decimal decimal path
tells start byte, byte count, and file path of the 32-bit kernel.
HP-PA 64-bit kernel: decimal decimal path
tells the same for the 64-bit kernel.
HP-PA ramdisk : decimal decimal path
tells the same for the ramdisk file.
HP-PA bootloader : decimal decimal path
tells the same for the bootloader file.
------------------------------------------------------------------------------
With -report_el_torito "plain":
------------------------------------------------------------------------------
Report format for recognized El Torito boot information.
No text will be reported if no El Torito information was found.
Else there will be at least these three lines
El Torito catalog : decimal decimal
tells the block address and number of 2048-blocks of the boot catalog.
El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA
is the headline of the boot image list.
El Torito boot img : X word char word hex hex decimal decimal
tells about boot image number X:
- Platform Id: "BIOS", "PPC", "Mac", "UEFI" or a hex number.
- Bootability: either "y" or "n".
- Emulation: "none", "fd1.2", "fd1.4", "fd2.8", "hd"
for no emulation, three floppy MB sizes, hard disk.
- Load Segment: start offset in boot image. 0x0000 means 0x07c0.
- Hard disk emulation partition type: MBR partition type code.
- Load size: number of 512-blocks to load with emulation mode "none".
- LBA: start block number in ISO filesystem (2048-block).
The following lines appear conditionally:
El Torito cat path : iso_rr_path
tells the path to the data file in the ISO image which belongs to
the block address where the boot catalog starts.
(This line is not reported if no path points to that block.)
El Torito img opts : X word ... word
tells the presence of extra features:
"boot-info-table" image got boot info table patching.
"isohybrid-suitable" image is suitable for ISOLINUX isohybrid MBR.
"grub2-boot-info" image got GRUB2 boot info patching.
(This line is not reported if no such options were detected.)
El Torito id string: X hex_digits
tells the id string of the catalog section which hosts boot image X.
(This line is not reported if the id string is all zero.)
El Torito sel crit : X hex_digits
tells the selection criterion of boot image X.
(This line is not reported if the criterion is all zero.)
El Torito img path : X iso_rr_path
tells the path to the data file in the ISO image which belongs to
the block address given by LBA of boot image X.
(This line is not reported if no path points to that block.)
El Torito img blks : X decimal
gives an upper limit of the number of 2048-blocks in the boot image
if it is not accessible via a path in the ISO directory tree.
The boot image is supposed to end before the start block of any
other entity of the ISO filesystem.
(This line is not reported if no limiting entity is found.)
```
Technical details and also some links to background information can be
found in
[doc/boot_sectors.txt](https://dev.lovelyhq.com/libburnia/libisofs/raw/HEAD/doc/boot_sectors.txt)
of libisofs.
---------------------------
Further examples.
`debian-7.3.0-i386-netinst.iso`:
```
System area options: 0x00000102
System area summary: MBR isohybrid cyl-align-on
ISO image size/512 : 567296
Partition offset : 16
MBR heads per cyl : 64
MBR secs per head : 32
MBR partition table: N Status Type Start Blocks
MBR partition : 1 0x80 0x17 64 567232
El Torito catalog : 1658 1
El Torito cat path : /isolinux/boot.cat
El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA
El Torito boot img : 1 BIOS y none 0x0000 0x00 4 16980
El Torito img opts : 1 boot-info-table isohybrid-suitable
El Torito img path : 1 /isolinux/isolinux.bin
```
Debian kFreeBSD `mini.iso`:
```
System area options: 0x00000201
System area summary: MBR protective-msdos-label cyl-align-off
ISO image size/512 : 32016
Partition offset : 0
MBR heads per cyl : 64
MBR secs per head : 32
MBR partition table: N Status Type Start Blocks
MBR partition : 1 0x80 0xcd 1 32015
El Torito catalog : 58 1
El Torito cat path : /boot.catalog
El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA
El Torito boot img : 1 BIOS y none 0x0000 0x00 4 7561
El Torito img opts : 1 boot-info-table
El Torito img path : 1 /boot/grub/i386-pc/eltorito.img
```
`Fedora-LiveCD.iso` (made by a modified `genisoimage`,
treated with `isohybrid.c`, see http://mjg59.dreamwidth.org/11285.html ):
```
System area options: 0x00000102
System area summary: MBR isohybrid cyl-align-on GPT APM
ISO image size/512 : 1329448
Partition offset : 0
MBR heads per cyl : 64
MBR secs per head : 32
MBR partition table: N Status Type Start Blocks
MBR partition : 1 0x80 0x00 0 1331200
MBR partition : 2 0x00 0xef 164 1136
MBR partition : 3 0x00 0x00 1348 2240
MBR partition path : 2 /isolinux/efiboot.img
MBR partition path : 3 /isolinux/macboot.img
GPT : N Info
GPT backup problems: Implausible header LBA 1331198
GPT disk GUID : 7323c87919e6974d95176930c538e299
GPT entry array : 16 128 overlapping
GPT lba range : 48 1331166 1331198
GPT partition name : 1 49534f4879627269642049534f0049534f487962726964004170706c
GPT partition GUID : 1 a187a1ba4d2c2745ae05cfaba6fa87c1
GPT type GUID : 1 a2a0d0ebe5b9334487c068b6b72699c7
GPT partition flags: 1 0x0000000000000000
GPT start and size : 1 0 1329449
GPT partition name : 2 49534f487962726964004170706c65004170706c
GPT partition GUID : 2 c8dec81ffbf051408c8ad2f6b14616dc
GPT type GUID : 2 a2a0d0ebe5b9334487c068b6b72699c7
GPT partition flags: 2 0x0000000000000000
GPT start and size : 2 164 1136
GPT partition path : 2 /isolinux/efiboot.img
GPT partition name : 3 49534f487962726964004170706c65004170706c
GPT partition GUID : 3 c8dec81ffbf051408c8ad2f6b14616dc
GPT type GUID : 3 005346480000aa11aa1100306543ecac
GPT partition flags: 3 0x0000000000000000
GPT start and size : 3 1348 2240
GPT partition path : 3 /isolinux/macboot.img
APM : N Info
APM block size : 2048
APM gap fillers : 0
APM partition name : 1 EFI
APM partition type : 1 Apple_HFS
APM start and size : 1 41 1136
APM partition path : 1 /isolinux/efiboot.img
APM partition name : 2 EFI
APM partition type : 2 Apple_HFS
APM start and size : 2 337 2240
APM partition path : 2 /isolinux/macboot.img
El Torito catalog : 40 1
El Torito cat path : /isolinux/boot.cat
El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA
El Torito boot img : 1 BIOS y none 0x0000 0x00 4 325
El Torito boot img : 2 UEFI y none 0x0000 0x00 1136 41
El Torito boot img : 3 UEFI y none 0x0000 0x00 2240 337
El Torito img opts : 1 boot-info-table isohybrid-suitable
El Torito img path : 1 /isolinux/isolinux.bin
El Torito img path : 2 /isolinux/efiboot.img
El Torito img path : 3 /isolinux/macboot.img
```
`FreeBSD-8.4-BETA1-amd64-livefs.iso` (made by `makefs`):
```
El Torito catalog : 19 1
El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA
El Torito boot img : 1 BIOS y none 0x0000 0x00 4 20
El Torito img blks : 1 4
```
`debian-7.4.0-mips-netinst.iso`:
```
System area options: 0x00000004
System area summary: MIPS-Big-Endian
ISO image size/512 : 422364
MIPS-BE volume dir : N Name Block Bytes
MIPS-BE boot entry : 1 r4k-ip22 63436 10876928
MIPS-BE boot path : 1 /install/r4k-ip22-boot.img
```