From ce9e6668ac8c0c6188026d2374d15b37dee6186c Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Fri, 12 Jan 2007 14:42:07 +0000 Subject: [PATCH] Parse Solaris VTOCs in pygrub. Signed-off-by: John Levon --- tools/pygrub/src/pygrub | 61 +++++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub index ab8a20f31b..13b05d9a67 100644 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -48,8 +48,7 @@ def is_disk_image(file): return True return False -SECTOR_SIZE=512 -def get_active_offset(file): +def get_active_partition(file): """Find the offset for the start of the first active partition " "in the disk image file.""" @@ -58,22 +57,56 @@ def get_active_offset(file): for poff in (446, 462, 478, 494): # partition offsets # active partition has 0x80 as the first byte if struct.unpack("