summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2009-10-20 12:22:55 -0500
committerDavid Lehman <dlehman@redhat.com>2009-10-20 12:22:55 -0500
commit58823e98bd6d6dbc8372816ddff29267bcad526b (patch)
treededeb000c3e0e080a04eb13d79c9e0f403731a5d
parente7c3ef925d8e36b8d556d7653b11c2e09d0c4b59 (diff)
downloadanaconda-58823e98bd6d6dbc8372816ddff29267bcad526b.tar.gz
anaconda-58823e98bd6d6dbc8372816ddff29267bcad526b.tar.xz
anaconda-58823e98bd6d6dbc8372816ddff29267bcad526b.zip
Mark live device as protected instead of ignoring it. (#517260)
-rw-r--r--storage/devicetree.py11
-rw-r--r--storage/udev.py12
2 files changed, 11 insertions, 12 deletions
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 570464fe8..bce15346d 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -21,6 +21,7 @@
#
import os
+import stat
import block
import re
@@ -1930,6 +1931,16 @@ class DeviceTree(object):
if name:
self.protectedDevNames.append(name)
+ # 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 = devicePathToName(os.path.realpath("/dev/live"))
+ log.info("%s looks to be the live device; marking as protected"
+ % (livetarget,))
+ self.protectedDevNames.append(livetarget)
+
# each iteration scans any devices that have appeared since the
# previous iteration
old_devices = {}
diff --git a/storage/udev.py b/storage/udev.py
index d051157b5..7cc20a8b2 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -21,7 +21,6 @@
#
import os
-import stat
import iutil
from errors import *
@@ -77,17 +76,6 @@ 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") or dev_name.startswith("fd"):
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"):
- livetarget = livetarget[5:]
- if livetarget.startswith(dev_name):
- log.info("%s looks to be the live device; ignoring" % (dev_name,))
- return True
if os.path.exists("/sys/class/block/%s/device/model" %(dev_name,)):
model = open("/sys/class/block/%s/device/model" %(dev_name,)).read()