diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 9d9d794..dcb022b 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -195,9 +195,9 @@ class BootLoader(object):
- consider re-implementing ArgumentList as something else, like
perhaps collections.OrderedDict
- resolve overlap between Platform checkFoo methods and
- _is_valid_target_device and _is_valid_boot_device
- - split certain parts of _is_valid_target_device and
- _is_valid_boot_device into specific bootloader classes
+ _is_valid_stage1_device and _is_valid_stage2_device
+ - split certain parts of _is_valid_stage1_device and
+ _is_valid_stage2_device into specific bootloader classes
"""
name = "Generic Bootloader"
packages = []
@@ -207,26 +207,26 @@ class BootLoader(object):
can_update = False
image_label_attr = "label"
@stage1_device.setter
def stage1_device(self, device):
- if not self._is_valid_target_device(device):
- raise ValueError("%s is not a valid target device" % device.name)
+ if not self._is_valid_stage1_device(device):
+ raise ValueError("%s is not a valid stage1 device" % device.name)
def set_preferred_stage2_type(self, preferred):
""" Set a preferred type of stage1 device.
@@ -431,13 +431,13 @@ class BootLoader(object):
preferred = "disk"
try:
- index = self.target_device_types.index(preferred)
+ index = self.stage1_device_types.index(preferred)
except ValueError:
raise ValueError("'%s' not a valid stage1 device type" % preferred)
- def _is_valid_target_device(self, device):
+ def _is_valid_stage1_device(self, device):
""" Return True if the device is a valid stage1 target device.
The criteria for being a valid stage1 target device vary from
@@ -446,15 +446,15 @@ class BootLoader(object):
a special device. Some examples of these special devices are EFI
system partitions on EFI machines, PReP boot partitions on
iSeries, and Apple bootstrap partitions on Mac. """
- if not self._device_type_match(device, self.target_device_types):
+ if not self._device_type_match(device, self.stage1_device_types):
return False
- if (self.target_device_min_size is not None and
- device.size < self.target_device_min_size):
+ if (self.stage1_device_min_size is not None and
+ device.size < self.stage1_device_min_size):
return False
- if (self.target_device_max_size is not None and
- device.size > self.target_device_max_size):
+ if (self.stage1_device_max_size is not None and
+ device.size > self.stage1_device_max_size):
return False
if not getattr(device, "bootable", True) or
@@ -465,38 +465,38 @@ class BootLoader(object):
if getattr(device.format, "label", None) == "ANACONDA":
return False
- if self.target_device_format_types and
- device.format.type not in self.target_device_format_types:
+ if self.stage1_device_format_types and
+ device.format.type not in self.stage1_device_format_types:
return False
- if self.target_device_disklabel_types:
+ if self.stage1_device_disklabel_types:
for disk in device.disks:
label_type = disk.format.labelType
- if label_type not in self.target_device_disklabel_types:
+ if label_type not in self.stage1_device_disklabel_types:
return False
- if self.target_device_mountpoints and
+ if self.stage1_device_mountpoints and
hasattr(device.format, "mountpoint") and
- device.format.mountpoint not in self.target_device_mountpoints:
+ device.format.mountpoint not in self.stage1_device_mountpoints:
return False
return True
@property
- def target_devices(self):
+ def stage1_devices(self):
""" A list of valid stage1 target devices.
- The list self.target_device_types is ordered, so we return a list
+ The list self.stage1_device_types is ordered, so we return a list
of all valid target devices, sorted by device type, then sorted
according to our drive ordering.
"""
- slots = [[] for t in self.target_device_types]
+ slots = [[] for t in self.stage1_device_types]
for device in self.storage.devices:
- idx = self._device_type_index(device, self.target_device_types)
+ idx = self._device_type_index(device, self.stage1_device_types)
if idx is None:
continue
- if self._is_valid_target_device(device):
+ if self._is_valid_stage1_device(device):
slots[idx].append(device)
- def _is_valid_boot_device(self, device, linux=True, non_linux=False):
+ def _is_valid_stage2_device(self, device, linux=True, non_linux=False):
""" Return True if the specified device might contain an OS image. """
- if not self._device_type_match(device, self.boot_device_types):
+ if not self._device_type_match(device, self.stage2_device_types):
return False
if device.type == "mdarray" and
- device.level not in self.boot_device_raid_levels:
+ device.level not in self.stage2_device_raid_levels:
# TODO: also check metadata version, as ridiculous as that is
return False
- if not self.target_devices:
+ if not self.stage1_devices:
# XXX is this really a dealbreaker?
return False
@@ -531,14 +531,14 @@ class BootLoader(object):
format_types = []
if linux:
- format_types = self.boot_device_format_types
+ format_types = self.stage2_device_format_types
mountpoint = getattr(device.format, "mountpoint", None)
- if self.boot_device_mountpoints and
- mountpoint not in self.boot_device_mountpoints:
+ if self.stage2_device_mountpoints and
+ mountpoint not in self.stage2_device_mountpoints:
return False
if non_linux:
- format_types.extend(self.non_linux_boot_device_for mat_types)
+ format_types.extend(self.non_linux_format_types)
return device.format.type in format_types
@@ -546,13 +546,13 @@ class BootLoader(object):
def bootable_chain_devices(self):
""" Potential boot devices containing non-linux operating systems. """
return [d for d in self.storage.devices
- if self._is_valid_boot_device(d, linux=False, non_linux=True)]
+ if self._is_valid_stage2_device(d, linux=False, non_linux=True)]
@property
def bootable_devices(self):
""" Potential boot devices containing linux operating systems. """
return [d for d in self.storage.devices
- if self._is_valid_boot_device(d)]
+ if self._is_valid_stage2_device(d)]
# XXX account for disklabel type since mbr means nothing on gpt
target_descriptions = {"disk": N_("Master Boot Record"),
@@ -814,11 +814,11 @@ class GRUB(BootLoader):
"mdarray": N_("RAID Device")}
# list of strings representing options for boot device types
- boot_device_types = ["partition", "mdarray"]
- boot_device_raid_levels = [mdraid.RAID1]
+ stage2_device_types = ["partition", "mdarray"]
+ stage2_device_raid_levels = [mdraid.RAID1]
# XXX hpfs, if reported by blkid/udev, will end up with a type of None
- non_linux_device_format_types = ["vfat", "ntfs", "hpfs"]
+ non_linux_format_types = ["vfat", "ntfs", "hpfs"]
- # list of strings representing options for boot device types
- boot_device_types = ["partition"]
+ # stage2 device requirements
+ stage2_device_types = ["partition"]
packages = ["silo"]
diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
index 1105b05..0419592 100644
--- a/pyanaconda/platform.py
+++ b/pyanaconda/platform.py
@@ -62,7 +62,7 @@ class Platform(object):
@property
def bootFSTypes(self):
"""A list of all valid filesystem types for the boot partition."""
- return self.bootloader.boot_device_format_types
+ return self.bootloader.stage2_device_format_types
@property
def defaultBootFSType(self):
@@ -72,7 +72,7 @@ class Platform(object):
@property
def diskLabelTypes(self):
"""A list of valid disklabel types for this architecture."""
- return self.bootloader.target_device_disklabel_types
+ return self.bootloader.stage1_device_disklabel_types
@property
def defaultDiskLabelType(self):
@@ -88,12 +88,12 @@ class Platform(object):
Return a list of error strings if incorrect disklabels are found."""
errors = []
- if not self.bootloader.target_device_disklabel_types:
+ if not self.bootloader.stage1_device_disklabel_types:
return errors
for disk in req.disks:
labelType = disk.format.labelType
- labelTypes = self.bootloader.target_device_disklabel_types
+ labelTypes = self.bootloader.stage1_device_disklabel_types
if labelType not in labelTypes:
errors.append(_("%s must have a %s disk label.")
% (disk.name,
@@ -114,11 +114,11 @@ class Platform(object):
# such that it returns a list of error strings instead of
# True/False
- if req.type not in self.bootloader.boot_device_types:
+ if req.type not in self.bootloader.stage2_device_types:
errors.append(_("The /boot filesystem cannot be on devices of "
"type %s") % req.type)
elif req.type == "mdarray":
- raid_levels = self.bootloader.boot_device_raid_levels
+ raid_levels = self.bootloader.stage2_device_raid_levels
if req.level not in raid_levels:
levels = ",".join(["RAID%d" % l for l in raid_levels])
errors.append(_("RAID sets containing the /boot filesystem "
@@ -175,11 +175,11 @@ class Platform(object):
if not isinstance(size, int) and not isinstance(size, float):
return False
- return ((self.bootloader.target_device_min_size is None or
- size >= self.bootloader.target_device_min_size)
+ return ((self.bootloader.stage1_device_min_size is None or
+ size >= self.bootloader.stage1_device_min_size)
and
- (self.bootloader.target_device_max_size is None or
- size <= self.bootloader.target_device_max_size))
+ (self.bootloader.stage1_device_max_size is None or
+ size <= self.bootloader.stage1_device_max_size))
def weight(self, fstype=None, mountpoint=None):
""" Given an fstype (as a string) or a mountpoint, return an integer
--
1.7.3.4
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list