From: Gui Chen Date: Wed, 13 Aug 2014 08:25:32 +0000 (-0400) Subject: copy the real device mapper X-Git-Tag: released-tools-18.01.7~79^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3252005b334e60cd623b0ec0d74a5e015583e6e;p=tools%2Fmic.git 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 --- 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: