unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Thomas Schmitt" <scdbackup@gmx.net>
To: bug-xorriso@gnu.org
Cc: guix-devel@gnu.org
Subject: Re: ISO installer image: GPT versus MBR partitions
Date: Thu, 18 Apr 2019 23:28:13 +0200	[thread overview]
Message-ID: <24136673038545504835@scdbackup.webframe.org> (raw)
In-Reply-To: <6878673033215549429@scdbackup.webframe.org>

Hi,

this is the xorriso run for producing a layout like "isohybrid --uefi"
with GRUB equipment for BIOS instead of ISOLINUX.

I prepended command -stdio_sync "off" in order to make use of my generous
amount of RAM for write buffering. The default syncs to disk every 16 MiB.
Good with low RAM or fast SSD.

xorriso treats its output as an optical drive.
Without sync, the speed reports on image files are rather funny:
  xorriso : UPDATE : Writing:   262432s  43.6%  fifo 88%  buf  50%  1169.9xD

===========================================================================

# Layout of isohybrid --uefi. Invented by Matthew J. Garrett for Fedora.
# The EFI partition is a file inside the ISO. The BIOS equipment is ISOLINUX
# instead of GRUB. But the EFI equipment is GRUB.
# Used by Fedora, Debian, Ubuntu, Mint, Arch, and more.
# (SuSE is different by using a pure MBR partition table.)

# Additionally to a Guix ISO, we need one of those isohybrid ISOs.
# The result will not be usable for booting via BIOS, because only the first
# stages of ISOLINUX are extracted. The rest would not fit Guix anyways.
ISOHYBRID_ISO=debian-live-9.8.0-amd64-xfce.iso
ISOLINUX_BIN_ISO=/isolinux/isolinux.bin
EXTRACTED_ISOLINUX_BIN=isolinux.bin
EXTRACTED_MBR_IMG=isohybrid_mbr.img

# Guix ISO related names
BASE_ISO=guixsd-install-0.16.0.x86_64-linux.iso
MOUNT_POINT=/mnt/iso
REPACKED_ISO=guix-0.16.0.x86_64-mjg.iso

PRIV_CMD=sudo

# Extract the ISOLINUX isohybrid MBR x86 code part from the Debian ISO
dd if="$ISOHYBRID_ISO" bs=1 count=446 of="$EXTRACTED_MBR_IMG"

# Extract the ISOLINUX boot image for El Torito
xorriso \
  -report_about warning \
  -osirrox on \
  -indev "$ISOHYBRID_ISO" \
  -report_about note \
  -extract "$ISOLINUX_BIN_ISO" "$EXTRACTED_ISOLINUX_BIN"

# The mounted original ISO will donate all its files to the repacked one
$PRIV_CMD mount -o loop "$BASE_ISO" "$MOUNT_POINT"

# Pack it all up
xorriso \
   -stdio_sync off \
   -outdev "$REPACKED_ISO" \
   -volid 'GUIXSD_IMAGE' \
   \
   -map "$MOUNT_POINT" "/" \
   -map "$EXTRACTED_ISOLINUX_BIN" /isolinux/isolinux.bin \
   \
   -boot_image isolinux system_area="$EXTRACTED_MBR_IMG" \
   -boot_image any mbr_force_bootable=on \
   -boot_image any partition_offset=0 \
   \
   -boot_image any cat_path='/isolinux/boot.cat' \
   -boot_image isolinux bin_path='/isolinux/isolinux.bin'  \
   -boot_image any emul_type=no_emulation \
   -boot_image any load_size=2048 \
   -boot_image any boot_info_table=on \
   \
   -boot_image any next \
   \
   -boot_image any efi_path=/efi.img \
   -boot_image any emul_type=no_emulation \
   -boot_image isolinux partition_entry=gpt_basdat

#Clean up disk
rm "$EXTRACTED_MBR_IMG" "$EXTRACTED_ISOLINUX_BIN"

===========================================================================

Expected inspection result:

  $ xorriso -indev "$REPACKED_ISO" -report_system_area plain
  ...
  Volume id    : 'GUIXSD_IMAGE'
  System area options: 0x00000102
  System area summary: MBR isohybrid cyl-align-on GPT
  ISO image size/512 : 2405888
  Partition offset   : 0
  MBR heads per cyl  : 74
  MBR secs per head  : 32
  MBR partition table:   N Status  Type        Start       Blocks
  MBR partition      :   1   0x80  0x00            0      2405888
  MBR partition      :   2   0x00  0xef        35132         2880
  MBR partition path :   2  /efi.img
  GPT                :   N  Info
  GPT disk GUID      :      451fe71ed0ff5d48a1c144a0316dd901
  GPT entry array    :      2  248  overlapping
  GPT lba range      :      64  2405824  2405887
  GPT partition name :   1  490053004f00480079006200720069006400
  GPT partname local :   1  ISOHybrid
  GPT partition GUID :   1  451fe71ed0ff5d48a1c044a0316dd901
  GPT type GUID      :   1  a2a0d0ebe5b9334487c068b6b72699c7
  GPT partition flags:   1  0x1000000000000001
  GPT start and size :   1  0  2405824
  GPT partition name :   2  490053004f004800790062007200690064003100
  GPT partname local :   2  ISOHybrid1
  GPT partition GUID :   2  451fe71ed0ff5d48a1c344a0316dd901
  GPT type GUID      :   2  a2a0d0ebe5b9334487c068b6b72699c7
  GPT partition flags:   2  0x1000000000000001
  GPT start and size :   2  35132  2880
  GPT partition path :   2  /efi.img

For comparison, the output with debian-live-9.8.0-amd64-xfce.iso :

  Volume id    : 'd-live 9.8.0 xf amd64'
  System area options: 0x00000102
  System area summary: MBR isohybrid cyl-align-on GPT
  ISO image size/512 : 3811392
  Partition offset   : 0
  MBR heads per cyl  : 117
  MBR secs per head  : 32
  MBR partition table:   N Status  Type        Start       Blocks
  MBR partition      :   1   0x80  0x00            0      3811392
  MBR partition      :   2   0x00  0xef         1432          832
  MBR partition path :   2  /boot/grub/efi.img
  GPT                :   N  Info
  GPT disk GUID      :      f2925bc0164b9245ba53a2025e420b60
  GPT entry array    :      2  248  overlapping
  GPT lba range      :      64  3811328  3811391
  GPT partition name :   1  490053004f00480079006200720069006400
  GPT partname local :   1  ISOHybrid
  GPT partition GUID :   1  f2925bc0164b9245ba52a2025e420b60
  GPT type GUID      :   1  a2a0d0ebe5b9334487c068b6b72699c7
  GPT partition flags:   1  0x1000000000000001
  GPT start and size :   1  0  3811328
  GPT partition name :   2  490053004f004800790062007200690064003100
  GPT partname local :   2  ISOHybrid1
  GPT partition GUID :   2  f2925bc0164b9245ba51a2025e420b60
  GPT type GUID      :   2  a2a0d0ebe5b9334487c068b6b72699c7
  GPT partition flags:   2  0x1000000000000001
  GPT start and size :   2  1432  832
  GPT partition path :   2  /boot/grub/efi.img


Have a nice day :)

Thomas

  reply	other threads:[~2019-04-18 21:26 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190415165451.dpzngealeisbibc7@pelzflorian.localdomain>
     [not found] ` <1582867226375139246@scdbackup.webframe.org>
2019-04-16  9:57   ` bug#33639: ISO installer image is broken on i686 Gábor Boskovits
2019-04-16 13:40     ` ISO installer image: GPT versus MBR partitions (was bug#33639) Thomas Schmitt
2019-04-16 16:32       ` pelzflorian (Florian Pelz)
2019-04-16 17:57         ` ISO installer image: GPT versus MBR partitions Thomas Schmitt
2019-04-16 19:55           ` pelzflorian (Florian Pelz)
2019-04-16 20:31             ` pelzflorian (Florian Pelz)
2019-04-16 21:15               ` Thomas Schmitt
2019-04-17  8:59                 ` pelzflorian (Florian Pelz)
2019-04-17 10:23                   ` Thomas Schmitt
2019-04-17 10:30                     ` pelzflorian (Florian Pelz)
2019-04-17 15:51                     ` Thomas Schmitt
2019-04-17 22:35                       ` pelzflorian (Florian Pelz)
2019-04-18  6:32                         ` Thomas Schmitt
2019-04-18  7:00                           ` Thomas Schmitt
2019-04-18  7:07                             ` pelzflorian (Florian Pelz)
2019-04-18  8:13                               ` Thomas Schmitt
2019-04-18 12:19                                 ` pelzflorian (Florian Pelz)
2019-04-18 13:50                                   ` Thomas Schmitt
2019-04-18 21:28                                     ` Thomas Schmitt [this message]
2019-04-19  7:29                                       ` pelzflorian (Florian Pelz)
2019-04-19  8:03                                     ` pelzflorian (Florian Pelz)
2019-04-19  9:01                                       ` Thomas Schmitt
2019-04-19  9:39                                         ` pelzflorian (Florian Pelz)
2019-04-19 10:58                                           ` Thomas Schmitt
2019-04-19 14:57                                             ` pelzflorian (Florian Pelz)
2019-04-19 11:30                                         ` pelzflorian (Florian Pelz)
2019-04-19 18:33                                           ` pelzflorian (Florian Pelz)
2019-04-19 19:23                                             ` Thomas Schmitt
2019-04-20 10:26                                               ` pelzflorian (Florian Pelz)
2019-04-20 10:50                                                 ` Thomas Schmitt
2019-04-20 11:16                                                   ` Thomas Schmitt
2019-04-20 11:29                                                     ` Thomas Schmitt
2019-04-20 14:23                                                       ` Thomas Schmitt
2019-04-20 14:54                                                         ` pelzflorian (Florian Pelz)
2019-04-20 15:17                                                           ` pelzflorian (Florian Pelz)
2019-04-20 15:33                                                           ` pelzflorian (Florian Pelz)
2019-04-20 16:32                                                             ` Thomas Schmitt
2019-04-21  7:58                                                               ` pelzflorian (Florian Pelz)
2019-04-21  9:35                                                                 ` Thomas Schmitt
2019-04-21 11:10                                                                   ` pelzflorian (Florian Pelz)
2019-04-21 11:16                                                                 ` Thomas Schmitt
2019-04-21 11:56                                                                   ` pelzflorian (Florian Pelz)
2019-04-21 12:27                                                                     ` Thomas Schmitt
2019-04-21 14:11                                                                       ` pelzflorian (Florian Pelz)
2019-04-21 14:36                                                                         ` Thomas Schmitt
2019-04-22 13:11                                                                           ` Thomas Schmitt
2019-04-23 16:40                                                                       ` pelzflorian (Florian Pelz)
2019-04-23 17:23                                                                         ` Thomas Schmitt
2019-04-17 12:24               ` Ludovic Courtès
2019-04-17 13:42                 ` pelzflorian (Florian Pelz)
2019-04-23 18:14       ` Thomas Schmitt
2019-04-23 19:50         ` pelzflorian (Florian Pelz)
2019-04-23 20:18           ` Thomas Schmitt
2019-04-23 21:43             ` pelzflorian (Florian Pelz)
2019-04-24  6:56               ` Thomas Schmitt
2019-04-24  9:13                 ` pelzflorian (Florian Pelz)
2019-04-24 10:34                   ` Thomas Schmitt
2019-04-24 22:13                     ` Danny Milosavljevic
2019-04-25  7:07                       ` Thomas Schmitt
2019-04-25  9:45                       ` pelzflorian (Florian Pelz)
2019-04-25 13:44                         ` Thomas Schmitt
2019-04-25 14:59                           ` Danny Milosavljevic
2019-04-25 16:22                             ` Thomas Schmitt
2019-04-25 17:55                               ` Danny Milosavljevic
2019-04-25 18:46                                 ` Thomas Schmitt
2019-04-25 19:01                                   ` Danny Milosavljevic
2019-04-25 16:34                         ` Ludovic Courtès
2019-04-26 11:34                           ` pelzflorian (Florian Pelz)
2019-04-26 14:41                             ` Ludovic Courtès
2019-04-26 15:30                               ` pelzflorian (Florian Pelz)
2019-04-26 13:57                           ` Thomas Schmitt
2019-04-27 13:20                             ` Ludovic Courtès
2019-04-27 16:24                               ` Thomas Schmitt
2019-04-28 12:53                                 ` Ludovic Courtès
2019-04-25 11:49                   ` pelzflorian (Florian Pelz)
2019-04-25 15:09                     ` Thomas Schmitt
2019-04-25 15:58                       ` pelzflorian (Florian Pelz)
2019-04-25 16:40                         ` Thomas Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24136673038545504835@scdbackup.webframe.org \
    --to=scdbackup@gmx.net \
    --cc=bug-xorriso@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).