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/
Home Products Support Community News


[Xen-devel] [PATCH][RFC] Support GPT (GUID Partition Table)

To: <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][RFC] Support GPT (GUID Partition Table)
From: "Takahashi Tomohiro" <takatom@xxxxxxxxxxxxxx>
Date: Wed, 11 Apr 2007 16:48:41 +0900
Delivery-date: Wed, 11 Apr 2007 03:23:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

I made a patch for GPT support.

As you see, this patch uses ad-hoc approach.
If you give me an advice, it would be appreciated

Signed-off-by: Shinya Kuwamura <kuwa@xxxxxxxxxxxxxx>
Signed-off-by: Tomohiro Takahashi <takatom@xxxxxxxxxxxxxx>

Tomohiro Takahashi.

diff -r 1bde28f762a6 -r 8e08fd1ffa24 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub   Mon Apr 09 13:40:25 2007 -0600
+++ b/tools/pygrub/src/pygrub   Tue Apr 10 20:30:05 2007 +0900
@@ -58,6 +60,13 @@ def get_active_partition(file):
        # active partition has 0x80 as the first byte
        if struct.unpack("<c", buf[poff:poff+1]) == ('\x80',):
            return buf[poff:poff+16]
+        # type=0xee: GUID partition table
+        # XXX assume the first partition is active
+        if struct.unpack("<c", buf[poff+4:poff+5]) == ('\xee',):
+            os.lseek(fd, 0x400, 0)
+            buf = os.read(fd, 512)
+            return buf[24:40] # XXX buf[32:40]

    # if there's not a partition marked as active, fall back to
    # the first partition

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>