[PATCH 0/2] fs: fat: Implement FAT file rename
Burak Gerz
burak at gerz.io
Thu Dec 12 23:06:27 CET 2024
Hello
This patch series is a first implementation for file renaming on a FAT
filesystems. This implementation does a file rename only (no moving
between directories) as needed by bootloaders like systemd-boot [1].
The renaming process is tried to be made as fail-safe as possible, by
1. Writing the new, empty file
2. Copying the address of the start cluster into new directory entry
3. Deleting old file
This can decay in the worst case to a hard link
Additionally, make use of the FAT file rename in /lib/efi_loader
[1] https://www.freedesktop.org/software/systemd/man/latest/systemd-boot.html#Boot%20Counting
Burak Gerz (2):
efi_loader: enable support for file renaming
fs: fat: Implement FAT file rename
fs/fat/fat_write.c | 99 +++++++++++++++++++++++++++++++++++++++
fs/fs.c | 30 ++++++++++++
include/fat.h | 1 +
include/fs.h | 2 +
lib/efi_loader/efi_file.c | 9 ++--
5 files changed, 137 insertions(+), 4 deletions(-)
--
2.45.2
More information about the U-Boot
mailing list