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

do not auto-resize FS with embedded files in the firmware #19059

Closed
wants to merge 1 commit into from

Conversation

Staars
Copy link
Contributor

@Staars Staars commented Jul 6, 2023

Description:

At first boot after flash or resetting the boot count to 0 with reset 99 Tasmota will try to automatically resize the filesystem partition to the maximum size.
This is problematic when files are embedded in the firmware binary, because they are erased in this process which renders the whole file embedding useless.
Until now it was necessary to flash with fixed partition values to prevent this deletion.

This PR checks, if there are more files than .settings in path / and will not call the resize function.

This is not perfect, as we have to live with the smaller FS, but if a larger FS is needed, then another firmware (without embedded files) should be chosen anyway.

For the future it would be super nice to let the FS grow non-destructive in Tasmota or add some firmware patching magic to esptool.

@s-hadinger Please check, if there is a better solution to accomplish this.

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with Tasmota core ESP32 V.2.0.10
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@s-hadinger
Copy link
Collaborator

s-hadinger commented Jul 6, 2023

@Jason2866 Do you know if there is a way to increase the partition size of LittleFS without erasing the partition?

It looks like
littlefs-project/littlefs#702
and
littlefs-project/littlefs#753
are not merged

@Staars
Copy link
Contributor Author

Staars commented Jul 6, 2023

Yes, that sounds like a potential solution.
I assume, that for our use case the situation should be somewhat easier as we have a fresh FS with only one added file. (.settings) so that the layout at this point in time should be linear.
Could it be enough to just increase the block count in the super block according to the new partition scheme?

@Jason2866
Copy link
Collaborator

Jason2866 commented Jul 6, 2023

Well, looks nice. But this would mean we need to fork IDF LittleFS, since it is a wrapper which uses the orig. LittleFS.
Will have a look how much effort it is to do and to maintain.

@s-hadinger @Staars Would like to see this one merged. If i have tested and resize (without delete) works well we can still change.

@Staars
Copy link
Contributor Author

Staars commented Jul 7, 2023

I am almost sure, that we can expand the partition and the FS purely in Berry while keeping the files.
Will try to prove my theory soon.

Let‘s close this one.

@Staars Staars closed this Jul 7, 2023
@Staars Staars deleted the resize_partition branch November 29, 2023 13:57
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.

3 participants