From: Jungseung Lee Date: Wed, 28 Mar 2018 10:15:18 +0000 (+0900) Subject: Check exit status of vdfs image creation X-Git-Tag: accepted/tizen/devbase/tools/20191220.065431^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=184de1083f84d1cf75bff64149b74b72b97f1f24;p=tools%2Fmic.git Check exit status of vdfs image creation If vdfs creation process exit with failure (EXIT_FAILURE), it should be checked. Because it could cause malformed vdfs image creation. In this patch, we added checking code of exit status. Change-Id: I5aae6a8cb6de0b4dcf2dc1f9e27ee6139b26f918 Signed-off-by: Jungseung Lee --- diff --git a/mic/imager/loop.py b/mic/imager/loop.py index 04abd0a..dc2123d 100644 --- a/mic/imager/loop.py +++ b/mic/imager/loop.py @@ -20,7 +20,7 @@ import glob import shutil from mic import kickstart, msger -from mic.utils.errors import CreatorError, MountError +from mic.utils.errors import CreatorError, MountError, VdfsError from mic.utils import misc, runner, fs_related as fs from mic.imager.baseimager import BaseImageCreator from mic.archive import packing, compressing @@ -455,7 +455,10 @@ class LoopImageCreator(BaseImageCreator): fullpathmkvdfs = "mkfs.vdfs" #find_binary_path("mkfs.vdfs") runner.show("%s --help" % fullpathmkvdfs) # fs.mkvdfs(mountpoint, self._outdir+"/"+item['label']+fs_suffix, vdfsopts) - runner.show('%s %s -r %s %s' % (fullpathmkvdfs, vdfsopts, mountpoint, self._imgdir+"/"+item['label']+fs_suffix)) + ret = runner.show('%s %s -r %s %s' % (fullpathmkvdfs, vdfsopts, mountpoint, self._imgdir+"/"+item['label']+fs_suffix)) + if ret != 0: + runner.show("mkfs.vdfs return error") + raise VdfsError("' %s' exited with error (%d)" % (fullpathmkvdfs, ret)) runner.show('umount %s' % mountpoint) # os.unlink(mountpoint)