[FL-2675] /int space reservation (#1448)
* storage: added global #defines for /int, /ext & /any * storage: introduced PATH_EXT, PATH_INT& PATH_ANY macros * core apps: moved hardcoded config files names to separate headers; prefixed them with "."; updater: added file name migration to new naming convention on backup extraction * storage: fixed storage_merge_recursive handling of complex directory structures; storage_move_to_sd: changed data migration logic to all non-dot files & all folders * core: added macro aliases for core record names * Bumped protobuf commit pointer * storage: reserved 5 pages in /int; denying write&creation of non-dot files when running out of free space Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -11,7 +11,7 @@ typedef FILINFO SDFileInfo;
|
||||
typedef FRESULT SDError;
|
||||
|
||||
#define TAG "StorageExt"
|
||||
#define STORAGE_PATH "/ext"
|
||||
|
||||
/********************* Definitions ********************/
|
||||
|
||||
typedef struct {
|
||||
@@ -35,9 +35,9 @@ static bool sd_mount_card(StorageData* storage, bool notify) {
|
||||
|
||||
while(result == false && counter > 0 && hal_sd_detect()) {
|
||||
if(notify) {
|
||||
NotificationApp* notification = furi_record_open("notification");
|
||||
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
|
||||
sd_notify_wait(notification);
|
||||
furi_record_close("notification");
|
||||
furi_record_close(RECORD_NOTIFICATION);
|
||||
}
|
||||
|
||||
if((counter % 2) == 0) {
|
||||
@@ -78,9 +78,9 @@ static bool sd_mount_card(StorageData* storage, bool notify) {
|
||||
}
|
||||
|
||||
if(notify) {
|
||||
NotificationApp* notification = furi_record_open("notification");
|
||||
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
|
||||
sd_notify_wait_off(notification);
|
||||
furi_record_close("notification");
|
||||
furi_record_close(RECORD_NOTIFICATION);
|
||||
}
|
||||
|
||||
if(!result) {
|
||||
@@ -224,16 +224,16 @@ static void storage_ext_tick_internal(StorageData* storage, bool notify) {
|
||||
if(storage->status != StorageStatusOK) {
|
||||
FURI_LOG_E(TAG, "sd init error: %s", storage_data_status_text(storage));
|
||||
if(notify) {
|
||||
NotificationApp* notification = furi_record_open("notification");
|
||||
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
|
||||
sd_notify_error(notification);
|
||||
furi_record_close("notification");
|
||||
furi_record_close(RECORD_NOTIFICATION);
|
||||
}
|
||||
} else {
|
||||
FURI_LOG_I(TAG, "card mounted");
|
||||
if(notify) {
|
||||
NotificationApp* notification = furi_record_open("notification");
|
||||
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
|
||||
sd_notify_success(notification);
|
||||
furi_record_close("notification");
|
||||
furi_record_close(RECORD_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,9 +252,9 @@ static void storage_ext_tick_internal(StorageData* storage, bool notify) {
|
||||
|
||||
sd_unmount_card(storage);
|
||||
if(notify) {
|
||||
NotificationApp* notification = furi_record_open("notification");
|
||||
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
|
||||
sd_notify_eject(notification);
|
||||
furi_record_close("notification");
|
||||
furi_record_close(RECORD_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user