From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas Schmitt" Subject: Re: ISO installer image: GPT versus MBR partitions Date: Thu, 18 Apr 2019 23:28:13 +0200 Message-ID: <24136673038545504835@scdbackup.webframe.org> References: <6878673033215549429@scdbackup.webframe.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:35199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHEXp-00077A-0d for guix-devel@gnu.org; Thu, 18 Apr 2019 17:26:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHEXn-0007Ro-P7 for guix-devel@gnu.org; Thu, 18 Apr 2019 17:26:09 -0400 In-Reply-To: <6878673033215549429@scdbackup.webframe.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: bug-xorriso@gnu.org Cc: guix-devel@gnu.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.9= xD =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D # Layout of isohybrid --uefi. Invented by Matthew J. Garrett for Fedora. # The EFI partition is a file inside the ISO. The BIOS equipment is ISOLIN= UX # 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 fir= st # stages of ISOLINUX are extracted. The rest would not fit Guix anyways. ISOHYBRID_ISO=3Ddebian-live-9.8.0-amd64-xfce.iso ISOLINUX_BIN_ISO=3D/isolinux/isolinux.bin EXTRACTED_ISOLINUX_BIN=3Disolinux.bin EXTRACTED_MBR_IMG=3Disohybrid_mbr.img # Guix ISO related names BASE_ISO=3Dguixsd-install-0.16.0.x86_64-linux.iso MOUNT_POINT=3D/mnt/iso REPACKED_ISO=3Dguix-0.16.0.x86_64-mjg.iso PRIV_CMD=3Dsudo # Extract the ISOLINUX isohybrid MBR x86 code part from the Debian ISO dd if=3D"$ISOHYBRID_ISO" bs=3D1 count=3D446 of=3D"$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=3D"$EXTRACTED_MBR_IMG" \ -boot_image any mbr_force_bootable=3Don \ -boot_image any partition_offset=3D0 \ \ -boot_image any cat_path=3D'/isolinux/boot.cat' \ -boot_image isolinux bin_path=3D'/isolinux/isolinux.bin' \ -boot_image any emul_type=3Dno_emulation \ -boot_image any load_size=3D2048 \ -boot_image any boot_info_table=3Don \ \ -boot_image any next \ \ -boot_image any efi_path=3D/efi.img \ -boot_image any emul_type=3Dno_emulation \ -boot_image isolinux partition_entry=3Dgpt_basdat #Clean up disk rm "$EXTRACTED_MBR_IMG" "$EXTRACTED_ISOLINUX_BIN" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D 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