[PATCH 2/2] If a block device is read-only, throw it out of the deviceList (#471883).

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

 



This means that all read-only devices (USB keys, floppies, whatever) will
be completely skipped by anaconda.  The advantage is we won't get parted
error dialogs for them.  Also, read-only block devices are probably far
less common than read-only filesystems so throwing them out shouldn't cause
too many problems.
---
 isys/isys.py   |    2 +-
 partedUtils.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/isys/isys.py b/isys/isys.py
index 189a6c1..6312ba8 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -300,7 +300,7 @@ def driveDict(klassArg):
                 devName = "/dev/%s" % (device,)
                 makeDevInode(device, devName)
 
-                if not mediaPresent (device):
+                if not mediaPresent (device) or deviceIsReadOnly(device):
                     new[device] = dev
                     continue
 
diff --git a/partedUtils.py b/partedUtils.py
index f2bd909..9c9cd33 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -1223,7 +1223,7 @@ class DiskSet:
             if (DiskSet.exclusiveDisks != [] and drive not in DiskSet.exclusiveDisks) or drive in DiskSet.skippedDisks:
                 continue
             deviceFile = isys.makeDevInode(drive, "/dev/" + drive)
-            if not isys.mediaPresent(drive):
+            if not isys.mediaPresent(drive) or isys.deviceIsReadOnly(drive):
                 self._removeDisk(drive)
                 continue
 
-- 
1.6.1.3

_______________________________________________
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