Skip to contentSkip to conversation

wic: partition: Run fsck on EXT file systems

PATCH In review Daniel Schultz 2 participants 2 messages Apr 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 wic: partition: Run fsck on EXT file systems

Mkfs may create EXT file systems which can only be optimized by fsck and not by itself, e.g. directory optimization (in Pass 3A).

To prevent those optimizations during runtime, it will be performed after the creation of an EXT file system.

---
Changes:
v3: Added 'test' to avoid build failures with missing e2fsprogs backport

 scripts/lib/wic/partition.py | 3 +++
 1 file changed, 3 insertions(+)
scripts/lib/wic/partition.py +3 -0
index 3b3bd2d..ec3aa66 100644
@@ -239,6 +239,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 -pvfD %s || [ $? -le 3 ]" % (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):
         """
Signature · 1 line
1.9.1
#1 lore raw
Quoted 10 lines · Daniel Schultz

Mkfs may create EXT file systems which can only be optimized by fsck and not by itself, e.g. directory optimization (in Pass 3A).

To prevent those optimizations during runtime, it will be performed after the creation of an EXT file system.

---
Changes:
v3: Added 'test' to avoid build failures with missing e2fsprogs backport

Ah, this might help me.

I am seeing loads of failures in oe-selftest over the weekend on my staging changes.

thanks for the update.

- armin

Quoted 18 lines
  scripts/lib/wic/partition.py | 3 +++
  1 file changed, 3 insertions(+)
scripts/lib/wic/partition.py +3 -0
index 3b3bd2d..ec3aa66 100644
@@ -239,6 +239,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 -pvfD %s || [ $? -le 3 ]" % (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):
          """