]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: fix fstab generation
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sun, 1 Mar 2015 12:54:14 +0000 (13:54 +0100)
committerOtavio Salvador <otavio@ossystems.com.br>
Wed, 18 Mar 2015 04:11:01 +0000 (01:11 -0300)
Commit 0a6668f6e60b4195ff4163c00fc972bacdb27b4b still included some
debug and is not working properly as the new fstab is generated too
late.

Change-Id: I1a6f764bc84002c675eee038230558330e62e39f
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
scripts/lib/wic/imager/direct.py

index c605e642382607e6da13342f848822168fe0ee01..d368401af4399128ba66215bfae539f5b3761fb3 100644 (file)
@@ -136,7 +136,7 @@ class DirectImageCreator(BaseImageCreator):
             fstab_lines.append(fstab_entry)
 
     def _write_fstab(self, fstab, fstab_lines):
-        fstab = open(fstab + ".new", "w")
+        fstab = open(fstab, "w")
         for line in fstab_lines:
             fstab.write(line)
         fstab.close()
@@ -250,6 +250,8 @@ class DirectImageCreator(BaseImageCreator):
             if not self.ks.handler.bootloader.source and p.mountpoint == "/boot":
                 self.ks.handler.bootloader.source = p.source
 
+        fstab = self.__write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
+
         for p in parts:
             # need to create the filesystems in order to get their
             # sizes before we can add them and do the layout.
@@ -274,7 +276,6 @@ 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)