From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX1xk-0008I3-T5 for guix-patches@gnu.org; Mon, 17 Jul 2017 05:05:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX1xf-0004QT-0e for guix-patches@gnu.org; Mon, 17 Jul 2017 05:05:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:40518) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dX1xe-0004QN-T4 for guix-patches@gnu.org; Mon, 17 Jul 2017 05:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dX1xe-0004dc-Gy for guix-patches@gnu.org; Mon, 17 Jul 2017 05:05:02 -0400 Subject: [bug#27661] ISO-9660 image working and ready Resent-Message-ID: Date: Mon, 17 Jul 2017 11:04:34 +0200 From: Danny Milosavljevic Message-ID: <20170717110434.1576628d@scratchpost.org> In-Reply-To: <8760erfp23.fsf@gnu.org> References: <87d195etic.fsf@gnu.org> <20170712134405.25274-1-dannym@scratchpost.org> <87inixd9z1.fsf@gnu.org> <20170712192827.22b7c740@scratchpost.org> <87eftkjhhd.fsf@fastmail.com> <20170714095521.10045e44@scratchpost.org> <8760erfp23.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 27661-done@debbugs.gnu.org Hi Ludo, On Mon, 17 Jul 2017 10:25:08 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > It looks like the partition detection code in (gnu build file-systems) > tries to read beyond the end of disk or something. Could you try adding > a few =E2=80=98pk=E2=80=99 or =E2=80=98format=E2=80=99 calls in there so = see what=E2=80=99s going on? Yeah, it tries to read beyond the end of the partition. That's because gru= b-mkrescue creates a tiny fake partition which happens to start where the I= SO-9660 filesystem starts and GuixSD mounts it and tries to boot from it (b= ecause it has a valid volume id). As it is going on booting, the system bo= ot wanders off the end of the partition and Linux tells it that it can't do= that. I've posted bug# 27705 which is the minimal set of patches to get it to wor= k. I just read the root filesystem directly from the whole disk there. By now, I've also tested the resulting image on the bare metal on a real DV= D on a non-EFI, non-Libreboot system. Works fine :) Marius, could you also test it on EFI ? As for fixing the original partitioning problem, I didn't manage to find th= e place yet. As far as I can see, grub-mkrescue uses xorriso which uses mk= isofs to actually generate the ISO image. There's a "protective" DOS MBR g= enerated somewhere, but where. It seems that Xorriso_coordinate_system_are= a and make_isohybrid_mbr are at least related somehow. Also, it's question= able whether it's possible to fix it without creating overlapped partitions= , see below. The resulting partition table is: Disk J: 1.1 GiB, 1137074176 bytes, 2220848 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: gpt Disk identifier: F86B53DD-3E7B-4B5E-A4C9-3A1A0AA56D22 Device Start End Sectors Size Type J1 64 76871 76808 37.5M Microsoft basic data <--- GuixSD tried= to use this one as root J2 76872 82631 5760 2.8M EFI System <-- mounts and reads fine a= s FAT FS J3 82632 2220199 2137568 1G Apple HFS/HFS+ <--- can't find valid H= FS on there J4 2220200 2220799 600 300K Microsoft basic data <-- can't mount it P.S. grub-mkrescue (with EFI) has a surprising number of supported architec= tures. It might be that a grub-mkrescue-generated image could also boot on= MIPS, Sparc, PowerPC, ARM64. > Alternately, you could run the same QEMU command line that the > derivation spawns, so you would get a REPL (and backtrace). For that > you can =E2=80=9Cps aux | grep qemu=E2=80=9D while the derivation is buil= ding, and > copy/paste the QEMU command from there. Thanks! Very useful.