[OE-core] [PATCH 4/4] wic: remove useless calls to __write_fstab

Alexandre Belloni alexandre.belloni at free-electrons.com
Sun Feb 8 23:16:24 UTC 2015


__write_fstab() is already iterating over parts. There is now need to
call it fort each parts.

Signed-off-by: Alexandre Belloni <alexandre.belloni at free-electrons.com>
---
 scripts/lib/wic/imager/direct.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index 38d4e78e6273..c605e6423826 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -136,7 +136,7 @@ class DirectImageCreator(BaseImageCreator):
             fstab_lines.append(fstab_entry)
 
     def _write_fstab(self, fstab, fstab_lines):
-        fstab = open(fstab, "w")
+        fstab = open(fstab + ".new", "w")
         for line in fstab_lines:
             fstab.write(line)
         fstab.close()
@@ -258,12 +258,9 @@ class DirectImageCreator(BaseImageCreator):
             # self.assemble() calls Image.assemble() which calls
             # __write_partitition() for each partition to dd the fs
             # into the partitions.
-            fstab = self.__write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
-
             p.prepare(self, self.workdir, self.oe_builddir, self.rootfs_dir,
                       self.bootimg_dir, self.kernel_dir, self.native_sysroot)
 
-            self._restore_fstab(fstab)
 
             self.__image.add_partition(int(p.size),
                                        p.disk,
@@ -277,6 +274,9 @@ class DirectImageCreator(BaseImageCreator):
                                        no_table = p.no_table,
                                        part_type = p.part_type)
 
+        fstab = self.__write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
+        self._restore_fstab(fstab)
+
         self.__image.layout_partitions(self._ptable_format)
 
         self.__imgdir = self.workdir
-- 
2.1.0




More information about the Openembedded-core mailing list