[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:
hedger
2022-07-26 15:21:51 +03:00
committed by GitHub
parent 52a83fc929
commit 056446dfed
171 changed files with 1111 additions and 910 deletions

View File

@@ -124,23 +124,23 @@ Bt* bt_alloc() {
// Pin code view port
bt->pin_code_view_port = bt_pin_code_view_port_alloc(bt);
// Notification
bt->notification = furi_record_open("notification");
bt->notification = furi_record_open(RECORD_NOTIFICATION);
// Gui
bt->gui = furi_record_open("gui");
bt->gui = furi_record_open(RECORD_GUI);
gui_add_view_port(bt->gui, bt->statusbar_view_port, GuiLayerStatusBarLeft);
gui_add_view_port(bt->gui, bt->pin_code_view_port, GuiLayerFullscreen);
// Dialogs
bt->dialogs = furi_record_open("dialogs");
bt->dialogs = furi_record_open(RECORD_DIALOGS);
bt->dialog_message = dialog_message_alloc();
// Power
bt->power = furi_record_open("power");
bt->power = furi_record_open(RECORD_POWER);
FuriPubSub* power_pubsub = power_get_pubsub(bt->power);
furi_pubsub_subscribe(power_pubsub, bt_battery_level_changed_callback, bt);
// RPC
bt->rpc = furi_record_open("rpc");
bt->rpc = furi_record_open(RECORD_RPC);
bt->rpc_event = furi_event_flag_alloc();
// API evnent
@@ -353,7 +353,7 @@ int32_t bt_srv() {
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) {
FURI_LOG_W(TAG, "Skipped BT init: device in special startup mode");
ble_glue_wait_for_c2_start(FURI_HAL_BT_C2_START_TIMEOUT);
furi_record_create("bt", bt);
furi_record_create(RECORD_BT, bt);
return 0;
}
@@ -381,7 +381,7 @@ int32_t bt_srv() {
bt->status = BtStatusUnavailable;
}
furi_record_create("bt", bt);
furi_record_create(RECORD_BT, bt);
BtMessage message;
while(1) {

View File

@@ -7,6 +7,8 @@
extern "C" {
#endif
#define RECORD_BT "bt"
typedef struct Bt Bt;
typedef enum {

View File

@@ -0,0 +1,3 @@
#pragma once
#define BT_KEYS_STORAGE_FILE_NAME ".bt.keys"

View File

@@ -2,8 +2,9 @@
#include <furi.h>
#include <lib/toolbox/saved_struct.h>
#include <storage/storage.h>
#define BT_KEYS_STORAGE_PATH "/int/bt.keys"
#define BT_KEYS_STORAGE_PATH INT_PATH(BT_KEYS_STORAGE_FILE_NAME)
#define BT_KEYS_STORAGE_VERSION (0)
#define BT_KEYS_STORAGE_MAGIC (0x18)

View File

@@ -1,6 +1,7 @@
#pragma once
#include "bt_i.h"
#include "bt_keys_filename.h"
bool bt_keys_storage_load(Bt* bt);