From: "Brian C. Lane" <bcl@xxxxxxxxxx> 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(-) diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py index 9163d4d..f8d4628 100644 --- a/pyanaconda/constants.py +++ b/pyanaconda/constants.py @@ -92,3 +92,6 @@ ROOT_PATH = "/mnt/sysimage" DEFAULT_LANG = "en_US.UTF-8" DRACUT_SHUTDOWN_EJECT = "/run/initramfs/usr/lib/dracut/hooks/shutdown/99anaconda-eject.sh" + +# DMI information paths +DMI_CHASSIS_VENDOR = "/sys/class/dmi/id/chassis_vendor" diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py index cfadbb3..43c0574 100644 --- a/pyanaconda/platform.py +++ b/pyanaconda/platform.py @@ -26,6 +26,7 @@ import parted from pyanaconda import bootloader from pyanaconda.storage.devicelibs import mdraid +from pyanaconda.constants import DMI_CHASSIS_VENDOR import iutil from flags import flags @@ -163,6 +164,7 @@ class X86(Platform): def __init__(self, anaconda): super(X86, self).__init__(anaconda) + self.blackListGPT() 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@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list