This patch series represents a continuation of version 2 [1], incorporating tests and improvements.
[1] https://lore.kernel.org/u-boot/20250203211719.GX1233568@bill-the-cat/ Changes in v3: - Abort the rename if the destination is a path instead of a file - Add fatrnfile command for renaming files in a FAT file system - Verify FAT file rename functionality with unit tests Changes in v2: - Adapt variable names for better consistency - Add missing rename hooks - Use EFI_ACCESS_DENIED for unsuccessful renames - Avoid using of "== 0" - Move the call to set_blk_dev earlier in the sequence - Refactor delete_dentry_long for improved reusability - Separate the rename implementation from changes in the filesystem layer - Eliminate code duplication with delete_dentry_long(..) - Ensure that the source file exists, but not the destination file - Free the fatbuf if it has been reinitialized with fat_itr_root - Delete orphaned FAT entry after copying file metadata Daniel Venzin (6): fs: Add unimplemented rename hook to FS layer efi_loader: Support for file renaming fs: fat: Refactor delete_dentry_long interface fs: fat: Support basic file rename cmd: fat: Add fatrnfile command test/py: fs: Add fstest/rnfile test cmd/fat.c | 13 +++ fs/fat/fat_write.c | 149 +++++++++++++++++++++++++-- fs/fs.c | 50 +++++++++ include/fat.h | 1 + include/fs.h | 11 ++ lib/efi_loader/efi_file.c | 11 +- test/py/tests/test_fs/conftest.py | 75 ++++++++++++++ test/py/tests/test_fs/test_rnfile.py | 93 +++++++++++++++++ 8 files changed, 392 insertions(+), 11 deletions(-) create mode 100644 test/py/tests/test_fs/test_rnfile.py -- 2.39.5