summaryrefslogtreecommitdiffstats
path: root/storage/udev.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2009-03-19 13:57:40 -0400
committerJeremy Katz <katzj@redhat.com>2009-03-19 14:20:42 -0400
commitf03d7e9fd4d3f346f2d0b17fc7713fc886b2ca94 (patch)
tree86a25e903385cf896adccc0fffd24cd0445c96a7 /storage/udev.py
parent8e9e908f53c6c1124cfda9acb70c8d3e465e9fd8 (diff)
downloadanaconda-f03d7e9fd4d3f346f2d0b17fc7713fc886b2ca94.tar.gz
anaconda-f03d7e9fd4d3f346f2d0b17fc7713fc886b2ca94.tar.xz
anaconda-f03d7e9fd4d3f346f2d0b17fc7713fc886b2ca94.zip
Blacklist the live image backing device
We can't let the user install to the usb key holding their live image without causing significant trouble. So blacklist that dev
Diffstat (limited to 'storage/udev.py')
-rw-r--r--storage/udev.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/storage/udev.py b/storage/udev.py
index e8e824698..38946482c 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -22,6 +22,7 @@
import os
import re
+import stat
import iutil
from errors import *
@@ -43,6 +44,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