From 06159a1465fc97d8d7b72b9bea39a396f6e7057c Mon Sep 17 00:00:00 2001 From: Gabriel Dalimonte Date: Mon, 17 Feb 2025 13:26:44 -0500 Subject: fs: fat: add rename The implementation roughly follows the POSIX specification for rename() [1]. The ordering of operations attempting to minimize the chance for data loss in unexpected circumstances. The 'mv' command was implemented as a front end for the rename operation as that is what most users are likely familiar with in terms of behavior. The 'FAT_RENAME' Kconfig option was added to prevent code size increase on size-oriented builds like SPL. [1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html Signed-off-by: Gabriel Dalimonte --- test/py/tests/test_fs/fstest_helpers.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/py/tests/test_fs/fstest_helpers.py') diff --git a/test/py/tests/test_fs/fstest_helpers.py b/test/py/tests/test_fs/fstest_helpers.py index faec2982489..c1447b4d43e 100644 --- a/test/py/tests/test_fs/fstest_helpers.py +++ b/test/py/tests/test_fs/fstest_helpers.py @@ -9,5 +9,7 @@ def assert_fs_integrity(fs_type, fs_img): try: if fs_type == 'ext4': check_call('fsck.ext4 -n -f %s' % fs_img, shell=True) + elif fs_type in ['fat12', 'fat16', 'fat32']: + check_call('fsck.fat -n %s' % fs_img, shell=True) except CalledProcessError: raise -- cgit v1.2.3 From 8d0cc62a60b5b92a010f75fd61d9eb9cb8299567 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 17 Mar 2025 04:12:50 +0100 Subject: test_fs: Add exfat tests Add tests for the exfat filesystem. These tests are largely an extension of the FS_GENERIC tests with the following notable exceptions. The filesystem image for exfat tests is generated using combination of exfatprogs mkfs.exfat and python fattools. The fattols are capable of generating exfat filesystem images too, but this is not used, the fattools are only used as a replacement for dosfstools 'mcopy' and 'mdir', which are used to insert files and directories into existing fatfs images and list existing fatfs images respectively, without the need for superuser access to mount such images. The exfat filesystem has no filesystem specific command, there is only the generic filesystem command interface, therefore check_ubconfig() has to special case exfat and skip check for CONFIG_CMD_EXFAT and instead check for CONFIG_FS_EXFAT. Signed-off-by: Marek Vasut --- test/py/tests/test_fs/fstest_helpers.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/py/tests/test_fs/fstest_helpers.py') diff --git a/test/py/tests/test_fs/fstest_helpers.py b/test/py/tests/test_fs/fstest_helpers.py index c1447b4d43e..d25326ee993 100644 --- a/test/py/tests/test_fs/fstest_helpers.py +++ b/test/py/tests/test_fs/fstest_helpers.py @@ -9,6 +9,8 @@ def assert_fs_integrity(fs_type, fs_img): try: if fs_type == 'ext4': check_call('fsck.ext4 -n -f %s' % fs_img, shell=True) + elif fs_type == 'exfat': + check_call('fsck.exfat -n %s' % fs_img, shell=True) elif fs_type in ['fat12', 'fat16', 'fat32']: check_call('fsck.fat -n %s' % fs_img, shell=True) except CalledProcessError: -- cgit v1.2.3