Also account for the possibility of multiple protected block devices.
It is entirely possible that there are multiple protected block devices.
Any of the live device, the base repo, and the stage2 image can reside on
(potentially different) block devices.
Related: rhbz#853789
---
pyanaconda/__init__.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index ba4e3c5..9a2bb19 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -142,15 +142,18 @@ class Anaconda(object):
@property
def protected(self):
import stat
-
+ specs = []
if os.path.exists("/run/initramfs/livedev") and \
stat.S_ISBLK(os.stat("/run/initramfs/livedev")[stat.ST_MODE]):
- return [os.readlink("/run/initramfs/livedev")]
- elif self.methodstr and self.methodstr.startswith("hd:"):
- method = self.methodstr[3:]
- return [method.split(":", 3)[0]]
- else:
- return []
+ specs.append(os.readlink("/run/initramfs/livedev"))
+
+ if self.methodstr and self.methodstr.startswith("hd:"):
+ specs.append(self.methodstr[3:].split(":", 3)[0])
+
+ if self.stage2 and self.stage2.startswith("hd:"):
+ specs.append(self.stage2[3:].split(":", 3)[0])
+
+ return specs
@property
def storage(self):
--
1.8.1.4
Show replies by date
Ack to these 5
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)