[Concept,v2,29/30] test: fs_helper: Keep metadata_csum enabled for ext4l

Message ID 20260102005112.552256-30-sjg@u-boot.org
State New
Headers
Series ext4l: Add write support (part L) |

Commit Message

Simon Glass Jan. 2, 2026, 12:50 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The ext4l driver supports metadata_csum checksums, unlike the old ext4
driver. Only disable metadata_csum when CONFIG_FS_EXT4L is not enabled,
allowing ext4l to use modern ext4 filesystem features.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

(no changes since v1)

 test/py/tests/fs_helper.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
  

Patch

diff --git a/test/py/tests/fs_helper.py b/test/py/tests/fs_helper.py
index 3c4c6e2df6f..ccde6683534 100644
--- a/test/py/tests/fs_helper.py
+++ b/test/py/tests/fs_helper.py
@@ -174,10 +174,15 @@  class FsHelper:
                 stdout=DEVNULL if self.quiet else None)
 
         if self.fs_type.startswith('ext'):
-            sb_content = check_output(f'tune2fs -l {fs_img}',
-                                    shell=True).decode()
-            if 'metadata_csum' in sb_content:
-                check_call(f'tune2fs -O ^metadata_csum {fs_img}', shell=True)
+            # ext4l supports metadata_csum; the old ext4 driver does not.
+            # Only disable metadata_csum when using the old driver.
+            if self.config and self.config.buildconfig.get(
+                    'config_fs_ext4l', 'n') != 'y':
+                sb_content = check_output(f'tune2fs -l {fs_img}',
+                                        shell=True).decode()
+                if 'metadata_csum' in sb_content:
+                    check_call(f'tune2fs -O ^metadata_csum {fs_img}',
+                               shell=True)
         elif fs_lnxtype == 'exfat':
             check_call(f'fattools cp {self.srcdir}/* {fs_img}', shell=True)
         elif self.srcdir and os.listdir(self.srcdir):