It ends up that setting the pmbr on GPT labeled disks only fixes
some of the systems that have trouble booting from GPT. We still need
to blacklist Lenovo systems from using GPT on BIOS systems.
This also changes from using dmidecode to using /sys/class/dmi/ files.
---
pyanaconda/constants.py | 3 +++
pyanaconda/platform.py | 14 ++++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
def setDefaultPartitioning(self):
"""Return the default platform-specific partitioning information."""
@@ -181,6 +183,18 @@ class X86(Platform):
else:
return 0
+ def blackListGPT(self):
+ """ Remove GPT disk label as an option on systems where their BIOS
+ doesn't boot from GPT labeled disks.
+
+ Currently this includes: Lenovo
+ """
+ if not os.path.isfile(DMI_CHASSIS_VENDOR):
+ return
+ buf = open(DMI_CHASSIS_VENDOR).read()
+ if "LENOVO" in buf.splitlines() and "gpt" in self._disklabel_types:
+ self._disklabel_types.remove("gpt")
+
class EFI(Platform):
_bootloaderClass = bootloader.EFIGRUB
--
1.7.7.6
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
04-03-2012, 11:33 PM
Will Woods
restore the GPT blacklist code
This looks good, but I have a possibly-minor concern about the matching,
below:
On Mon, 2012-04-02 at 11:00 -0700, Brian C. Lane wrote:
> + def blackListGPT(self):
> + """ Remove GPT disk label as an option on systems where their BIOS
> + doesn't boot from GPT labeled disks.
> +
> + Currently this includes: Lenovo
> + """
> + if not os.path.isfile(DMI_CHASSIS_VENDOR):
> + return
> + buf = open(DMI_CHASSIS_VENDOR).read()
> + if "LENOVO" in buf.splitlines() and "gpt" in self._disklabel_types:
The splitlines() is confusing here.. is LENOVO supposed to be a
substring match, or an exact match? Also: are you sure it's always
uppercase?
Maybe this should be a bit looser, and the match a bit clearer?
if "gpt" in self._disklabel_types:
vendor = open(DMI_CHASSIS_VENDOR).read().strip().lower()
if "lenovo" in vendor:
I'm sure it works as-is but I'd rather not have to revise the patch once
we find out that *some* Lenovo systems have "Lenovo" and some "LENOVO"
and some "Lenovo, Inc.", etc, etc.. Unless there's some standard/spec
that says that'll never happen?
-w
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list