All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Philipp Hahn <hahn@univention.de>
Subject: Re: [PATCH] Add HybridISO support for PyGrub2
Date: Tue, 25 Oct 2011 10:51:17 +0100	[thread overview]
Message-ID: <20111025095117.GA421@ocelot.phlegethon.org> (raw)
In-Reply-To: <1319534259.3385.224.camel@zakaz.uk.xensource.com>

At 10:17 +0100 on 25 Oct (1319537858), Ian Campbell wrote:
> On Tue, 2011-10-25 at 09:56 +0100, Philipp Hahn wrote:
> > grub-mkrescue internally uses xorriso, which generates a
> > so-called "hybrid ISO": The ISO images also contains a DOS partition table,
> > which allows the identical ISO file to be stored on an USB stick for booting
> > from it. This breaks PyGrub, since it (wrongly) detects the DOS partition 
> > table and uses the first partition instead of the complete ISO file.
> 
> Is the problem here that, having detected a DOS partition, pygrub is
> then unwilling to accept that the partition contains an ISO9660 file
> system?

The problem is that since the disk has a valid MBR partition table,
pygrub tries all the partitions in that but _doesn't_ try the whole
device (as it would if it couldn't find an MBR).

> Or is it that the DOS partition table covers something other
> than the ISO9660 data? Where does the kernel we want to boot actually
> live?
> 
> Is there some reference to the layout of an hybridiso? i.e. what is the
> significance on 0x8006? What are the chances of false positives?

Looking for "\001CD001" at offset 0x8000 is a pretty good way to
identify an ISO9660 image (e.g. I think that's how magic(5) does it).
This patch doesn't _quite_ do that, and in any case this is the wrong
place to do it.  The right fix to have get_partition_offsets() detect
ISO9660 images and add '[0]' to whatever else it comes up with.

Cheers,

Tim.

  reply	other threads:[~2011-10-25  9:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25  8:56 [PATCH] Add HybridISO support for PyGrub2 Philipp Hahn
2011-10-25  9:17 ` Ian Campbell
2011-10-25  9:51   ` Tim Deegan [this message]
2011-10-25 10:33   ` Philipp Hahn
2011-10-27 10:21     ` Ian Campbell
2011-10-28  7:46       ` [PATCH v2] " Philipp Hahn
2011-10-28 11:54         ` Ian Campbell
2011-11-01 18:53         ` Ian Jackson
2011-11-01 19:04           ` Philipp Hahn
2011-11-02 16:29             ` Ian Jackson

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

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

  git send-email \
    --in-reply-to=20111025095117.GA421@ocelot.phlegethon.org \
    --to=tim@xen.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=hahn@univention.de \
    --cc=xen-devel@lists.xensource.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.