mirror of
https://git.yoctoproject.org/poky
synced 2026-04-18 12:32:12 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
247b7a8c3a
commit
44023e6c41
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user