[PATCH 2/3] Blacklist the live image backing device

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

 



We can't let the user install to the usb key holding their live
image without causing significant trouble.  So blacklist that dev
---
 storage/udev.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/storage/udev.py b/storage/udev.py
index e8e8246..808ee29 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -43,6 +43,15 @@ def __is_blacklisted_blockdev(dev_name):
     """Is this a blockdev we never want for an install?"""
     if dev_name.startswith("loop") or dev_name.startswith("ram"):
         return True
+    # FIXME: the backing dev for the live image can't be used as an
+    # install target.  note that this is a little bit of a hack 
+    # since we're assuming that /dev/live will exist
+    if os.path.exists("/dev/live") and \
+            stat.S_ISBLK(os.stat("/dev/live")[stat.ST_MODE]):
+        livetarget = os.path.realpath("/dev/live")
+        if livetarget.startswith(dev_name):
+            log.info("%s looks to be the live device; ignoring" % (dev_name,))
+            return True
 
     return False
 
-- 
1.6.1

_______________________________________________
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