[oe-commits] [openembedded-core] 06/43: wic: fix restoring of original fstab

git at git.openembedded.org git at git.openembedded.org
Fri Jun 23 10:44:45 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 29f7735030d383f9614bdb148b52a47c79f05eea
Author: Ed Bartosh <ed.bartosh at linux.intel.com>
AuthorDate: Fri Jun 16 16:19:30 2017 +0300

    wic: fix restoring of original fstab
    
    Wic updates fstab if mount points are specified in .wks.
    After partition images are created the original fstab is restored.
    However, if exception is raised when partition image being prepared
    wic doesn't restore original fstab. This can cause duplication of
    added lines in fstab when 'wic create' runs next time.
    
    Wrapping call of 'prepare' method and restoring original fstab
    even if exception occurs should fix this.
    
    [YOCTO #11633]
    
    Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/lib/wic/plugins/imager/direct.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index ad9082b..aa9cc9f 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -172,10 +172,11 @@ class DirectPlugin(ImagerPlugin):
                     if rsize_bb:
                         part.size = int(round(float(rsize_bb)))
 
-        self._image.prepare(self)
-
-        if fstab_path:
-            shutil.move(fstab_path + ".orig", fstab_path)
+        try:
+            self._image.prepare(self)
+        finally:
+            if fstab_path:
+                shutil.move(fstab_path + ".orig", fstab_path)
 
         self._image.layout_partitions()
         self._image.create()

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list