[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



Hi,

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>

Thanks,
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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.