From 4f4df9ccd1e2a792105dadb9eabfa0b637663afc Mon Sep 17 00:00:00 2001 From: Kostas Missos Date: Fri, 8 Mar 2019 00:35:43 +0200 Subject: [PATCH] [Auto boot] Change order of invoking sept This is important, otherwise it can break tools like memloader. Until a semi-usb init solution is found, hekate will show bootlogo and allow you to go to menu. If >= 7.0.0 after that, it will run sept and then show logo again without a wait. For as long as rebuilding the boot process takes. --- bootloader/main.c | 24 ++++++++++++------------ bootloader/sec/tsec.c | 3 +-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/bootloader/main.c b/bootloader/main.c index 3e091fd..bc0ef14 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -695,11 +695,8 @@ out: void auto_launch_firmware() { - if (!(b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH)) - { + if (!h_cfg.sept_run) auto_launch_update(); - gfx_con.mute = true; - } u8 *BOOTLOGO = NULL; char *payload_path = NULL; @@ -719,6 +716,9 @@ void auto_launch_firmware() bool bootlogoFound = false; char *bootlogoCustomEntry = NULL; + if (!(b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH)) + gfx_con.mute = true; + ini_sec_t *cfg_sec = NULL; LIST_INIT(ini_sections); LIST_INIT(ini_list_sections); @@ -843,13 +843,8 @@ void auto_launch_firmware() else goto out; - payload_path = ini_check_payload_section(cfg_sec); - - if (!payload_path) - check_sept(); - u8 *bitmap = NULL; - if (!(b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH)) + if (!(b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH) && h_cfg.bootwait) { if (bootlogoCustomEntry) // Check if user set custom logo path at the boot entry. bitmap = (u8 *)sd_file_read(bootlogoCustomEntry); @@ -915,13 +910,13 @@ void auto_launch_firmware() if (h_cfg.autoboot_list) ini_free(&ini_list_sections); - if (b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH) + if (h_cfg.sept_run) display_backlight_brightness(h_cfg.backlight, 0); else if (h_cfg.bootwait) display_backlight_brightness(h_cfg.backlight, 1000); // Wait before booting. If VOL- is pressed go into bootloader menu. - if (!(b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH)) + if (!h_cfg.sept_run) { btn = btn_wait_timeout(h_cfg.bootwait * 1000, BTN_VOL_DOWN); @@ -929,6 +924,8 @@ void auto_launch_firmware() goto out; } + payload_path = ini_check_payload_section(cfg_sec); + if (payload_path) { ini_free_section(cfg_sec); @@ -936,7 +933,10 @@ void auto_launch_firmware() free(payload_path); } else + { + check_sept(); hos_launch(cfg_sec); + } out: ini_free(&ini_sections); diff --git a/bootloader/sec/tsec.c b/bootloader/sec/tsec.c index 31421c1..ae83fb9 100644 --- a/bootloader/sec/tsec.c +++ b/bootloader/sec/tsec.c @@ -29,8 +29,7 @@ #include "../utils/util.h" #include "../hos/hos.h" -/* #include "../gfx/gfx.h" -extern gfx_con_t gfx_con; */ +// #include "../gfx/gfx.h" static int _tsec_dma_wait_idle() {