Takahashi Tomohiro
2007-Apr-11 07:48 UTC
[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@jp.fujitsu.com>
Signed-off-by: Tomohiro Takahashi <takatom@jp.fujitsu.com>
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@lists.xensource.com
http://lists.xensource.com/xen-devel
Keir Fraser
2007-Apr-11 14:27 UTC
Re: [Xen-devel] [PATCH][RFC] Support GPT (GUID Partition Table)
On 11/4/07 08:48, "Takahashi Tomohiro" <takatom@jp.fujitsu.com> wrote:> I made a patch for GPT support.I don''t see anything wrong with it, although won''t it always be the first legacy partition that is marked with type 0xee? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
KUWAMURA Shin''ya
2007-Apr-12 08:28 UTC
[Xen-ia64-devel] Re: [Xen-devel] [PATCH][RFC] Support GPT (GUID Partition Table)
Hi Keir,>>>>> On Wed, 11 Apr 2007 15:27:53 +0100 >>>>> keir@xensource.com(Keir Fraser) said: > > On 11/4/07 08:48, "Takahashi Tomohiro" <takatom@jp.fujitsu.com> wrote: > > > I made a patch for GPT support. > > I don''t see anything wrong with it, although won''t it always be the first > legacy partition that is marked with type 0xee?No, but this patch supports the second (or third, ...) legacy partition marked with 0xee. # I have no idea whether it is necessary well... This patch has different problems. get_active_partition() returns a entry of a legacy partition. Since the structure of GPT partition entries differs from the structure of legacy partition entries, this patch has the following problem: - pygrub cannot access a domain more than 2^32 * SECTOR_SIZE because get_fs_offset() treats the offset as a 32-bit integer. In GPT, the offset must be treated as 64-bit integer. - This patch returns a part of a GUID unique to the partition as legacy partition types. pygrub may misunderstand partition types. I plan to fix this problem. Best Regards, -- KUWAMURA Shin''ya _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
KUWAMURA Shin''ya
2007-Apr-13 07:10 UTC
[Xen-ia64-devel] Re: [Xen-devel] [PATCH][RFC] Support GPT (GUID Partition Table)
Hi Keir, On <20070412.172818.73333117.kuwa@jp.fujitsu.com> "KUWAMURA Shin''ya" wrote:> > - pygrub cannot access a domain more than 2^32 * SECTOR_SIZE because > get_fs_offset() treats the offset as a 32-bit integer. In GPT, the > offset must be treated as 64-bit integer. > > - This patch returns a part of a GUID unique to the partition as > legacy partition types. pygrub may misunderstand partition types.I fixed these problems. Best Regards, -- KUWAMURA Shin''ya _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel