mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 04:34:43 +04:00
[FL-3882] Clean up of LFS traces (#3849)
* updater, storage: removed mentions of LFS from public APIs; updated corresponding strings * rpc: updated include path Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "lfs_backup.h"
|
||||
#include "int_backup.h"
|
||||
|
||||
#include <toolbox/tar/tar_archive.h>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <desktop/desktop_settings_filename.h>
|
||||
#include <notification/notification_settings_filename.h>
|
||||
|
||||
#define LFS_BACKUP_DEFAULT_LOCATION EXT_PATH(LFS_BACKUP_DEFAULT_FILENAME)
|
||||
#define INT_BACKUP_DEFAULT_LOCATION EXT_PATH(INT_BACKUP_DEFAULT_FILENAME)
|
||||
|
||||
static void backup_name_converter(FuriString* filename) {
|
||||
if(furi_string_empty(filename) || (furi_string_get_char(filename, 0) == '.')) {
|
||||
@@ -34,18 +34,18 @@ static void backup_name_converter(FuriString* filename) {
|
||||
}
|
||||
}
|
||||
|
||||
bool lfs_backup_create(Storage* storage, const char* destination) {
|
||||
bool int_backup_create(Storage* storage, const char* destination) {
|
||||
const char* final_destination =
|
||||
destination && strlen(destination) ? destination : LFS_BACKUP_DEFAULT_LOCATION;
|
||||
destination && strlen(destination) ? destination : INT_BACKUP_DEFAULT_LOCATION;
|
||||
return storage_int_backup(storage, final_destination) == FSE_OK;
|
||||
}
|
||||
|
||||
bool lfs_backup_exists(Storage* storage, const char* source) {
|
||||
const char* final_source = source && strlen(source) ? source : LFS_BACKUP_DEFAULT_LOCATION;
|
||||
bool int_backup_exists(Storage* storage, const char* source) {
|
||||
const char* final_source = source && strlen(source) ? source : INT_BACKUP_DEFAULT_LOCATION;
|
||||
return storage_common_stat(storage, final_source, NULL) == FSE_OK;
|
||||
}
|
||||
|
||||
bool lfs_backup_unpack(Storage* storage, const char* source) {
|
||||
const char* final_source = source && strlen(source) ? source : LFS_BACKUP_DEFAULT_LOCATION;
|
||||
bool int_backup_unpack(Storage* storage, const char* source) {
|
||||
const char* final_source = source && strlen(source) ? source : INT_BACKUP_DEFAULT_LOCATION;
|
||||
return storage_int_restore(storage, final_source, backup_name_converter) == FSE_OK;
|
||||
}
|
||||
18
lib/update_util/int_backup.h
Normal file
18
lib/update_util/int_backup.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
#define INT_BACKUP_DEFAULT_FILENAME "backup.tar"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool int_backup_create(Storage* storage, const char* destination);
|
||||
bool int_backup_exists(Storage* storage, const char* source);
|
||||
bool int_backup_unpack(Storage* storage, const char* source);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
#define LFS_BACKUP_DEFAULT_FILENAME "backup.tar"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool lfs_backup_create(Storage* storage, const char* destination);
|
||||
bool lfs_backup_exists(Storage* storage, const char* source);
|
||||
bool lfs_backup_unpack(Storage* storage, const char* source);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user