summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGui Chen <gui.chen@intel.com>2014-08-13 04:25:32 -0400
committeradmin <yuhuan.yang@samsung.com>2016-02-04 18:24:28 +0800
commitc3252005b334e60cd623b0ec0d74a5e015583e6e (patch)
tree7c5357af417d28d611c593266f5aed759b9a58cc
parentbdee32128ab5fd1a17e0faf46632930a42c418de (diff)
downloadmic-c3252005b334e60cd623b0ec0d74a5e015583e6e.tar.gz
mic-c3252005b334e60cd623b0ec0d74a5e015583e6e.tar.bz2
mic-c3252005b334e60cd623b0ec0d74a5e015583e6e.zip
copy the real device mapper
some operation like initrd creation need the real device actually, so copy it into _instroot as well Change-Id: Id45680bc2407bfc9e07e90753b9696bb1066db12 Signed-off-by: Gui Chen <gui.chen@intel.com>
-rw-r--r--mic/imager/raw.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mic/imager/raw.py b/mic/imager/raw.py
index 14b7833..649292b 100644
--- a/mic/imager/raw.py
+++ b/mic/imager/raw.py
@@ -256,6 +256,8 @@ class RawImageCreator(BaseImageCreator):
for p in self.__instloop.partitions:
copy_devnode(p['mapper_device'],
self._instroot + p['mapper_device'])
+ copy_devnode(p['mpath_device'],
+ self._instroot + p['mpath_device'])
def unmount(self):
"""
@@ -268,10 +270,14 @@ class RawImageCreator(BaseImageCreator):
path = self._instroot + p['mapper_device']
if os.path.exists(path):
os.unlink(path)
+ if p['mpath_device']:
+ path = self._instroot + p['mpath_device']
+ if os.path.exists(path):
+ os.unlink(path)
path = self._instroot + "/dev/mapper"
if os.path.exists(path):
- os.rmdir(path)
+ shutil.rmtree(path, ignore_errors=True)
for name in self.__disks.keys():
if self.__disks[name].device: