summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2014-08-08 10:50:07 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-11 10:52:18 +0100
commit1b103bf4a7c7527d4fc57bad1bbd1d5a5bbddb4a (patch)
treeb3e7f9fabd3a041f22bdaa16e042452028afff45 /scripts
parent94e15c18c011b0d7d71276cd4566be2417c2c6be (diff)
downloadopenembedded-core-1b103bf4a7c7527d4fc57bad1bbd1d5a5bbddb4a.tar.gz
openembedded-core-1b103bf4a7c7527d4fc57bad1bbd1d5a5bbddb4a.tar.bz2
openembedded-core-1b103bf4a7c7527d4fc57bad1bbd1d5a5bbddb4a.zip
wic: Update cleanup/unmount-related code
The wic code inherited a basic image-creation flow based on mounting loop devices, but wic doesn't actually mount or unmount anything, so get rid of unmount() and consolidate whatever it did do with cleanup(). Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/mic/imager/baseimager.py28
-rw-r--r--scripts/lib/mic/imager/direct.py2
2 files changed, 7 insertions, 23 deletions
diff --git a/scripts/lib/mic/imager/baseimager.py b/scripts/lib/mic/imager/baseimager.py
index 7f32dd559e..23919d4cfa 100644
--- a/scripts/lib/mic/imager/baseimager.py
+++ b/scripts/lib/mic/imager/baseimager.py
@@ -109,12 +109,11 @@ class BaseImageCreator(object):
"""
pass
- def _unmount_instroot(self):
- """Undo anything performed in _mount_instroot().
+ def _cleanup(self):
+ """Undo anything performed in _create().
- This is the hook where subclasses must undo anything which was done
- in _mount_instroot(). For example, if a filesystem image was mounted
- onto _instroot, it should be unmounted here.
+ This is the hook where subclasses must undo anything which was
+ done in _create().
There is no default implementation.
@@ -161,23 +160,8 @@ class BaseImageCreator(object):
self._create()
- def unmount(self):
- """Unmounts the target filesystem.
-
- The ImageCreator class detaches the system from the install root, but
- other subclasses may also detach the loopback mounted filesystem image
- from the install root.
-
- """
- self._unmount_instroot()
-
-
def cleanup(self):
- """Unmounts the target filesystem and deletes temporary files.
-
- This method calls unmount() and then deletes any temporary files and
- directories that were created on the host system while building the
- image.
+ """Undo anything performed in create().
Note, make sure to call this method once finished with the creator
instance in order to ensure no stale files are left on the host e.g.:
@@ -192,7 +176,7 @@ class BaseImageCreator(object):
if not self.__builddir:
return
- self.unmount()
+ self._cleanup()
shutil.rmtree(self.__builddir, ignore_errors = True)
self.__builddir = None
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index b96740d0f4..91f64d52cf 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -354,7 +354,7 @@ class DirectImageCreator(BaseImageCreator):
return (rootdev, root_part_uuid)
- def _unmount_instroot(self):
+ def _cleanup(self):
if not self.__instimage is None:
try:
self.__instimage.cleanup()