Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage, IFS and LittleFS improvements #2487

Merged
merged 7 commits into from
Feb 11, 2022

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Feb 9, 2022

This PR fixes a few bugs and improves support for filesystem archiving and copying.

A couple of issues have been fixed with the ArchiveStream class, used to generates archive files.
These files can be mounted as FWFS partitions for access.

The LittleFS fscopy tool is used to generate LittleFS images from a source FWFS image.
The code has been extracted into a new general-use class FileCopier.
This can be used to restore directory trees with attibutes.

  • Storage

    • Add debug functions (taken from IFS test application)
    • Add block erase support to PartitionStream
  • Add createDirectory and createDirectories functions

    Naming borrowed from std::filesystem.
    Prefer to avoid mkdir in global namespace to avoid possible conflicts with C library.

    Note that a regular fileRemove call can be used to delete a directory, which must be empty.

  • Change FileStream open error to debug-only

    Check for .gz files clutters up debug

  • IFS

    • Add fsbuild --nominify option, and FSBUILD_OPTIONS build variable
    • Fix assertion failure using named root directory for ArchiveStream
    • Fix problem archiving directory which is a mount point
    • Fix host settime, sets timespec incorrectly
    • Support host filesystem rooted to specified directory
    • Move debug helper code into separate unit
    • Add mountArchive helper function, and global function fileMountArchive()
    • Have test build for all architectures
    • Add FileCopier
    • Improve mountpoint handling in fsbuild tool
      • Check for duplicate directory names and throw error
      • Mountpoints can be in subdirectories, all intermediate directories are created
  • LittleFS

    • Allow inline config definitions
    • Move code from fscopy into new IFS FileCopier class
    • Fix fstat call failing to set directory attribute

@slaff slaff added this to the 4.6.0 milestone Feb 9, 2022
Naming borrowed from std::filesystem.
Prefer to avoid `mkdir` in global namespace to avoid possible conflicts with C library.
@mikee47 mikee47 force-pushed the feature/ifs-improvements branch from f77cbf5 to 103e687 Compare February 9, 2022 16:17
- Add fsbuild `--nominify` option, and FSBUILD_OPTIONS build variable
- Fix assertion failure using named root directory for ArchiveStream
- Fix problem archiving directory which is a mount point
- Fix host `settime`, sets timespec incorrectly
- Support host filesystem rooted to specified directory
- Move debug helper code into separate unit
- Add `mountArchive` helper function, and global function `fileMountArchive()`
- Have test build for all architectures
- Add FileCopier
- Allow inline config definitions
- Move code from fscopy into new IFS FileCopier class
- Fix `fstat` call failing to set directory attribute
@mikee47 mikee47 force-pushed the feature/ifs-improvements branch from 103e687 to e8394ee Compare February 10, 2022 10:06
Check for duplicate directory names and throw error
Mountpoints can be in subdirectories, all intermediate directories are createds
@mikee47 mikee47 force-pushed the feature/ifs-improvements branch from 67e4578 to 254af2b Compare February 10, 2022 11:59
Check for .gz files clutters up debug
@slaff
Copy link
Contributor

slaff commented Feb 10, 2022

@mikee47 Ready with this PR?

@mikee47
Copy link
Contributor Author

mikee47 commented Feb 10, 2022

@slaff Yes, all done thanks.

@slaff slaff merged commit b34a80f into SmingHub:develop Feb 11, 2022
@mikee47 mikee47 deleted the feature/ifs-improvements branch February 11, 2022 11:21
slaff pushed a commit that referenced this pull request Feb 15, 2022
This PR fixes a few problems related to handling of file/directory Access Control entries.

**IFS**

- Fix FileCopier class not copying directory attributes
- In filesystem builder, allow minifcation to fail, but print warning (to support e.g. JSON template files)

**LittleFS**

- Fix `readdir()` not setting default ACL
- Translate 'NOENT' lfs error code into 'NotFound' IFS error
- Fix missing directory attribute (imperfect fix in #2487)

Also remove unused FileStream method. Opening on directory handle removed in #2308.
@slaff slaff mentioned this pull request Feb 25, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants