gptmbr: skip partitions with all-zero PartitionTypeGUID
authorH. Peter Anvin <hpa@zytor.com>
Sun, 27 Jun 2010 00:49:01 +0000 (17:49 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 27 Jun 2010 00:49:01 +0000 (17:49 -0700)
PartitionTypeGUID being zero means an empty slot, and so we should not
count that partition type.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
mbr/gptmbr.S

index d25d27c..8ed4cf4 100644 (file)
@@ -152,6 +152,12 @@ get_ptab:
        popw    %ax                     /* SizeOfPartitionEntry */
 
 find_part:
+       /* If the PartitionTypeGUID is all zero, it's an empty slot */
+       movl      (%di),%edx
+       orl      4(%di),%edx
+       orl      8(%di),%edx
+       orl     12(%di),%edx
+       jz      not_this
        testb   $0x04,48(%di)
        jz      not_this
        andw    %si,%si