From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas Schmitt" Subject: bug#33639: ISO installer image is broken on i686 Date: Mon, 15 Apr 2019 19:55:07 +0200 Message-ID: <1582867226375139246@scdbackup.webframe.org> References: <20190415165451.dpzngealeisbibc7@pelzflorian.localdomain> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:47567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG5o1-0006Xk-W7 for bug-guix@gnu.org; Mon, 15 Apr 2019 13:54:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hG5ny-0005VA-S6 for bug-guix@gnu.org; Mon, 15 Apr 2019 13:54:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hG5nt-0005Tc-Vd for bug-guix@gnu.org; Mon, 15 Apr 2019 13:54:03 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20190415165451.dpzngealeisbibc7@pelzflorian.localdomain> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: bug-xorriso@gnu.org Cc: 33639@debbugs.gnu.org Hi, Florian Pelz wrote: > Well this is strange. I got fine ISO images each time (fine with no > complaints from xorriso or fdisk and bootable in QEMU without errors), > but after dd=E2=80=99ing them to different USB flash drives each time I = get > kernel output when inserting the flash drive: > [ 10.025223] GPT:Primary header thinks Alt. header is not at the end o= f > the disk. The alternative/backup header is a property of GPT which makes it rather unsuitable for disk images. xorriso puts it correctly into the last 512-byte block of the image. But when copied to a storage device, it should move up to the last block of the device. Even worse, the main GPT header at 512-byte LBA 1 needs to learn the new address. So i would rather advise to use a MBR partition table. Wonderfully dumb and open ended. I see from http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/vm.scm#n462 that program grub-mkrescue is in control of xorrisofs boot options. Vladimir Serbinenko decided for GPT with no mountable ISO partition. The libisoburn repo and tarball have a wrapper script by which other boot layouts can be derived from the options which grub-mkrescue hands over to xorrisofs: https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/frontend/grub-m= krescue-sed.sh To get MBR instead of GPT do: export MKRESCUE_SED_MODE=3Dmbr_only export MKRESCUE_SED_PROTECTIVE=3D"" and maybe export MKRESCUE_SED_XORRISO=3D/...path/to/the/xorriso/binary/if/exotic..= . Then start grub-mkrescue with the wrapper in the role of "xorriso": grub-mkrescue --xorriso=3D...path/to/grub-mkrescue-sed.sh \ -partition_offset 16 \ -iso_mbr_part_type 0x83 \ \ ...all.other.usual.arguments... The mode "mbr_only" will move the EFI partition image out of the ISO filesystem and rather append it after the ISO's end. The option -partition_offset 16 costs the space of a second superblock and directory tree. But it brings as benefits: - More normal partition layout with partition 1 starting at block 64 rather than at block 0. - Nevertheless the partition 1 is mountable and shows the ISO content. - The base device is mountable as the the same ISO too. (The ISO superblock of the base device also serves on CD or DVD.) - Th base device superblock claims not only the ISO in partition 1 but also the EFI partition 2. So "/sbin/isosize" will tell the size of the image file, not only of the ISO filesystem. Option -iso_mbr_part_type 0x83 chooses for partition 1 the MBR partitions type "Linux". (This is purely ornamental. Nobody cares. But it looks good in partition editors.) The partition layout of above wrapper run's output ISO will look like: $ /sbin/fdisk -l output.iso Disk output.iso: 16.5 MiB, 17338368 bytes, 33864 sectors Units: sectors of 1 * 512 =3D 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000 Device Boot Start End Sectors Size Id Type output.iso1 * 64 28103 28040 13.7M 83 Linux output.iso2 28104 33863 5760 2.8M ef EFI (FAT-12/16/32) $ expr $(/sbin/isosize output.iso) / 512 33864 Have a nice day :) Thomas