[PATCH][f16-branch] Don't allow disks containing the live media as boot disk. (#748587)

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

 



The code to detect the live device's backing device was also broken,
partially because the format of the root line changed in
/run/initramfs/tmp/root.info. This'll fix it until they change it
again next week sometime.
---
 pyanaconda/iw/cleardisks_gui.py  |    2 +-
 pyanaconda/storage/devicetree.py |    9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/iw/cleardisks_gui.py b/pyanaconda/iw/cleardisks_gui.py
index 4713173..9ab4799 100644
--- a/pyanaconda/iw/cleardisks_gui.py
+++ b/pyanaconda/iw/cleardisks_gui.py
@@ -162,7 +162,7 @@ class ClearDisksWindow (InstallWindow):
         if self.anaconda.storage.doAutoPart:
             use_disks = self.anaconda.storage.config.clearPartDisks
         else:
-            use_disks = [d.name for d in disks]
+            use_disks = [d.name for d in disks if not d.protected]
             self.addButton.set_sensitive(False)
             self.removeButton.set_sensitive(False)
 
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 27827f2..7b411e6 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -1028,14 +1028,15 @@ class DeviceTree(object):
             dev_live = "/dev/live"
             root_path = ""
             if os.path.exists(dev_live):
-                root_path = os.readlink(dev_live)
+                root_path = os.path.realpath(dev_live)
             elif os.path.exists(root_info):
-                prefix = "root='block:"
+                prefix = "root='"
                 for line in open(root_info):
-                    if not line.startswith(prefix):
+                    if not line.startswith(prefix) or \
+                       (line[6:12] != "block:" and line[6:11] != "live:"):
                         continue
 
-                    start_idx = len(prefix) - 1
+                    start_idx = line.index(":") + 1
                     root_path = os.path.realpath(line[start_idx:-1])
                     root_name = devicePathToName(root_path)
                     if root_name.startswith("dm-"):
-- 
1.7.6

_______________________________________________
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