The existing FAT filesystem implementation in U-Boot has some bugs that are tricky to fix cleanly without significant rework of the code. For example, see:
http://lists.denx.de/pipermail/u-boot/2015-July/221054.html [PATCH] fat: handle paths that include ../ This series replaces U-Boot's FAT filesystem implementation with the "ff" project; http://elm-chan.org/fsw/ff/00index_e.html. This project appears to be actively maintained, does not have at least the bug referenced in the patch link above, and is quite easy to integrate into U-Boot. An earlier version is also used in Barebox, so presumably it's had some level of testing/exposure there. Note that this series is based on u-boot/master without the patch linked above applied. I wonder if it's a little risky to apply this series after -rc1; perhaps the patch above should be applied to v2015.10, and this series immediately after the release? v2: * buildman passes for everything it can build: * Implemented FAT functions used only by SPL code. * Fixed a warning in ff.c. * Fixed types in integer.h so that >64KiB files are loaded correctly. * ./test/fs/fs-test.sh passes. * Tested on a Raspberry Pi as well as sandbox. * Use a define for a hard-coded array size in ff-uboot.c. Binary size changes due to this series: * Text size increases around 1-6KiB depending on target. * Data size sometimes goes up, sometimes down, depending on target. * Nearly 200KiB of BSS is saved. Stephen Warren (10): disk: support host devices in dev_print() fat: move to a different directory fat: add ff.c implementation fat: apply upstream bugfix to ff.c fat: ff: add ifdef to avoid unused function warning fat: ffconf.h changes for U-Boot port fat: port integer.h to U-Boot types fat: add U-Boot to ff.c API conversion wrapper fat: switch to new FAT implementation fat: remove old implementation disk/part.c | 3 + fs/fat/Makefile | 8 +- fs/fat/diskio.h | 80 + fs/fat/fat.c | 1323 --------------- fs/fat/fat_write.c | 1115 ------------- fs/fat/ff-uboot.c | 403 +++++ fs/fat/ff.c | 4634 ++++++++++++++++++++++++++++++++++++++++++++++++++++ fs/fat/ff.h | 350 ++++ fs/fat/ffconf.h | 277 ++++ fs/fat/file.c | 183 --- fs/fat/integer.h | 35 + 11 files changed, 5784 insertions(+), 2627 deletions(-) create mode 100644 fs/fat/diskio.h delete mode 100644 fs/fat/fat.c delete mode 100644 fs/fat/fat_write.c create mode 100644 fs/fat/ff-uboot.c create mode 100644 fs/fat/ff.c create mode 100644 fs/fat/ff.h create mode 100644 fs/fat/ffconf.h delete mode 100644 fs/fat/file.c create mode 100644 fs/fat/integer.h -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot