Comment 52 for bug 1922342

Revision history for this message
Thomas Schmitt (scdbackup) wrote : Re: HIrsute live session takes ages to boot on BIOS systems

Hi,

Lucap wrote:
> gnome disks no longer says it's a GPT layout and
> says the first partition is Linux (Bootable)(0x83)

José Marinho wrote:
> in this last experiment I see with Gnome disks that the usb drive with
> the modified iso has a MBR partition table instead the GPT partition table
> of the original ISO.

Aargh. My fault. I forgot that the original GPT layout of modern Ubuntu
ISOs needs a newer xorriso for automatic boot equipment replay.
I now repeated my proposal in comment #39 with xorriso-1.5.2 and indeed
you are right. The -boot_image replay command did not correctly recognize
the new Ubuntu ISO layout.

So we have to retract the diagnosis that grub_platform in grub.cfg is
to blame, until one of you can repack an ISO to GPT.

In my tests with current upstream release xorriso-1.5.4 it worked fine.
But the packaging for xorriso-1.5.4 is sitting in Debian's salsa git and
waits for the end of Debian 11 release freeze.

There are two ways to work around:

--------------------------------------------------------------------------
1st way:

Build the current GNU xorriso from source. Do not install it, but rather
use it from where it was built. This keeps it from confusing Ubuntu's
package management.

You need the compiler equipment of meta-package "build-essential".

Download the tarball to a new directory:

  cd "$HOME"
  mkdir xorriso_dir
  cd xorriso_dir
  wget https://ftp.gnu.org/gnu/xorriso/xorriso-1.5.4.pl02.tar.gz

(Mistrusting people also download xorriso-1.5.4.pl02.tar.gz.sig and let
gpg --verify that both match.)

Build it according to its README file:

  tar xzf xorriso-1.5.4.pl02.tar.gz
  cd xorriso-1.5.4
  ./configure --prefix=/usr
  make

Expect a storm of messages from ./configure and "make".
Success is when "make" ends and a run of

  ./xorriso/xorriso

can say
  GNU xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.

  usage : xorriso-1.5.4 [commands]
          More is told by command -help

Use this resulting xorriso binary by its absolute path

  "$HOME"/xorriso_dir/xorriso-1.5.4/xorriso/xorriso \
          -indev "$ORIG" \
          -outdev "$NEW" \
          -map ./grub.cfg /boot/grub/grub.cfg \
          -boot_image any replay

You may later safely remove the tree "$HOME"/xorriso_dir to get rid of
the GNU xorriso construction site.

--------------------------------------------------------------------------
2nd way:

xorriso-1.5.2 is well able to repack the ISO to GPT. (After all it did
pack up the original ISO.)
It just needs the correct list of boot related commands, as analyzed by
xorriso-1.5.4 and told by its command -report_system_area "cmd".

The bad news is that this command list is long and that i need to see
the exact "$ORIG" ISO in order to let xorriso-1.5.4 tell the exact
arguments.

With "$ORIG" = ubuntu-21.04-desktop-amd64.iso which has
MD5 736a9acaf195063600a6e1876d48a263 it would be:

  xorriso \
    -indev "$ORIG" \
    -outdev "$NEW" \
    -map ./grub.cfg /boot/grub/grub.cfg \
    \
    -volid 'Ubuntu 21.04 amd64' \
    -volume_date uuid '2021042011161600' \
    -boot_image grub grub2_mbr=--interval:imported_iso:0s-15s:zero_mbrpt,zero_gpt:'ubuntu-21.04-desktop-amd64.iso' \
    -boot_image any partition_table=on \
    -boot_image any partition_cyl_align=off \
    -boot_image any partition_offset=16 \
    -boot_image any mbr_force_bootable=on \
    -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b --interval:imported_iso:5494644d-5504683d::'ubuntu-21.04-desktop-amd64.iso' \
    -boot_image any appended_part_as=gpt \
    -boot_image any iso_mbr_part_type=a2a0d0ebe5b9334487c068b6b72699c7 \
    -boot_image any cat_path='/boot.catalog' \
    -boot_image grub bin_path='/boot/grub/i386-pc/eltorito.img' \
    -boot_image any platform_id=0x00 \
    -boot_image any emul_type=no_emulation \
    -boot_image any load_size=2048 \
    -boot_image any boot_info_table=on \
    -boot_image grub grub2_boot_info=on \
    -boot_image any next \
    -boot_image any efi_path='--interval:appended_partition_2_start_1373661s_size_10040d:all::' \
    -boot_image any platform_id=0xef \
    -boot_image any emul_type=no_emulation \
    -boot_image any load_size=5140480

This yields with xorriso-1.5.2 what xorriso-1.5.4 can replay on its own.

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

In both cases, xorriso -report_system_area "plain" should report this
layout of MBR and GPT.

  MBR partition table: N Status Type Start Blocks
  MBR partition : 1 0x00 0xee 1 5503967
  MBR partition : 2 0x80 0x00 0 1
  GPT : N Info
  GPT disk GUID : 3000c6ade0e5ab4c8f79bd4e1e7794e7
  GPT entry array : 2 248 separated
  GPT lba range : 64 5503712 5503775
  GPT partition name : 1 490053004f003900360036003000
  GPT partname local : 1 ISO9660
  GPT partition GUID : 1 3000c6ade0e5ab4c8f78bd4e1e7794e7
  GPT type GUID : 1 a2a0d0ebe5b9334487c068b6b72699c7
  GPT partition flags: 1 0x1000000000000001
  GPT start and size : 1 64 5493608
  GPT partition name : 2 41007000700065006e006400650064003200
  GPT partname local : 2 Appended2
  GPT partition GUID : 2 3000c6ade0e5ab4c8f7bbd4e1e7794e7
  GPT type GUID : 2 28732ac11ff8d211ba4b00a0c93ec93b
  GPT partition flags: 2 0x0000000000000000
  GPT start and size : 2 5493672 10040

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

For now i refrain from proposing a 3rd way, which would be direct editing
of grub.cfg inside the ISO image without unpacking and repacking.

xorriso can tell an adventurous user where the file is

  xorriso -indev "$ORIG" -find /boot/grub/grub.cfg -exec report_lba --

This reports for ubuntu-21.04-desktop-amd64.iso

  Report layout: xt , Startlba , Blocks , Filesize , ISO image path
  File data lba: 0 , 1853 , 1 , 861 , '/boot/grub/grub.cfg'

I.e the file content starts at byte 1853 * 2048 of the ISO and is 861
bytes large. You may change these 861 bytes but cannot change the size.
So one would replace the characters in the lines of interest by e.g.
newline characters.

(As child i saw a veterinarian checking a cow's bowels by putting his
full arm length into her backdoor. Nowadays we can do this at the keyboard.)

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

Have a nice day :)

Thomas