summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-06-16 16:19:30 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-23 11:44:12 +0100
commit44023e6c41a57d93d7b3a7c6d297e1ca77cd69ff (patch)
treeb72af608826fb59f78c02b1c0d95731fadae4cd8 /scripts/lib/wic
parent247b7a8c3aee8a1a3e28e196aaad964c4598edb6 (diff)
downloadpoky-44023e6c41a57d93d7b3a7c6d297e1ca77cd69ff.tar.gz
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] (From OE-Core rev: 29f7735030d383f9614bdb148b52a47c79f05eea) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index ad9082b2d3..aa9cc9f4e3 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -172,10 +172,11 @@ class DirectPlugin(ImagerPlugin):
172 if rsize_bb: 172 if rsize_bb:
173 part.size = int(round(float(rsize_bb))) 173 part.size = int(round(float(rsize_bb)))
174 174
175 self._image.prepare(self) 175 try:
176 176 self._image.prepare(self)
177 if fstab_path: 177 finally:
178 shutil.move(fstab_path + ".orig", fstab_path) 178 if fstab_path:
179 shutil.move(fstab_path + ".orig", fstab_path)
179 180
180 self._image.layout_partitions() 181 self._image.layout_partitions()
181 self._image.create() 182 self._image.create()