From e689db3600680c5c84ae2cd0a51bd723885dc965 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Fri, 9 Feb 2024 05:56:13 +0000 Subject: [PATCH] FBT error for updater.bin too big --- scripts/update.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/update.py b/scripts/update.py index 2b0626f2f..c0beee2b6 100755 --- a/scripts/update.py +++ b/scripts/update.py @@ -125,6 +125,13 @@ class Main(App): if not exists(self.args.directory): os.makedirs(self.args.directory) + stage_size = os.stat(self.args.stage).st_size + max_stage_size = 131072 # 2 * MAX_READ in src/update.c + if stage_size > max_stage_size: + self.logger.warn( + f"RAM {stage_basename} size too big ({stage_size} > {max_stage_size} bytes)" + ) + return 2 shutil.copyfile(self.args.stage, join(self.args.directory, stage_basename)) dfu_size = 0 if self.args.dfu: