public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 00/23] subject: fs: fat: extend FAT write operations
@ 2018-09-04  7:49 AKASHI Takahiro
  2018-09-04  7:49 ` [U-Boot] [PATCH v2 01/23] fs: fat: guard the content of include/fat.h AKASHI Takahiro
                   ` (22 more replies)
  0 siblings, 23 replies; 42+ messages in thread
From: AKASHI Takahiro @ 2018-09-04  7:49 UTC (permalink / raw)
  To: u-boot

This patch series[1] is an attempt to address FAT write related issues
in an effort of running UEFI SCT (Self-Certification Test) to verify
UEFI support on u-boot.

SCT is a test platform as well as an extentisive collection of test
cases for UEFI specification. It can run all the tests automatically
and save test results to dedicated log files.

AFAIK, what's missing in the current fat file system to safely run
SCT without errors (I don't mean test case failures) are:
* write a file located under sub-directories
* write a file with non-zero offset
* delete a file
* create a directory

This patch series addresses all of them and what's more, it contains
a file system test; "basic" test is directly derived from test/test-fs.sh.
The others, "ext" and "mkdir," are soly for newly added functionality in
this patch series.

Patch#1 to patch#8 are some sort of preparatory ones.
Patch#9 implements write with sub-directories path.
Patch#10 to patch#12 implement write with non-zero offset.
Patch#13 to patch#17 are related to creating a directory.
Patch#18 provides delete, but it doesn't actually delete a file
but instead return 0 with purging a file content, which is good
enough to run SCT for now.
Patch#19 fixes a minor bug in fs-test.sh.
Patch#20 updates a test result summary.
Patch#21 to patch#23 add a file system test in U-boot pytest suite.

I applied this patch series on top of v2018.09-rc along with a couple
of yet-to--be-upstreamed UEFI-related patches, and could successfully
run unmodified SCT[2] on qemu-arm(arm64).

=== future TODO list ===
1. set creation (,access and modifcation) time
2. debug() vs. printf()
3. open()'s parameter checks
4. precisely detect and prevent write() beyond out-of-space
5. create an unique short name from a long file name
6. fat32's fsInfo support
7. remove "sudo" in pytest, if possible, for fat* case

Without (5) or (6), fsck may issue warnings.

[1] https://git.linaro.org/people/takahiro.akashi/u-boot.git fat_write
[2] http://uefi.org/testtools

Changes in v2 (Sep 4, 2018)
* guard the whole content of fat.h with CONFIG_FS_FAT agaisnt a compiler
  warning
* determine total_sect in struct fsdata correctly, depending on fat type
  (12/16 or 32)
* explicitly revert "fs: fat: cannot write to subdirectories"
* add test scripts with pytest, mostly the same as RFC, but
  removing "sudo" for ext4 case

AKASHI Takahiro (23):
  fs: fat: guard the content of include/fat.h
  fs: fat: extend get_fs_info() for write use
  fs: fat: handle "." and ".." of root dir correctly with
    fat_itr_resolve()
  fs: fat: make directory iterator global for write use
  fs: fat: assure iterator's ->dent belongs to ->clust
  Revert "fs: fat: cannot write to subdirectories"
  fs: fat: check and normailze file name
  fs: fat: write returns error code instead of -1
  fs: fat: support write with sub-directory path
  fs: fat: refactor write interface for a file offset
  fs: fat: support write with non-zero offset
  cmd: fat: add offset parameter to fatwrite
  fs: add mkdir interface
  fs: fat: remember the starting cluster number of directory
  fs: fat: support mkdir
  cmd: fat: add fatmkdir command
  efi_loader: file: support creating a directory
  efi_loader: implement a pseudo "file delete"
  fs-test: fix false positive error at Test Case 12
  fs-test: update the test result as of v2018.09
  test/py: convert fs-test.sh to pytest
  test/py: fs: add extended write operation test
  test/py: fs: add fstest/mkdir test

 cmd/fat.c                            |   22 +-
 fs/fat/fat.c                         |  102 +--
 fs/fat/fat_write.c                   | 1063 ++++++++++++++++----------
 fs/fs.c                              |   46 ++
 include/fat.h                        |   40 +
 include/fs.h                         |   10 +
 lib/efi_loader/efi_file.c            |   24 +-
 test/fs/fs-test.sh                   |   24 +-
 test/py/tests/test_fs/conftest.py    |  331 ++++++++
 test/py/tests/test_fs/fstest_defs.py |   13 +
 test/py/tests/test_fs/test_basic.py  |  287 +++++++
 test/py/tests/test_fs/test_ext.py    |  224 ++++++
 test/py/tests/test_fs/test_mkdir.py  |  112 +++
 13 files changed, 1808 insertions(+), 490 deletions(-)
 create mode 100644 test/py/tests/test_fs/conftest.py
 create mode 100644 test/py/tests/test_fs/fstest_defs.py
 create mode 100644 test/py/tests/test_fs/test_basic.py
 create mode 100644 test/py/tests/test_fs/test_ext.py
 create mode 100644 test/py/tests/test_fs/test_mkdir.py

-- 
2.18.0

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2018-09-25  4:47 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-04  7:49 [U-Boot] [PATCH v2 00/23] subject: fs: fat: extend FAT write operations AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 01/23] fs: fat: guard the content of include/fat.h AKASHI Takahiro
2018-09-04  8:52   ` Alexander Graf
2018-09-04 10:46     ` Heinrich Schuchardt
2018-09-05  1:54       ` AKASHI Takahiro
2018-09-05  5:53         ` Heinrich Schuchardt
2018-09-05  1:14     ` AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 02/23] fs: fat: extend get_fs_info() for write use AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 03/23] fs: fat: handle "." and ".." of root dir correctly with fat_itr_resolve() AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 04/23] fs: fat: make directory iterator global for write use AKASHI Takahiro
2018-09-04  9:01   ` Alexander Graf
2018-09-04 10:50     ` Heinrich Schuchardt
2018-09-04 10:57       ` Alexander Graf
2018-09-05  2:14         ` AKASHI Takahiro
2018-09-05  8:16           ` Alexander Graf
2018-09-06  2:29             ` AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 05/23] fs: fat: assure iterator's ->dent belongs to ->clust AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 06/23] Revert "fs: fat: cannot write to subdirectories" AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 07/23] fs: fat: check and normailze file name AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 08/23] fs: fat: write returns error code instead of -1 AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 09/23] fs: fat: support write with sub-directory path AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 10/23] fs: fat: refactor write interface for a file offset AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 11/23] fs: fat: support write with non-zero offset AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 12/23] cmd: fat: add offset parameter to fatwrite AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 13/23] fs: add mkdir interface AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 14/23] fs: fat: remember the starting cluster number of directory AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 15/23] fs: fat: support mkdir AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 16/23] cmd: fat: add fatmkdir command AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 17/23] efi_loader: file: support creating a directory AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 18/23] efi_loader: implement a pseudo "file delete" AKASHI Takahiro
2018-09-04  9:16   ` Alexander Graf
2018-09-05  2:51     ` AKASHI Takahiro
2018-09-05  8:22       ` Alexander Graf
2018-09-06  2:43         ` AKASHI Takahiro
2018-09-06  6:09           ` Alexander Graf
2018-09-04  7:49 ` [U-Boot] [PATCH v2 19/23] fs-test: fix false positive error at Test Case 12 AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 20/23] fs-test: update the test result as of v2018.09 AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 21/23] test/py: convert fs-test.sh to pytest AKASHI Takahiro
2018-09-14 10:54   ` Simon Glass
2018-09-25  4:47     ` AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 22/23] test/py: fs: add extended write operation test AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 23/23] test/py: fs: add fstest/mkdir test AKASHI Takahiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox