Skip to content

Commit 8a8b017

Browse files
committed
rg_tool: Now correctly support non-ota partition subtypes
1 parent 599f8ab commit 8a8b017

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

rg_tool.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
PROJECT_ICON = os.getenv("PROJECT_ICON", "assets/icon.raw")
2020
PROJECT_APPS = {
2121
# Project name Type, SubType, Size
22-
'launcher': [0, 0, 1048576],
23-
'updater': [0, 0, 524288], # Should be first to allow growth but it interfere with boot for now
24-
'retro-core': [0, 0, 851968],
25-
'prboom-go': [0, 0, 851968],
26-
'snes9x': [0, 0, 655360],
27-
'gwenesis': [0, 0, 1048576],
28-
'fmsx': [0, 0, 655360],
29-
'gbsp': [0, 0, 851968],
22+
'updater': [0, 0, 393216],
23+
'launcher': [0, 16, 1048576],
24+
'retro-core': [0, 16, 851968],
25+
'prboom-go': [0, 16, 851968],
26+
'snes9x': [0, 16, 655360],
27+
'gwenesis': [0, 16, 1048576],
28+
'fmsx': [0, 16, 655360],
29+
'gbsp': [0, 16, 851968],
3030
}
3131
# PROJECT_APPS = {}
3232
# for t in glob.glob("*/CMakeLists.txt"):
@@ -88,8 +88,11 @@ def build_image(apps, output_file, img_type="odroid", fatsize=0, target="unknown
8888
ota_next_id = 16
8989
for app in apps:
9090
part = PROJECT_APPS[app]
91-
args += [str(part[0]), str(ota_next_id), str(part[2]), app, os.path.join(app, "build", app + ".bin")]
92-
ota_next_id += 1
91+
subtype = part[1]
92+
if part[0] == 0 and (part[1] & 0xF0) == 0x10: # Rewrite OTA indexes to maintain order
93+
subtype = ota_next_id
94+
ota_next_id += 1
95+
args += [str(part[0]), str(subtype), str(part[2]), app, os.path.join(app, "build", app + ".bin")]
9396
if fatsize:
9497
args += ["1", "129", fatsize, "vfs", "none"]
9598

@@ -201,10 +204,6 @@ def monitor_app(app, port, baudrate=115200):
201204
apps = [app for app in PROJECT_APPS.keys() if app in apps] # Ensure ordering and uniqueness
202205

203206
try:
204-
if command in ["build-fw", "build-img", "release", "install"] and "launcher" not in apps:
205-
print("\nWARNING: The launcher is mandatory for those apps and will be included!\n")
206-
apps.insert(0, "launcher")
207-
208207
if command in ["clean", "release"]:
209208
print("=== Step: Cleaning ===\n")
210209
for app in apps:

0 commit comments

Comments
 (0)