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

[FL-3883] Remove internal storage folder if corresponding flag set #3824

Merged
merged 6 commits into from
Aug 9, 2024

Conversation

gsurkov
Copy link
Member

@gsurkov gsurkov commented Aug 6, 2024

What's new

  • If requested via the FuriHalRtcFlagStorageFormatInternal flag, emulate formatting of the internal storage by recursively deleting the /ext/.int directory. This is done once on boot and the flag is reset afterwards.

Verification

  1. Backup your /ext/.int directory if it contains valuable data
  2. Compile and flash the firmware from this branch
  3. Put some files and folders in the /ext/.int directory
  4. Go to Settings -> Storage -> Factory Reset
    a. Alternatively, connect with a companion app and perform a factory reset from there
  5. Look in the /ext/.int directory. The additional files and folders should be missing, with the usual dotfiles having been recreated by Flipper.
  6. Look in the debug logs. There should be warning messages about missing settings files.
  7. Perform a full update via ./fbt flash_usb_full FORCE=1. All files in the /ext/.int directory should be preserved.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

Copy link

github-actions bot commented Aug 7, 2024

Compiled f7 firmware for commit 1db895a4:

@gsurkov gsurkov marked this pull request as ready for review August 7, 2024 14:11
@hedger hedger added the Core+Services HAL, furi & core system services label Aug 7, 2024
status = f_unlink(furi_string_get_cstr(current_path));
if(status != FR_OK) break;

if(!furi_string_equal(current_path, path)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can break on positive condition and move if body out of block, but w/e

@skotopes skotopes merged commit 235cb64 into dev Aug 9, 2024
11 checks passed
@skotopes skotopes deleted the gsurkov/3883_wipe_int branch August 9, 2024 06:40
ofabel pushed a commit to ofabel/flipperzero-firmware that referenced this pull request Sep 26, 2024
…lipperdevices#3824)

* Remove the .int directory when the flag is set
* Improve error handling and variable naming
* Cleanup the code
* Fix updater build

Co-authored-by: あく <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core+Services HAL, furi & core system services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants