From: Danny Milosavljevic <dannym@scratchpost.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 27661-done@debbugs.gnu.org
Subject: [bug#27661] ISO-9660 image working and ready
Date: Mon, 17 Jul 2017 11:04:34 +0200 [thread overview]
Message-ID: <20170717110434.1576628d@scratchpost.org> (raw)
In-Reply-To: <8760erfp23.fsf@gnu.org>
Hi Ludo,
On Mon, 17 Jul 2017 10:25:08 +0200
ludo@gnu.org (Ludovic Courtès) 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 ‘pk’ or ‘format’ calls in there so see what’s going on?
Yeah, it tries to read beyond the end of the partition. That's because grub-mkrescue creates a tiny fake partition which happens to start where the ISO-9660 filesystem starts and GuixSD mounts it and tries to boot from it (because it has a valid volume id). As it is going on booting, the system boot 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 work. 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 DVD 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 the place yet. As far as I can see, grub-mkrescue uses xorriso which uses mkisofs to actually generate the ISO image. There's a "protective" DOS MBR generated somewhere, but where. It seems that Xorriso_coordinate_system_area and make_isohybrid_mbr are at least related somehow. Also, it's questionable 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 = 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 as FAT FS
J3 82632 2220199 2137568 1G Apple HFS/HFS+ <--- can't find valid HFS 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 architectures. 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 “ps aux | grep qemu” while the derivation is building, and
> copy/paste the QEMU command from there.
Thanks! Very useful.
next prev parent reply other threads:[~2017-07-17 9:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 7:05 [bug#27661] [PATCH] build: Make ISO-9660 image bootable from USB flash drive Danny Milosavljevic
2017-07-12 12:20 ` Ludovic Courtès
2017-07-12 13:44 ` [bug#27661] [PATCH v2] " Danny Milosavljevic
2017-07-12 14:08 ` Ludovic Courtès
2017-07-12 17:28 ` [bug#27661] ISO-9660 image working and ready Danny Milosavljevic
2017-07-12 20:37 ` ng0
2017-07-13 18:53 ` Marius Bakke
2017-07-14 7:30 ` Danny Milosavljevic
2017-07-17 8:22 ` Ludovic Courtès
2017-07-17 19:28 ` Danny Milosavljevic
2017-07-17 19:58 ` Danny Milosavljevic
2017-07-18 13:08 ` Ludovic Courtès
2017-07-18 14:30 ` Danny Milosavljevic
2017-07-18 20:57 ` Ludovic Courtès
2017-07-14 7:55 ` Danny Milosavljevic
2017-07-17 8:25 ` Ludovic Courtès
2017-07-17 9:04 ` Danny Milosavljevic [this message]
2017-07-20 17:22 ` Danny Milosavljevic
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=20170717110434.1576628d@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=27661-done@debbugs.gnu.org \
--cc=ludo@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).