Drop newlib printf: log via BDK s_vprintf, add debug.ini log switch
log_write was the only vsnprintf user and pulled in newlib's printf, dtoa, malloc and soft-float code (~44 KB). The payload now fits the RCM limit again (146800 -> 102801 bytes); the build fails if it grows past it. debug.ini log=1 writes sd:/config/omninx/install.log.
This commit is contained in:
1 parent
555ff07ae4
commit
702cce7d3e
7 files changed
+205
-156
No files matched your search
+31
-2
@@ -289,7 +289,9 @@ int folder_copy_with_progress_v2(const char *src, const char *dst, const char *d
|
||||
install_set_color(COLOR_WHITE);
|
||||
|
||||
// Perform the copy with progress updates
|
||||
log_write("COPY TREE %s -> %s (%d Eintraege)\n", src, dst, (u32)total);
|
||||
res = folder_copy_progress_recursive(src, dst, &copied, total, start_x, start_y, display_name, &last_percent);
|
||||
log_write("COPY TREE %s: %s\n", src, fs_error_str(res));
|
||||
|
||||
// Final update - overwrite the same line
|
||||
gfx_con_setpos(start_x, start_y);
|
||||
@@ -499,6 +501,7 @@ int delete_path_lists_grouped(const char *folder_display_name, ...) {
|
||||
res = f_unlink(path);
|
||||
}
|
||||
|
||||
log_write("DELETE %s: %s\n", path, fs_error_str(res));
|
||||
if (res == FR_OK || res == FR_NO_FILE)
|
||||
deleted++;
|
||||
else
|
||||
@@ -1343,6 +1346,7 @@ static void install_extras_post_copy(void)
|
||||
}
|
||||
|
||||
#define INSTALL_DEBUG_INI "sd:/config/omninx/debug.ini"
|
||||
#define INSTALL_LOG_PATH "sd:/config/omninx/install.log"
|
||||
|
||||
typedef struct {
|
||||
bool active;
|
||||
@@ -1356,6 +1360,7 @@ typedef struct {
|
||||
bool skip_update_staging_cleanup;
|
||||
bool skip_update_horizon_oc;
|
||||
bool skip_hekate_8gb_post_copy;
|
||||
bool log;
|
||||
} install_debug_opts_t;
|
||||
|
||||
static void install_debug_load(install_debug_opts_t *d)
|
||||
@@ -1397,6 +1402,8 @@ static void install_debug_load(install_debug_opts_t *d)
|
||||
d->skip_update_horizon_oc = install_ini_kv_truth(kv->val);
|
||||
else if (strcmp(kv->key, "skip_hekate_8gb_post_copy") == 0)
|
||||
d->skip_hekate_8gb_post_copy = install_ini_kv_truth(kv->val);
|
||||
else if (strcmp(kv->key, "log") == 0)
|
||||
d->log = install_ini_kv_truth(kv->val);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1405,7 +1412,7 @@ static void install_debug_load(install_debug_opts_t *d)
|
||||
d->active = d->skip_clean_backup || d->skip_clean_wipe || d->skip_clean_restore
|
||||
|| d->skip_clean_install || d->skip_clean_staging_cleanup || d->skip_update_cleanup
|
||||
|| d->skip_update_install || d->skip_update_staging_cleanup || d->skip_update_horizon_oc
|
||||
|| d->skip_hekate_8gb_post_copy;
|
||||
|| d->skip_hekate_8gb_post_copy || d->log;
|
||||
}
|
||||
|
||||
static void install_debug_print_banner(const install_debug_opts_t *d)
|
||||
@@ -1435,17 +1442,39 @@ static void install_debug_print_banner(const install_debug_opts_t *d)
|
||||
gfx_printf(" ueberspringe: HorizonOC Update (Backup/Restore)\n");
|
||||
if (d->skip_hekate_8gb_post_copy)
|
||||
gfx_printf(" ueberspringe: extras RAM / Hekate-Auswahl / Post-Copy\n");
|
||||
if (d->log)
|
||||
gfx_printf(" Log: %s\n", INSTALL_LOG_PATH);
|
||||
install_set_color(COLOR_WHITE);
|
||||
gfx_printf("\n");
|
||||
}
|
||||
|
||||
static int perform_installation_steps(omninx_variant_t pack_variant, install_mode_t mode, const install_debug_opts_t *d);
|
||||
|
||||
// Main installation function
|
||||
int perform_installation(omninx_variant_t pack_variant, install_mode_t mode) {
|
||||
int res;
|
||||
install_debug_opts_t dbg;
|
||||
install_debug_load(&dbg);
|
||||
install_debug_print_banner(&dbg);
|
||||
|
||||
if (dbg.log) {
|
||||
log_init(INSTALL_LOG_PATH);
|
||||
log_write("Version: %s\nModus: %s\nVariante: %d\n\n", VERSION,
|
||||
mode == INSTALL_MODE_UPDATE ? "Update" : "Clean", (u32)pack_variant);
|
||||
}
|
||||
|
||||
int res = perform_installation_steps(pack_variant, mode, &dbg);
|
||||
|
||||
if (log_is_enabled()) {
|
||||
log_write("\n=== Ende: res=%d (%s) ===\n", (u32)res, fs_error_str(res));
|
||||
log_close();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static int perform_installation_steps(omninx_variant_t pack_variant, install_mode_t mode, const install_debug_opts_t *d) {
|
||||
int res;
|
||||
const install_debug_opts_t dbg = *d;
|
||||
|
||||
if (mode == INSTALL_MODE_UPDATE) {
|
||||
if (pack_variant == VARIANT_OC && !dbg.skip_update_horizon_oc) {
|
||||
bool had_horizon_cfg = install_path_exists(HORIZON_OC_CONFIG_PATH);
|
||||
|
||||
Reference in new issue
Block a user