This includes some new code to really narrow it down to disk devices. This might be able to use shared code in the future that's going into newui but not yet.
It will also have to be backported to RHEL6 but that'll be a different patch.
-jlk
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):
On Thu, 2012-06-28 at 11:51 -0700, Jesse Keating wrote:
If your disk is read-only, we're just going to flat out ignore it and not offer it to you for anything.
Ack.
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 disksif (udev_device_is_disk(info) and not(udev_device_is_cdrom(info) orudev_device_is_partition(info) orudev_device_is_dm_partition(info) orudev_device_is_dm_lvm(info) orudev_device_is_dm_crypt(info) or(udev_device_is_md(info) and notudev_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 listdef addUdevLVDevice(self, info):
On 28.06.2012 20:51, Jesse Keating wrote:
If your disk is read-only, we're just going to flat out ignore it and not offer it to you for anything.
It would be good if some kind of information was shown with the list of read-only drives. Otherwise I can already imagine spurious bug reports with someone who have just forgotten to disable write-protext on USB stick or SD card.
On 06/28/2012 05:14 PM, Vladimir Serbinenko wrote:
On 28.06.2012 20:51, Jesse Keating wrote:
If your disk is read-only, we're just going to flat out ignore it and not offer it to you for anything.
It would be good if some kind of information was shown with the list of read-only drives. Otherwise I can already imagine spurious bug reports with someone who have just forgotten to disable write-protext on USB stick or SD card.
I went down this route first, showing the drive but not allowing manipulation of it. Unfortunately it required code in a wide array of files across UIs and disk interactions. It was too large of a change in my opinion, particularly if it'll get mostly thrown out with newui. In newui we might be able to have a more global check for readonly protection and still show them, but for now it's safest to just not show the disk at all.
If your disk is read-only, we're just going to flat out ignore it and not offer it to you for anything.
We don't want to be able to offer read-only disks as things you can at least have mounted in the finished system? We used to allow that.
- Chris
On 06/29/2012 06:26 AM, Chris Lumens wrote:
If your disk is read-only, we're just going to flat out ignore it and not offer it to you for anything.
We don't want to be able to offer read-only disks as things you can at least have mounted in the finished system? We used to allow that.
That's correct. To display it but not allow any attempts at modifying it required quite a lot of extra code. Dave suggested we just add it to the ignore list. With newui it might be easier to show but prevent manipulation, maybe.
anaconda-patches@lists.fedorahosted.org