This series adds support for file renaming to EFI_FILE_PROTOCOL.SetInfo(). One of the use cases for renaming in EFI is to facilitate boot loader boot counting.
No existing filesystems in U-Boot currently include file renaming, resulting in support for renaming at the filesystem level and a concrete implementation for the FAT filesystem. Changes in v2: - update create_link() docstring - remove ATTR_ARCH being implicitly set in create_link() - cleanup log message and verbosity in fs_rename() - update fs_close() docstring with reference to fs_rename() - clarify fs_rename() behaviour in docstring - change fatrename to mv (updating semantics to match mv) - add mv command docs - add FAT_RENAME Kconfig symbol - update rename tests for mv command semantics - update rename test docs on whether mv should succeed or fail - remove all (fat) prefixes from commands used in rename tests - clarify docs in check_path_prefix() - stack allocate fat_itr in check_path_prefix() - log on observed filesystem corruption in check_path_prefix() - change 'break's to 'goto' in check_path_prefix() - normalize added logging to use log_debug() - correct error code returned when destination directory is not empty - remove setting ATTR_ARCH on parent dirs during renames - skip updating timestamps if no RTC present - make fat_itr stack allocated in update_parent_dir_props - update parent dir props in create_link and delete_dentry_link - simplify freeing of new_file_name and new_path Gabriel Dalimonte (6): fs: fat: factor out dentry link create/delete fs: add rename infrastructure fs: fat: add rename fs: fat: update parent dirs metadata on dentry create/delete efi_loader: move path out of file_handle efi_loader: support file rename in SetInfo() cmd/fs.c | 14 + doc/usage/cmd/mv.rst | 61 +++ fs/fat/Kconfig | 7 + fs/fat/fat_write.c | 476 +++++++++++++++++++++--- fs/fs.c | 95 +++++ include/fat.h | 1 + include/fs.h | 16 +- lib/efi_loader/Kconfig | 1 + lib/efi_loader/efi_file.c | 58 ++- test/py/tests/test_fs/conftest.py | 121 ++++++ test/py/tests/test_fs/fstest_helpers.py | 2 + test/py/tests/test_fs/test_rename.py | 372 ++++++++++++++++++ 12 files changed, 1157 insertions(+), 67 deletions(-) create mode 100644 doc/usage/cmd/mv.rst create mode 100644 test/py/tests/test_fs/test_rename.py -- 2.34.1