From 337ec9cccdad8d958d5465eb5fdf433f17851fb8 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Mon, 6 Apr 2009 15:54:10 -0400 Subject: This is the only place isEfiSystemPartition is used, so pull it in. --- bootloader.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'bootloader.py') diff --git a/bootloader.py b/bootloader.py index 53dba2b74..17234585d 100644 --- a/bootloader.py +++ b/bootloader.py @@ -22,7 +22,7 @@ # import isys -import partedUtils +import parted import os, sys import iutil import string @@ -39,6 +39,15 @@ log = logging.getLogger("anaconda") import booty from booty import bootloaderInfo, checkbootloader +def isEfiSystemPartition(part): + if not part.active: + return False + return (part.disk.type == "gpt" and + part.name == "EFI System Partition" and + part.getFlag(parted.PARTITION_BOOT) and + part.fileSystem.type in ("fat16", "fat32") and + isys.readFSLabel(part.getDeviceNodeName()) != "ANACONDA") + def bootloaderSetupChoices(anaconda): if anaconda.dir == DISPATCH_BACK: rc = anaconda.intf.messageWindow(_("Warning"), @@ -63,10 +72,9 @@ def bootloaderSetupChoices(anaconda): bootPart = None partitions = anaconda.id.storage.partitions for part in partitions: - if part.partedPartition.active and \ - partedUtils.isEfiSystemPartition(part.partedPartition): - bootPart = part.name - break + if part.partedPartition.active and isEfiSystemPartition(part.partedPartition): + bootPart = part.name + break if bootPart: anaconda.id.bootloader.setDevice(bootPart) -- cgit