-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Installable File System #1579
Installable File System #1579
Conversation
@slaff This build fails because a number of submodules don't get pulled in. I've put the IFS code into a separate repo, pulled in as third-party code, which itself pulls in another submodule and that seems to be the reason it breaks - the build process stops pulling in further submodules. Any idea why this might be the case? UPDATE: Nothing to do with submodules, bug in my make process somwhere... Missed a '+' in Makefile. Doh! |
Ok, anyway I will take a look at the latest PRs later today. |
420829c
to
cf53191
Compare
@slaff travis is having a tantrum about coding style, seems there's a difference in output between clang-format versions 6.0.1 (my version) versus the travis build (version 5.0.0). It looks to me like a bug in the earlier version. Here's an excerpt from the travis log:
I could downgrade to version 5.0.0, but thought I'd check first in case you prefer to fix the travis build. I should add this is the first time this has happened - I've been using version 6.0.1 all along and never had a problem with it. |
If clang-format 5 has an issue it is more logical to replace it with clang-format 6. So please submit a PR that updates to version 6 the clang-format version used in Travis. |
Done. Finally found the time to do it. Pull the develop branch and then rebase your one on |
@mikee47 Make sure to rebase so that I can see only your changes related to this PR. |
1b214c3
to
059d030
Compare
a9ec46c
to
9243d45
Compare
Just came across the esp VFS implementation https://github.com/espressif/esp-idf/tree/master/components/vfs |
My dream is to make Sming run on multiple platforms. As a start (Sming version 4 of ) we could try to make it at least ESP32 compatible. Therefore it would be great if we can use similar/same VFS implementation so that the migration/adaptation effort to ESP32 is as little as possible. |
Been thinking over this for months now. I'm aware of the attempt to migrate Sming to FreeRTOS, however I think we at least need to migrate to the We also need to sort out how we manage flash usage, making use of the flash partition management that the SDK provides. At that point we should be in a far stronger position to look at migrating versions of components from ESP32 for the ESP8266, including VFS if appropriate. What d'ya think? |
Maybe worth having a |
IMHO it would be best to stay as close as possible to the current async execution model and use FreeRTOS only for ESP32 and only to run Sming applications as its main task. We should start describing the code-restructuring needed to have multi-platform code. Ideally Sming v4 should be able to run on ESP8266, ESP32 and some portions of it should run on a Linux machine. The latter is for testing and development purposes. I already have big chunks of the network code compiling under Linux and there I can test it and analyze it better before running it on a real device. Therefore I would love to have that code in one repository instead of keeping the Linux repo in sync with the
Virtual file system and multi-platform support are the biggest tasks that come to my mind. A roadmap is something very nice to have once we have a rough estimation of the efforts needed to complete those tasks. |
Core IFS streams allow use with any file system Add base Formatter class, headers and standard/html/json within Format namespace
@slaff Ready for review on this one. |
Wonderful! |
Docs available shortly at https://smingdev.readthedocs.io/en/ifs/ |
Applications should not use SPIFFS functions directly. | ||
|
||
SPIFFS is now built with ``SPIFFS_OBJ_META_LEN=16`` to store extended attribute information, | ||
but existing volumes should still be readable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Setting to non-zero value enables metadata-related API but also
// changes the on-disk format, so the change is not backward-compatible.
If I understand this correctly all existing spiffs that we have up to now will not be readable any more. @mikee47 Can you check if this is the case? If yes - we should update the documentation and also the upgrade document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this with the Basic_IFS
sample for Host since it gives a detailed file listing, replacing the call to initFileSystem()
with a spiffs_mount()
. After a make flash
I then built the HttpServer_ConfigNetwork
sample and flashed the resulting spiff_rom.bin
. This is what we get:
# Name Modified Size Size (KB) Orig Size Attributes Access
----- -------------------------------- ---------------------- ---------- ---------- ---------- ---------- ----------
0 core.js.gz 2021-02-10T14:58:26Z 30474 29.76 0 ..... aa
1 bootstrap-core.css.gz 2021-02-10T14:58:26Z 15861 15.49 0 ..... aa
2 wifi-sprites.png 2021-02-10T14:58:26Z 1769 1.73 0 ..... aa
3 .lastModified 2021-02-10T14:58:26Z 30 0.03 0 ..... aa
4 settings.html 2021-02-10T14:58:26Z 2535 2.48 0 ..... aa
5 index.html 2021-02-10T14:58:26Z 6030 5.89 0 ..... aa
I then build the same HttpServer_ConfigNetwork
sample under develop
branch and flash the resulting spiff_rom.bin
:
# Name Modified Size Size (KB) Orig Size Attributes Access
----- -------------------------------- ---------------------- ---------- ---------- ---------- ---------- ----------
0 core.js.gz 1971-08-06T13:09:20Z 30474 29.76 0 ..... -x
1 bootstrap-core.css.gz 2040-03-06T05:54:08Z 15861 15.49 0 ..... -x
2 wifi-sprites.png 2075-10-19T13:17:52Z 1769 1.73 0 ..... -x
3 .lastModified 2105-07-27T16:51:12Z 30 0.03 0 CARDM xx
4 settings.html 2081-08-24T13:47:44Z 2535 2.48 0 ..... -x
5 index.html 2088-01-10T18:42:08Z 6030 5.89 0 ..... -x
So the answer I think is YES, it still works, but room for improvement perhaps!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll investigate further to see if there's a reilable way to detect this. Logically I'd expect the unused area (now occupied by 16 bytes of meta) to be 0xFF, but it's not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For info, although file listing is correct file content is not. Fix coming shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and I am happy that this PR is ready for prime time. But we should check if the old spiffs are still readable. If not - then we should explain this in detail before the users cry foul.
Let's merge it then :) |
@mikee47 There are problems when compiling IFS for SMING_ARCH=HOST with GCC 9. The error that I get is:
You can reproduce the same issue also in https://www.katacoda.com/slaff/scenarios/sming-host-emulator. I guess it is related to the following undefines in HostUtil.cpp #undef __STRICT_ANSI__
#undef _GNU_SOURCE |
@slaff |
Here is my GCC. Also you can check the GCC on katacoda. gcc -v
|
I'm running Ubuntu 20.04 so gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04). Clearly this is an issue with library versions so the safest solution is to get rid of those defines as you suggest in HostUtil.cpp. |
|
Spoke too soon. Now getting
|
Does this mean that the gcc 7.5 compiler included in Ubuntu 18.04 will fail (as I just discovered) to compile HostUtil.cpp?
GCC9 isn't in the official Ubuntu 18.04 packages repository. ============= Just did Sming through |
@kmihaylov The |
@kmihaylov Also Ubuntu 18.04 has GCC 8.4 which is fine. You can install it thus:
|
@mikee47 I install manually esp-quick-toolchain, tried with gnu20 and gnu23. Probably I missed something in the paths, although I checked |
This is a work in progress. See
Basic_IFS
sample.TODO:
virtual IFileSystem::mkdir()
andIFileSystem::makedirs()
* [ ] Implementfscopy
utility* [ ] Tidy up test application