fix: offer only the core slots romfs2 reads

systemholder.py builds core.0 to core.19. The Recalbox platform core
list took any core.N section, so a later slot would have been offered
by the platform while no board builds it.
This commit is contained in:
Abdessamad Derraz committed 2026-11-22 00:58:05 +01:00
1 parent 5028318e3d
commit 501b2a84f3
3 files changed
+23 -10

No files matched your search

+8
View File
@@ -14,6 +14,7 @@ TARGET_PREFIX = "BR2_PACKAGE_RECALBOX_TARGET_"
# romfs2 inisettings.py loadFile: a key line is tried first, then a section.
_INI_KEY = re.compile(r'^([^#;].*?)\s?=\s?"?(.*?)"?$')
_INI_SECTION = re.compile(r"^\[(.*)\]")
_CORE_SECTION = re.compile(r"core\.(\d+)(?:\.[\w-]+)?")
# romfs2 keyvaluesettings.py loadFile, the reader configin.py uses.
_CONFIG_KEY = re.compile(r"^([^#;].*?)\s?=\s?(.+)$")
@@ -25,6 +26,13 @@ class SystemIni:
sections: dict[str, dict[str, str]]
lines: dict[str, int]
def core_sections(self) -> Iterator[dict[str, str]]:
"""Every `[core.N]` and `[core.N.<board>]` section some board builds."""
for name, values in self.sections.items():
slot = _CORE_SECTION.fullmatch(name)
if slot and int(slot.group(1)) < CORE_SLOTS:
yield values
def slots(self, board: str) -> Iterator[str]:
"""The `core.N` sections a board builds: `[core.N]` or `[core.N.<board>]` alone."""
for slot in range(CORE_SLOTS):