[PATCH] Organize installer block device name blacklist. (#1148923)
David Lehman
dlehman at redhat.com
Tue Oct 7 16:35:35 UTC 2014
---
blivet/devicetree.py | 4 ----
blivet/udev.py | 8 ++++++++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index a5310b7..65379ee 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -638,10 +638,6 @@ class DeviceTree(object):
if name.startswith("ram"):
return True
- # Memory Technology Devices require special tools to manipulate.
- if name.startswith("mtd"):
- return True
-
if name.startswith("loop"):
# ignore loop devices unless they're backed by a file
return (not loop.get_backing_file(name))
diff --git a/blivet/udev.py b/blivet/udev.py
index c689b12..f03fe66 100644
--- a/blivet/udev.py
+++ b/blivet/udev.py
@@ -26,6 +26,7 @@ import re
from . import util
from .size import Size
+from .flags import flags
from . import pyudev
global_udev = pyudev.Udev()
@@ -33,6 +34,9 @@ global_udev = pyudev.Udev()
import logging
log = logging.getLogger("blivet")
+INSTALLER_BLACKLIST = ["mtd", "mmcblk", "zram"]
+""" device name prefixes to ignore when flags.installer_mode is True """
+
def enumerate_devices(deviceClass="block"):
devices = global_udev.enumerate_devices(subsystem=deviceClass)
return [path[4:] for path in devices]
@@ -171,6 +175,10 @@ def __is_blacklisted_blockdev(dev_name):
if dev_name.startswith("ram") or dev_name.startswith("fd"):
return True
+ if flags.installer_mode:
+ if any(dev_name.startswith(p) for p in INSTALLER_BLACKLIST):
+ 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()
for bad in ("IBM *STMF KERNEL", "SCEI Flash-5", "DGC LUNZ"):
--
1.9.3
More information about the anaconda-patches
mailing list