From 1dabe126ac905707a1757d42eefb64bfe00c6d31 Mon Sep 17 00:00:00 2001 From: niklascfw Date: Mon, 30 Nov 2026 22:41:02 +0100 Subject: [PATCH] Let Erista reboot to hekate The entry was hidden on Erista whenever the SD card was not mounted while the menu was built. When shown, it tried atmosphere/reboot_payload.bin first; on OmniNX that is fusee, which is rejected as not hekate, and the rejection unmounted the card, so bootloader/update.bin was never found. Always offer the entry, try the hekate files first, mount the card before each attempt and point to RCM if hekate cannot be loaded. --- source/tegraexplorer/mainmenu.c | 4 +++- source/utils/utils.c | 35 ++++++++++++++++++--------------- source/utils/utils.h | 1 - 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/source/tegraexplorer/mainmenu.c b/source/tegraexplorer/mainmenu.c index b98506e..27dc360 100644 --- a/source/tegraexplorer/mainmenu.c +++ b/source/tegraexplorer/mainmenu.c @@ -145,7 +145,9 @@ void EnterMainMenu(){ sd_unmount(); // // -- Exit -- - mainMenuEntries[MainRebootHekate].hide = !h_cfg.t210b01 && (!sd_get_card_mounted() || !hekate_reboot_available()); + // Always offered: on Erista, reboot_to_hekate_menu() mounts the SD card + // itself and says so if hekate is missing. + mainMenuEntries[MainRebootHekate].hide = false; mainMenuEntries[MainRebootRCM].hide = h_cfg.t210b01; mainMenuEntries[FixMarikoWarmbootSleep].hide = !h_cfg.t210b01; diff --git a/source/utils/utils.c b/source/utils/utils.c index e963576..2631838 100644 --- a/source/utils/utils.c +++ b/source/utils/utils.c @@ -12,33 +12,22 @@ #include "../fs/fsutils.h" #include "../config.h" #include +#include #include extern hekate_config h_cfg; extern int launch_payload_ex(char *path, bool force_hekate_menu); +// Hekate files first: reboot_payload.bin is often Atmosphere's fusee (no hekate +// magic, skipped by launch_payload_ex), so it only helps when it is hekate. static const char *hekate_payload_paths[] = { - "sd:/atmosphere/reboot_payload.bin", "sd:/bootloader/update.bin", "sd:/bootloader/payloads/hekate.bin", + "sd:/atmosphere/reboot_payload.bin", "sd:/sept/payload.bin", }; -bool hekate_reboot_available(void) -{ - if (h_cfg.t210b01) - return true; - - for (u32 i = 0; i < sizeof(hekate_payload_paths) / sizeof(hekate_payload_paths[0]); i++) - { - if (FileExists(hekate_payload_paths[i])) - return true; - } - - return false; -} - void reboot_to_hekate_menu(void) { if (h_cfg.t210b01) @@ -50,8 +39,22 @@ void reboot_to_hekate_menu(void) return; } + // Erista: chainload hekate from the SD card (mounted here, so the entry + // also works after an action unmounted the card). + if (!sd_get_card_mounted() && !sd_mount()) + { + gfx_clearscreen(); + gfx_printf("\n\nSD-Karte konnte nicht gemountet werden.\n\nNutze \"Neustart in RCM-Modus\" und starte\nhekate per Payload-Injector.\n\nDruecke eine Taste um zurueckzukehren"); + hidWait(); + return; + } + for (u32 i = 0; i < sizeof(hekate_payload_paths) / sizeof(hekate_payload_paths[0]); i++) { + // launch_payload_ex() unmounts the card when it rejects a payload that is + // not hekate, so mount again before checking the next path. + if (!sd_get_card_mounted() && !sd_mount()) + break; if (!FileExists(hekate_payload_paths[i])) continue; @@ -60,7 +63,7 @@ void reboot_to_hekate_menu(void) } gfx_clearscreen(); - gfx_printf("\n\nHekate nicht gefunden.\n\nDruecke eine Taste um zurueckzukehren"); + gfx_printf("\n\nHekate nicht gefunden (bootloader/update.bin).\n\nNutze \"Neustart in RCM-Modus\" und starte\nhekate per Payload-Injector.\n\nDruecke eine Taste um zurueckzukehren"); hidWait(); } diff --git a/source/utils/utils.h b/source/utils/utils.h index ef1f1d2..566058f 100644 --- a/source/utils/utils.h +++ b/source/utils/utils.h @@ -7,7 +7,6 @@ bool StrEndsWith(char *begin, char *end); void WaitFor(u32 ms); void RebootToPayloadOrRcm(); void reboot_to_hekate_menu(void); -bool hekate_reboot_available(void); int launch_payload_ex(char *path, bool force_hekate_menu); int launch_payload(char *path);