mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 17:18:35 -07:00
Start removing CFG_PATH() / .config, add MNT_PATH() macro
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAINMENU_APPS_PATH CFG_PATH("mainmenu_apps.txt")
|
||||
#define MAINMENU_APPS_PATH INT_PATH(".mainmenu_apps.txt")
|
||||
|
||||
typedef struct LoaderMenu LoaderMenu;
|
||||
|
||||
|
||||
@@ -14,18 +14,17 @@ extern "C" {
|
||||
|
||||
#define STORAGE_INT_PATH_PREFIX "/int"
|
||||
#define STORAGE_EXT_PATH_PREFIX "/ext"
|
||||
#define STORAGE_MNT_PATH_PREFIX "/mnt"
|
||||
#define STORAGE_ANY_PATH_PREFIX "/any"
|
||||
#define STORAGE_MNT_PATH_PREFIX "/mnt"
|
||||
#define STORAGE_APP_DATA_PATH_PREFIX "/data"
|
||||
#define STORAGE_APP_ASSETS_PATH_PREFIX "/assets"
|
||||
#define STORAGE_CFG_PATH_PREFIX STORAGE_EXT_PATH_PREFIX "/.config"
|
||||
|
||||
#define INT_PATH(path) STORAGE_INT_PATH_PREFIX "/" path
|
||||
#define EXT_PATH(path) STORAGE_EXT_PATH_PREFIX "/" path
|
||||
#define ANY_PATH(path) STORAGE_ANY_PATH_PREFIX "/" path
|
||||
#define MNT_PATH(path) STORAGE_MNT_PATH_PREFIX "/" path
|
||||
#define APP_DATA_PATH(path) STORAGE_APP_DATA_PATH_PREFIX "/" path
|
||||
#define APP_ASSETS_PATH(path) STORAGE_APP_ASSETS_PATH_PREFIX "/" path
|
||||
#define CFG_PATH(path) STORAGE_CFG_PATH_PREFIX "/" path
|
||||
|
||||
#define RECORD_STORAGE "storage"
|
||||
|
||||
|
||||
@@ -611,13 +611,6 @@ void storage_process_alias(
|
||||
storage_process_common_mkdir(app, int_on_ext_path);
|
||||
}
|
||||
furi_string_free(int_on_ext_path);
|
||||
} else if(furi_string_start_with(path, STORAGE_CFG_PATH_PREFIX)) {
|
||||
// Create config folder if it doesn't exist
|
||||
FuriString* config_path = furi_string_alloc_set(STORAGE_CFG_PATH_PREFIX);
|
||||
if(create_folders && storage_process_common_stat(app, config_path, NULL) != FSE_OK) {
|
||||
storage_process_common_mkdir(app, config_path);
|
||||
}
|
||||
furi_string_free(config_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <toolbox/tar/tar_archive.h>
|
||||
#include <toolbox/crc32_calc.h>
|
||||
|
||||
#define FIRSTBOOT_FLAG_PATH CFG_PATH("momentum_firstboot.flag")
|
||||
#define FIRSTBOOT_FLAG_PATH INT_PATH(".momentum_firstboot.flag")
|
||||
|
||||
#define TAG "UpdWorkerBackup"
|
||||
|
||||
@@ -173,7 +173,11 @@ static bool update_task_post_update(UpdateTask* update_task) {
|
||||
tmp_path = furi_string_alloc_set(update_task->update_path);
|
||||
storage_common_rename(
|
||||
update_task->storage,
|
||||
CFG_PATH("firstboot.flag"), // Poor naming, shouldn't be generic for all FW
|
||||
EXT_PATH(".config/firstboot.flag"), // Poor naming, shouldn't be generic for all FW
|
||||
FIRSTBOOT_FLAG_PATH);
|
||||
storage_common_rename(
|
||||
update_task->storage,
|
||||
EXT_PATH(".config/momentum_firstboot.flag"), // Migrate to int on ext
|
||||
FIRSTBOOT_FLAG_PATH);
|
||||
if(storage_common_stat(update_task->storage, FIRSTBOOT_FLAG_PATH, NULL) ==
|
||||
FSE_NOT_EXIST) {
|
||||
|
||||
Reference in New Issue
Block a user