Install: Hekate 8GB after copy (fuse >4GiB), dram_fuse helper, RAM test target
All checks were successful
Build / Build (push) Successful in 14s

- Add dram_fuse.c/h for shared fuse-to-MiB mapping
- After successful update/clean install copy: if hekate_8gb.bin exists and
  fuse reports more than 4 GiB, copy to sd:/payload.bin and
  sd:/bootloader/update.bin, then remove source; otherwise remove helper only
- Makefile: make ram-test builds output/RAM-Test.bin (tools/ram_test_main.c)

Made-with: Cursor
This commit is contained in:
2026-03-31 00:05:30 +02:00
parent ef104bce41
commit d1fc24dae8
5 changed files with 282 additions and 92 deletions

View File

@@ -3,6 +3,7 @@
*/
#include "install.h"
#include "dram_fuse.h"
#include "fs.h"
#include "version.h"
#include "gfx.h"
@@ -618,6 +619,50 @@ int delete_path_list(const char* paths[], const char* description) {
return (failed == 0) ? FR_OK : FR_DISK_ERR;
}
#define HEKATE_8GB_SRC "sd:/bootloader/hekate_8gb.bin"
#define PAYLOAD_BIN_DST "sd:/payload.bin"
#define UPDATE_BIN_DST "sd:/bootloader/update.bin"
static void unlink_ignore_err(const char *path)
{
FILINFO fno;
if (f_stat(path, &fno) != FR_OK)
return;
if (fno.fattrib & AM_RDO)
f_chmod(path, fno.fattrib & ~AM_RDO, AM_RDO);
f_unlink(path);
}
/* After pack copy: if >4 GiB fuse RAM, install 8GB Hekate to payload.bin + bootloader/update.bin; always remove hekate_8gb.bin when done or if not used. */
static void install_hekate_8gb_post_copy(void)
{
if (!install_path_exists(HEKATE_8GB_SRC))
return;
int mib = dram_capacity_mib_from_fuse();
if (mib > 4096) {
install_set_color(COLOR_CYAN);
gfx_printf("\nMehr als 4 GB RAM erkannt (Fuse). Die 8-GB-Hekate-Variante wird verwendet.\n");
gfx_printf("Kopiere nach payload.bin und bootloader/update.bin...\n");
install_set_color(COLOR_WHITE);
int r1 = file_copy(HEKATE_8GB_SRC, PAYLOAD_BIN_DST);
int r2 = file_copy(HEKATE_8GB_SRC, UPDATE_BIN_DST);
if (r1 == FR_OK && r2 == FR_OK) {
install_set_color(COLOR_GREEN);
gfx_printf(" [OK] Hekate 8 GB installiert.\n");
install_set_color(COLOR_WHITE);
unlink_ignore_err(HEKATE_8GB_SRC);
} else {
install_set_color(COLOR_ORANGE);
gfx_printf(" [WARN] Kopie fehlgeschlagen (payload: %d, update: %d). hekate_8gb.bin bleibt.\n", r1, r2);
install_set_color(COLOR_WHITE);
}
} else {
unlink_ignore_err(HEKATE_8GB_SRC);
}
}
// Main installation function
int perform_installation(omninx_variant_t pack_variant, install_mode_t mode) {
int res;
@@ -637,7 +682,9 @@ int perform_installation(omninx_variant_t pack_variant, install_mode_t mode) {
install_set_color(COLOR_WHITE);
res = update_mode_install(pack_variant);
if (res != FR_OK) return res;
install_hekate_8gb_post_copy();
install_check_and_clear_screen_if_needed();
// Remove staging directory (installed pack)
res = cleanup_staging_directory(pack_variant);
@@ -676,7 +723,9 @@ int perform_installation(omninx_variant_t pack_variant, install_mode_t mode) {
install_set_color(COLOR_WHITE);
res = clean_mode_install(pack_variant);
if (res != FR_OK) return res;
install_hekate_8gb_post_copy();
install_check_and_clear_screen_if_needed();
// Remove staging directory (installed pack)
res = cleanup_staging_directory(pack_variant);