bug-xorriso
[Top][All Lists]
Advanced

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

Re: Help Creating Linux ISO


From: Thomas Schmitt
Subject: Re: Help Creating Linux ISO
Date: Tue, 13 Oct 2020 12:04:28 +0200

Hi,

> The only difference i see is that the rhel iso is not overlapping.

This is normally not an issue, especially because the GPT is not validly
announced by a Protective MBR.

I googled for rhel-server-7.6-x86_64-dvd.iso and had to learn that
Redhat does not hand it out to everybody.
So i downloaded
  
https://archive.org/download/rhel-server-7.6-x86_64-dvd/rhel-server-7.6-x86_64-dvd.iso
in the hope that it is the original. (wget needed 2.5 hours, ewww.)

The downloaded file yields:
  MD5    7f0eb16e287e732af4046359184cf6f7
  SHA256 60a0be5aeed1f08f2bb7599a578c89ec134b4016cd62a8604b29f15d543a469c
Please verify that i got an the same ISO as you.

At least it has this peculiar property of its (still invalid) GPT that
the partitions are separated:

  GPT entry array    :      2  128  separated
  ...
  GPT start and size :   1  0  393949
  ...
  GPT start and size :   2  860440  17420

It is unclear to me how GPT partition entry 1 got its low size number.
But this low number brings both partitions apart (as it should be in a
valid GPT).


> What can i do to fix the overlapping issue?

The overlapping is part of Matthew J. Garrett's UEFI isohybrid layout
for Fedora 17:
  https://mjg59.dreamwidth.org/11285.html
He did it in program isohybrid. xorriso does it by options -isohybrid-mbr
for the MBR template and -isohybrid-gpt-basdat for the EFI boot image.

You could try what more and more distros do: Abandon the invalid GPT in
favor of an appended partition marked in a MBR partition table or a valid
GPT without partition nesting or overlapping.

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

For MBR partition table:

  # some names (adapt them to future needs)
  original=rhel-server-7.6-x86_64-dvd.iso
  mbr=rhel-server-7.6-x86_64-dvd.mbr.img
  efi=rhel-server-7.6-x86_64-dvd.efi.img

  # extract MBR template from original
  dd if="$original" of="$mbr" bs=512 count=1

  # extract EFI partition image file from original
  # (this is an alternative to mounting the ISO and copying the file out)
  xorriso -indev "$original" -osirrox on -extract /images/efiboot.img "$efi"

  # build the ISO
  xorriso as mkisofs \
    -o csg-3.0.0.0_RC16.0.0.MMSBR-x86_64-HYBRID.iso \
    -volid "CSG 3.0.0.0 RHEL-7.6 x86_64" \
    -isohybrid-mbr "$mbr" \
    -append_partition 2 0xef "$efi" \
    -c isolinux/boot.cat \
    -b isolinux/isolinux.bin \
      -no-emul-boot -boot-load-size 4 -boot-info-table \
    -eltorito-alt-boot \
    -e --interval:appended_partition_2:all:: \
      -no-emul-boot \
    "target/archive/dvd"

The result should be reported like

  Boot record  : El Torito , MBR isohybrid cyl-align-off
  Media summary: 1 session, 2196180 data blocks, 4289m data, .... free
  Volume id    : 'CSG 3.0.0.0 RHEL-7.6 x86_64'
  El Torito catalog  : 450  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         451
  El Torito boot img :   2  UEFI  y   none  0x0000  0x00  17420     2196180
  El Torito img path :   1  /isolinux/isolinux.bin
  El Torito img opts :   1  boot-info-table isohybrid-suitable
  El Torito img blks :   2  4355
  System area options: 0x00000202
  System area summary: MBR isohybrid cyl-align-off
  ISO image size/512 : 8784720
  Partition offset   : 0
  MBR heads per cyl  : 0
  MBR secs per head  : 0
  MBR partition table:   N Status  Type        Start       Blocks
  MBR partition      :   1   0x80  0x17            0      8784720
  MBR partition      :   2   0x00  0xef      8784720        17420

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

For a valid GPT without overlapping partitions add to above "build the ISO"
run the option

    -appended_part_as_gpt \

With valid GPT i also advise option -no-pad to supress the production of
partition entry 3 for the end padding against the Linux TAO CD Read-Ahead
bug.

A didactically good place is between "-append_partition" and "-c".
    ...
    -append_partition 2 0xef "$efi" \
    -appended_part_as_gpt \
    -no-pad \
    -c isolinux/boot.cat \
    ...

The result should look like

  Boot record  : El Torito , MBR isohybrid cyl-align-off GPT
  Media summary: 1 session, 2195124 data blocks, 4287m data, ....g free
  Volume id    : 'CSG 3.0.0.0 RHEL-7.6 x86_64'
  El Torito catalog  : 450  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         451
  El Torito boot img :   2  UEFI  y   none  0x0000  0x00  17420     2195124
  El Torito img path :   1  /isolinux/isolinux.bin
  El Torito img opts :   1  boot-info-table isohybrid-suitable
  El Torito img blks :   2  4355
  System area options: 0x00000203
  System area summary: MBR isohybrid cyl-align-off GPT
  ISO image size/512 : 8780496
  Partition offset   : 0
  MBR heads per cyl  : 0
  MBR secs per head  : 0
  MBR partition table:   N Status  Type        Start       Blocks
  MBR partition      :   1   0x00  0xee            1      8797979
  GPT                :   N  Info
  GPT disk GUID      :      f88cb3c0a535fd448945189d71a799dd
  GPT entry array    :      2  248  separated
  GPT lba range      :      64  8797916  8797979
  GPT partition name :   1  4700610070003000
  GPT partname local :   1  Gap0
  GPT partition GUID :   1  f88cb3c0a535fd448944189d71a799dd
  GPT type GUID      :   1  a2a0d0ebe5b9334487c068b6b72699c7
  GPT partition flags:   1  0x1000000000000001
  GPT start and size :   1  64  8780432
  GPT partition name :   2  41007000700065006e006400650064003200
  GPT partname local :   2  Appended2
  GPT partition GUID :   2  f88cb3c0a535fd448947189d71a799dd
  GPT type GUID      :   2  28732ac11ff8d211ba4b00a0c93ec93b
  GPT partition flags:   2  0x0000000000000000
  GPT start and size :   2  8780496  17420

(Note "GPT entry array    :      2  248  separated")

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

If one of these ISOs works for you, consider to add option

  -partition_offset 16

in order to let the ISO filesystem for DVD and USB stick base device claim
the full size of the ISO image file, and in order to get a mountable GPT
partition 1 (if GPT is present).

Without -partition_offset 16, the ISO filesystem claims only the blocks up
to the start of the EFI partition. This means that programs like
  /sbin/isosize
will not tell the original size of the image file.
Further the ISO filesystem starts at block 0, whereas the start of a GPT
partition cannot be 0.
With -partition_offset 16 the ISO gets a second superblock at the start of
partition 1 and a second directory tree which bears block addresses suitable
for use in partition 1. Data file content is shared between both trees.


Have a nice day :)

Thomas




reply via email to

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