pygrub: Allow GPT partition references
authorMichael Young <m.a.young@durham.ac.uk>
Tue, 25 Oct 2011 18:19:19 +0000 (19:19 +0100)
committerMichael Young <m.a.young@durham.ac.uk>
Tue, 25 Oct 2011 18:19:19 +0000 (19:19 +0100)
The grub2 configuration file in Fedora 16 can have GPT partition
references like (hd0,gpt2) so remove the "gpt" string where necessary

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/pygrub/src/GrubConf.py

index e19f0c25a769d195f0bcbded17234041fa6b26e9..26861af24f2a8807c4249426541af74df7f8f6a8 100644 (file)
@@ -79,6 +79,8 @@ class GrubDiskPart(object):
         val = val.replace("(", "").replace(")", "")
         if val[:5] == "msdos":
             val = val[5:]
+        if val[:3] == "gpt":
+            val = val[3:]
         self._part = int(val)
     part = property(get_part, set_part)