From daf00a16d572f1022a9ea40ded4c938b19aaf3e2 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Wed, 13 Aug 2014 04:25:32 -0400 Subject: [PATCH] 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 --- mic/imager/raw.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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: -- 2.7.4