Re: [PATCH 2/6] New iswmd parameter for kernel cmdline

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

 



Jacek Danecki wrote:
This patch add support for new iswmd parameter passed to the kernel command line.

When this parameter is added to the command line it will change support for isw_raid_member format:
- isw_raid_member is removed from udevTypes for DMRAIDMember
- isw_raid_member is added to udevTypes for MDRAIDMember
- md_uuid will be read from udev database

New function md_is_isw() was added to check kernel command line parameter.



commit 2c95814750805874b30b1c1ddb642eceb3a2ee7f
Author: Jacek Danecki <Jacek.Danecki@xxxxxxxxx>
Date:   Tue Apr 14 13:32:13 2009 -0400

    New iswmd parameter for kernel cmdline

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 8c41c50..741f5ab 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -30,6 +30,7 @@ from deviceaction import *
 import formats
 from udev import *
 from iutil import log_method_call
+from flags import flags
 
 import gettext
 _ = lambda x: gettext.ldgettext("anaconda", x)
@@ -1272,6 +1273,12 @@ class DeviceTree(object):
                         log.info("setup of %s failed: %s"
                                             % (lv_device.name, e))
 
+    def md_is_isw(self):
+        if flags.cmdline.has_key("iswmd"):
+            return True
+        else:
+            return False
+
     def handleUdevMDMemberFormat(self, info, device):
         log_method_call(self, name=device.name, type=device.format.type)
         # either look up or create the array device
@@ -1429,7 +1436,8 @@ class DeviceTree(object):
         if format_type == "crypto_LUKS":
             # luks/dmcrypt
             kwargs["name"] = "luks-%s" % uuid
-        elif format_type == "linux_raid_member":
+        elif format_type == "linux_raid_member" or \
+            (format_type == "isw_raid_member" and md_is_isw()):
             # mdraid
             try:
                 kwargs["mdUuid"] = udev_device_get_md_uuid(info)
diff --git a/storage/formats/dmraid.py b/storage/formats/dmraid.py
index 4ebd41c..fdbe14b 100644
--- a/storage/formats/dmraid.py
+++ b/storage/formats/dmraid.py
@@ -21,6 +21,7 @@
 #
 
 from iutil import log_method_call
+from flags import flags
 from ..errors import *
 from . import DeviceFormat, register_device_format
 
@@ -93,5 +94,9 @@ class DMRaidMember(DeviceFormat):
                         type=self.type, status=self.status)
         raise DMRaidMemberError("destruction of dmraid members is non-sense")
 
+
+if flags.cmdline.has_key("iswmd"):
+    DMRaidMember._udevTypes.remove("isw_raid_member")
+
 register_device_format(DMRaidMember)
 
diff --git a/storage/formats/mdraid.py b/storage/formats/mdraid.py
index ec1a617..fb4569c 100644
--- a/storage/formats/mdraid.py
+++ b/storage/formats/mdraid.py
@@ -23,6 +23,7 @@
 import os
 
 from iutil import log_method_call
+from flags import flags
 from parted import PARTITION_RAID
 from ..errors import *
 from ..devicelibs import mdraid
@@ -92,6 +93,8 @@ class MDRaidMember(DeviceFormat):
         # XXX hack -- we don't have a nice way to see if the array is active
         return False
 
+if flags.cmdline.has_key("iswmd"):
+    MDRaidMember._udevTypes.append("isw_raid_member")
 
 register_device_format(MDRaidMember)
 
_______________________________________________
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