From 9d1c0ce30885207e75c1899df8a4271c316299e3 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Tue, 20 Oct 2020 10:34:33 +0300 Subject: [PATCH] Create update.bin if missing This will allow l4t/Android to always use latest hekate in case of old r2p. --- bootloader/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootloader/main.c b/bootloader/main.c index f11bf02..28c1a93 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -293,8 +293,15 @@ void auto_launch_update() EMC(EMC_SCRATCH0) &= ~EMC_HEKA_UPD; else if (sd_mount()) { + // Check if update.bin exists and is newer and launch it. Otherwise create it. if (!f_stat("bootloader/update.bin", NULL)) launch_payload("bootloader/update.bin", true); + else + { + u8 *buf = calloc(0x200, 1); + is_ipl_updated(buf, "bootloader/update.bin", false); + free(buf); + } } }