WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] Add HybridISO support for PyGrub2

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Add HybridISO support for PyGrub2
From: Tim Deegan <tim@xxxxxxx>
Date: Tue, 25 Oct 2011 10:51:17 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Philipp Hahn <hahn@xxxxxxxxxxxxx>
Delivery-date: Tue, 25 Oct 2011 02:52:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1319534259.3385.224.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <201110251057.06774.hahn@xxxxxxxxxxxxx> <1319534259.3385.224.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel