]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: partition.py: Add fsck to avoid corrupt EXT file systems
authorDaniel Schultz <d.schultz@phytec.de>
Mon, 20 Mar 2017 12:18:52 +0000 (13:18 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Mar 2017 22:43:03 +0000 (22:43 +0000)
This patch avoids the creation of a corrupt EXT file system.

Since there are no checks if a EXT file system was successfully created,
this should add to prevent possible system failures.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/partition.py

index 6ef8d7f3c9eed6abac667c6c18ad7c570f76ba2e..8e32afcd8998f6ecfac446f2414be0418313264c 100644 (file)
@@ -286,6 +286,9 @@ class Partition():
             (self.fstype, extra_imagecmd, rootfs, label_str, rootfs_dir)
         exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
 
+        mkfs_cmd = "fsck.%s -fy %s" % (self.fstype, rootfs)
+        exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
+
     def prepare_rootfs_btrfs(self, rootfs, oe_builddir, rootfs_dir,
                              native_sysroot, pseudo):
         """