[PATCH] Add readonly disks to the ignored list (#772977)

Jesse Keating jkeating at redhat.com
Thu Jun 28 18:51:41 UTC 2012


If your disk is read-only, we're just going to flat out ignore it and
not offer it to you for anything.
---
 pyanaconda/storage/devicetree.py |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 4cd16cf..debed1b 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -596,6 +596,20 @@ class DeviceTree(object):
                 self.addIgnoredDisk(name)
                 return True
 
+        # Ignore any readonly disks
+        if (udev_device_is_disk(info) and not
+            (udev_device_is_cdrom(info) or
+             udev_device_is_partition(info) or
+             udev_device_is_dm_partition(info) or
+             udev_device_is_dm_lvm(info) or
+             udev_device_is_dm_crypt(info) or
+             (udev_device_is_md(info) and not
+              udev_device_get_md_container(info)))):
+            if iutil.get_sysfs_attr(info["sysfs_path"], 'ro') == '1':
+                log.debug("Ignoring read only device %s" % name)
+                self.addIgnoredDisk(name)
+                return True
+
         # FIXME: check for virtual devices whose slaves are on the ignore list
 
     def addUdevLVDevice(self, info):
-- 
1.7.10.2



More information about the anaconda-patches mailing list