Re: [PATCH] Move the mdRaidBootArches logic into the platform module.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good to me.

On 03/09/2009 09:11 AM, Chris Lumens wrote:
---
  platform.py                  |    8 ++++++++
  storage/__init__.py          |    4 +---
  storage/devicelibs/mdraid.py |    2 --
  3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/platform.py b/platform.py
index 6db026e..2a765cd 100644
--- a/platform.py
+++ b/platform.py
@@ -40,6 +40,7 @@ class Platform(object):
      _bootloaderPackage = None
      _diskType = parted.diskType["msdos"]
      _minimumSector = 0
+    _supportsMdRaidBoot = False

      def __init__(self, anaconda):
          """Creates a new Platform object.  This is basically an abstract class.
@@ -121,6 +122,11 @@ class Platform(object):
          """Return the default platform-specific partitioning information."""
          return [("/boot", self.bootFSType, 200, None, 0, 0)]

+    @property
+    def supportsMdRaidBoot(self):
+        """Does the platform support /boot on MD RAID?"""
+        return self._supportsMdRaidBoot
+
  class EFI(Platform):
      _diskType = parted.diskType["gpt"]

@@ -214,6 +220,7 @@ class IA64(EFI):
  class PPC(Platform):
      _bootloaderPackage = "yaboot"
      _ppcMachine = iutil.getPPCMachine()
+    _supportsMdRaidBoot = True

      @property
      def ppcMachine(self):
@@ -319,6 +326,7 @@ class Sparc(Platform):
  class X86(EFI):
      _bootloaderPackage = "grub"
      _isEfi = iutil.isEfi()
+    _supportsMdRaidBoot = True

      def __init__(self, anaconda):
          EFI.__init__(self, anaconda)
diff --git a/storage/__init__.py b/storage/__init__.py
index 8dda2a4..51a892d 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -42,7 +42,6 @@ from formats import getFormat
  from formats import get_device_format_class
  from formats import get_default_filesystem_type
  from devicelibs.lvm import safeLvmName
-from devicelibs.mdraid import mdRaidBootArches
  from udev import udev_trigger
  import iscsi
  import zfcp
@@ -746,8 +745,7 @@ class Storage(object):
                              "logical volume."))

          # most arches can't have boot on RAID
-        if (boot and boot.type == "mdarray" and
-            iutil.getArch() not in mdRaidBootArches):
+        if boot and boot.type == "mdarray" and not self.anaconda.platform.supportsMdRaidBoot:
              errors.append(_("Bootable partitions cannot be on a RAID "
                              "device."))

diff --git a/storage/devicelibs/mdraid.py b/storage/devicelibs/mdraid.py
index 12f429f..a0d2f6a 100644
--- a/storage/devicelibs/mdraid.py
+++ b/storage/devicelibs/mdraid.py
@@ -28,8 +28,6 @@ from ..errors import *
  import gettext
  _ = lambda x: gettext.ldgettext("anaconda", x)

-mdRaidBootArches = ("i386", "x86_64", "ppc")
-
  def getRaidLevels():
      avail = []
      try:


--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux