Embed assets in elf file (#2466)

* FBT: file_assets generator
* Elf file: process manifest section externally
* FBT, file_assets generator: add assets signature
* Storage: assets path alias
* Flipper application: assets unpacker
* Apps, Storage: use '/data' alias for apps data
* Storage: copy file to file
* Assets: log flag, fixes
* Update f18 api
* Assets: asserts
* Assets: fix signature_data check
* App assets: example
* Example assets: fix folder structure in readme
* Assets: fix error handling
* Assets builder: use ansii instead of utf-8, use .fapassets section instead of .fapfiles, add assets path to signature
* Elf file: comment strange places
* Storage: totaly optimized storage_file_copy_to_file
This commit is contained in:
Sergey Gavrilov
2023-03-09 18:01:53 +03:00
committed by GitHub
parent 50ef5deefc
commit 4fd043398a
22 changed files with 937 additions and 113 deletions

View File

@@ -37,6 +37,14 @@ typedef enum {
ELFFileLoadStatusMissingImports,
} ELFFileLoadStatus;
typedef enum {
ElfProcessSectionResultNotFound,
ElfProcessSectionResultCannotProcess,
ElfProcessSectionResultSuccess,
} ElfProcessSectionResult;
typedef bool(ElfProcessSection)(File* file, size_t offset, size_t size, void* context);
/**
* @brief Allocate ELFFile instance
* @param storage
@@ -59,21 +67,12 @@ void elf_file_free(ELFFile* elf_file);
*/
bool elf_file_open(ELFFile* elf_file, const char* path);
/**
* @brief Load ELF file manifest
* @param elf
* @param manifest
* @return bool
*/
bool elf_file_load_manifest(ELFFile* elf, FlipperApplicationManifest* manifest);
/**
* @brief Load ELF file section table (load stage #1)
* @param elf_file
* @param manifest
* @return bool
*/
bool elf_file_load_section_table(ELFFile* elf_file, FlipperApplicationManifest* manifest);
bool elf_file_load_section_table(ELFFile* elf_file);
/**
* @brief Load and relocate ELF file sections (load stage #2)
@@ -122,6 +121,21 @@ void elf_file_init_debug_info(ELFFile* elf_file, ELFDebugInfo* debug_info);
*/
void elf_file_clear_debug_info(ELFDebugInfo* debug_info);
/**
* @brief Process ELF file section
*
* @param elf_file
* @param name
* @param process_section
* @param context
* @return ElfProcessSectionResult
*/
ElfProcessSectionResult elf_process_section(
ELFFile* elf_file,
const char* name,
ElfProcessSection* process_section,
void* context);
#ifdef __cplusplus
}
#endif